0
我试图执行上10.0.0.20
PowerShell脚本在D:\path\script.ps1
与6.9.0从10.0.0.199
使用VBScript参数找到。我相信我在以下代码的正确路线上,但我不知道该从哪里出发。有什么建议么?执行PS脚本远程计算机上使用VBScript
侧面说明,它需要以管理员身份运行
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
我使用vbs的原因是因为调用脚本的软件只能调用vbs而不是powershell。所以它需要是vbs-> ps。没有ps-> ps – mhopkins321
然后编写你的VBScript来执行Powershell脚本。 [实施例](http://social.technet.microsoft.com/Forums/en-US/ilm2/thread/65334d6c-6902-4541-89ce-ffe90b2208d0) – alroc