No announcement yet.

finding accounts for services

  • Filter
  • Time
  • Show
Clear All
new posts

  • finding accounts for services

    Is there a tool available that will allow me to scan all my services and/or dcom components for associated accounts?

  • #2
    Re: finding accounts for services

    The psservice from sysinternals will enable you to dump the service descriptor information for all services for local or remote machines. This may be downloaded from
    MCSA 2000/2003


    • #3
      Re: finding accounts for services

      Thanks much TMWWBK!


      • #4
        Re: finding accounts for services

        I wrote this script to do just that purpose

        'This script was written by Wulie Buntin to determine the running services on whichever PC/Server
        'that is required
        'Written Wullie Buntin 17/12/07
        Option Explicit
        Dim objWMIService, objFSO, objFile, objShell, objItem, colItems
        Dim arrData, strDataIn, iCounter
        'Read file into a variable
        strDataIn = fsoOpen(".\serverlist.txt")
        'Split into an Array
        arrData = Split(strDataIn,vbCrLf)
        For iCounter = 0 to Ubound(arrData)
        	arrData(iCounter) = Trim(arrData(iCounter)) ' clean "white space"
        	'Loop through the services and collect the Service Name and the Start Name
        	Set objWMIService = GetObject("winmgmts:\\" & arrData(iCounter) & "\root\CIMV2") 
        	Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Service",,48)
        	'Create the text file that will hold the service information required
        	Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
        	Set objFile = objFSO.CreateTextFile(".\Results\" & UCase(arrData(iCounter)) & ".txt", True)
        	'Write a title
        	objFile.WriteLine "---------------------------------------------------------"
        	objFile.WriteLine UCase(arrData(iCounter)) & " Running Services and logon accounts"
        	objFile.WriteLine "---------------------------------------------------------" 
        	'Get the services from the specified machine in arrData(iCounter) 
        	For Each objItem in colItems
        		objFile.WriteLine objItem.DisplayName & "|" & objItem.Name & "|" & objItem.StartName
        Set objWMIService = Nothing
        Set colItems = Nothing
        Set objFSO = Nothing
        Set objShell = Nothing
        MsgBox "The script has finished running. Please check the txt files that have been created."
        '* Function fsoOpen(FilePath)
        Function fsoOpen(FilePath)
         Dim FSO
         Set FSO = CreateObject("Scripting.FileSystemObject")
          fsoOpen = FSO.OpenTextFile(FilePath,1).ReadAll
        End Function
        To use itr create a list of your servers in a text file called serverlist.txt and store it in the same location as the script.

        Just so everyone knows i compiled this using any source i could find on the net. I cannot rememebr where i got it so don't ask.