Thursday, May 24, 2012

Find the processes are running in remote desktop

 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

No comments: