Announcement

Collapse
No announcement yet.

Server service search tool?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Server service search tool?

    I've tried looking high and low and basiclly anywhere I can think of for the following "tool" (if it exists?) : Ability to query a server services and the account &/or username they run under. If these could go to a notepad or any kind of file, that would be great. Yes I could look at every single one, but thats what tools are for; not to mention I have to do this on 50+ servers looking for old domain user accounts so we don't get "suprised" and I get "unemployed"

    As always, any help is appreciated.

    -Sp00ky

  • #2
    You need to be looking at a script for this really. Dont know of ant tool that specifically does it. Off the top of my head you want to look at the Win32_Server account properties and methods.

    Try this for size:

    http://www.microsoft.com/technet/scr.../ossvvb08.mspx
    Server 2000 MCP
    Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Server service search tool?

      Scratch that chief... Im not a programmer and have no idea what to do with that code. I just tried pasting it into an html file for grins but of course nothing happened. Surely someone knows another (Cmd line?) route...

      Comment


      • #4
        If you want it to run then save it into a text file, call it something.VBS and then double click on it. have a play with it, thats how i started and im sure many others.
        Server 2000 MCP
        Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        Comment


        • #5
          Check out the commandline tool 'sc'. Native on W2003, support tools W2000.

          Comment


          • #6
            SC ... interesting

            If you are experienced, perhaps you could give me an idea about what exact query might I use to retieve a service username. I see lots of options, but Im not sure this is going to work in requards to my dilema.

            -Sp00ky

            Comment


            • #7
              Quite simple VB script:

              Code:
              On Error Resume Next
              Dim strComputer
              Dim objWMIService
              Dim colItems
              
              strComputer = "."
              Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
              Set colItems = objWMIService.ExecQuery("Select * from Win32_Service",,48)
              For Each objItem in colItems
              	WScript.Echo "Caption: " & objItem.Caption
              	WScript.Echo "Description: " & objItem.Description
              	WScript.Echo "DesktopInteract: " & objItem.DesktopInteract
              	WScript.Echo "DisplayName: " & objItem.DisplayName
              	WScript.Echo "Name: " & objItem.Name
              	WScript.Echo "Started: " & objItem.Started
              	WScript.Echo "StartMode: " & objItem.StartMode
              	WScript.Echo "StartName: " & objItem.StartName
              	WScript.Echo "State: " & objItem.State
              Next
              Marcel
              Technical Consultant
              Netherlands
              http://www.phetios.com
              http://blog.nessus.nl

              MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
              "No matter how secure, there is always the human factor."

              "Enjoy life today, tomorrow may never come."
              "If you're going through hell, keep going. ~Winston Churchill"

              Comment


              • #8
                And for a remote server (that you have rights to administer) change strComputer from "." to "nameofserver"

                "." will do the local computer on which the script is run on.
                Server 2000 MCP
                Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

                ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                Comment


                • #9
                  BATCH rules
                  To enum services on local computer:
                  Code:
                  for /f "tokens=2 delims=: usebackq" %i in (`sc queryex type^= service ^| findstr /i SERVICE_NAME`) do @echo %i & @sc qc %i | findstr SERVICE_START_NAME
                  To enum services on remote computer:
                  Code:
                  for /f "tokens=2 delims=: usebackq" %i in (`sc \\server queryex type^= service ^| findstr /i SERVICE_NAME`) do @echo %i & @sc \\server qc %i | findstr SERVICE_START_NAME
                  Guy Teverovsky
                  "Smith & Wesson - the original point and click interface"

                  Comment

                  Working...
                  X