|
Posted by Wayne Tilton on August 15, 2005, 9:39 am
Please log in for more thread options
> Hello there
>
> I just inherited an environment of servers (win2k , win2k03, sql 2k
> and some accounting server apps).
> the problem I see is that there are many services that run the account
> of an EX-admin.
> is there a way of knowing or discovering what services are runnig
> under a certain account on remote servers ? snmp ?
> or have a list of services and maybe component services and the
> account they run under.
>
>
>
> thanks a lot !
>
>
This one will list the IDs used by all services on the specified remote
computer (watch for line wrap):
Computer = WScript.Arguments.Item(0)
GetServiceInfo
Sub GetServiceInfo
Dim objWMIService, Items, Item, ServiceName
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\" & Computer & "\root
\cimv2")
If Err then
WScript.Echo Hex(Err.Number) & " " & Err.Description
Exit Sub
End If
Set Items = objWMIService.ExecQuery("SELECT Name, StartName FROM Win32
_Service",,48)
For Each Item in Items
WScript.Echo Item.Name & "," & Item.StartName
Next
End Sub
And this one will list Com+ IDs:
Computer = WScript.Arguments.Item(0)
GetComPlusInfo
'---------------------------------------'
' Get the non-standard COM+ identities. '
'---------------------------------------'
Sub GetComPlusInfo
Dim Catalog, Applications, AppCount, Counter, AppName, IDentity
On Error Resume Next
'Create COMAdminCatalog object and connect to COM+ catalog
Set Catalog = CreateObject("COMAdmin.COMAdminCatalog")
Catalog.Connect(Computer)
'Get the names of COM+ Applications
Set Applications = Catalog.GetCollection("Applications")
Applications.Populate
If Err then
WScript.Echo "Error " & Hex(Err.Number) & " - " & Err.Description
Exit Sub
End If
'Loop through each application.
For Counter = 0 To (Applications.Count - 1)
'Get the identity/name for each application in the collection
AppName = Applications.Item(counter).Value("Name")
IDentity = Applications.Item(Counter).Value("Identity")
WScript.Echo AppName & "," & IDentity
Next
Set Applications = Nothing
Set Catalog = Nothing
End Sub
HTH,
Wayne Tilton
|