I am attempting to execute a powershell script on 10.0.0.20 found at D:\path\script.ps1 with the parameter of 6.9.0 from 10.0.0.199 using VBscript. I believe I am on the right route with the following code but I’m not sure where to go from here. Any suggestions?
side note, it needs to run as administrator
sub main()
dim strComputer, strUser, strPassword
strComputer = "10.0.0.20"
strUser="userName"
strPassword="password"
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer (strComputer, "root\cimv2", strUser, strPassword)
objSWbemServices.Security_.ImpersonationLevel = 3
end sub
main
Enable PSRemoting on the remote system and invoke it that way, assuming that your workstation and the remote system are on the same domain, and your domain account has admin access to the remote system.