Script to connect to WMI on a remote computer
Dear friends
What is the script to connect to WMI on remote computer? How do i connect WMI using WMIC?
Thanks
Dear friends
What is the script to connect to WMI on remote computer? How do i connect WMI using WMIC?
Thanks
Hi Ariel,Â
Try this VBScript to connect to remote computers
Â
strComputer = "<remote_computer_name>"
strDomain = "<domain>"
Â
Wscript.StdOut.Write "Please remote computer name:"
strComputer = Wscript.Stdln.Readline
Wscript.StdOut.Write "Please enter domain:"
strDomain =Â Wscript.Stdln.Readline
Â
Wscript.StdOut.Write "Please enter your user name:"
strUserName = Wscript.StdIn.ReadLine
Set objPassword = CreateObject("ScriptPW.Password")
Wscript.StdOut.Write "Please enter your password:"
strPassword = objPassword.GetPassword()
Set objScr = CreateObject("WbemScripting.SWbemLocator")
Set objSvc = objScr .ConnectServer(strComputer, _
"rootcimv2", _
    strUserName, _
    strPassword, _
    "MS_409", _
    "ntlmdomain:" + strDomain)
After connection has been establish you can know process to desired transactions you want on the remote computer such as enumerating running processes.
To use WMIC take a look at this page below:
Â
https://technet.microsoft.com/en-us/library/bb742610.aspx
Â
I hope it helps.
Â
Â