-
In the following source I want the Host Server1 replace by an inputbox variable. How do I do that???
for each Service in
GetObject("winmgmts:{impersonationLevel=impersonate}!//Server1").Instan
cesOf ("Win32_service")
WScript.Echo Service.DisplayName
Next
Thnx.....
HansZ
-
Here is the solution, I have found it meanwhile somewhere else:
MyServer = inputbox("Enter Servername")
set computerobj = getobject("WinNT://" + MyServer)
ComputerObj.Filter = Array("Service")
For Each Service in ComputerObj
WScript.Echo "Service display name = " & Service.DisplayName
WScript.Echo "Service account name = " & Service.ServiceAccountName
Next