strComputer = "IPAddres or Computer Name"
strDomain = "DomainName"
strUser = "UserName"
strPassword = "Password"
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,"root\cimv2",strUser,strPassword,,"ntlmdomain:" + strDomain)
Set colSwbemObjectSet = _
objSWbemServices.ExecQuery("Select * From Win32_Process")
For Each objProcess in colSWbemObjectSet
Wscript.Echo "Process Name: " & objProcess.Name
Next
strDomain = "DomainName"
strUser = "UserName"
strPassword = "Password"
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,"root\cimv2",strUser,strPassword,,"ntlmdomain:" + strDomain)
Set colSwbemObjectSet = _
objSWbemServices.ExecQuery("Select * From Win32_Process")
For Each objProcess in colSWbemObjectSet
Wscript.Echo "Process Name: " & objProcess.Name
Next
No comments:
Post a Comment