使用WMICclosures远程Win2k8服务器的确切语法是什么?
(必须使用WMIC的原因是因为不同NT域的远程机器和本地机器无法访问该域,WMIC采用/ user:和/ password:远程机器本身的参数和身份validation。
这些不起作用:
wmic /node:10.162.xx / user:tech1 \ xxxx / password:xxxx os call Shutdown
执行(Win32_OperatingSystem) – >关机()
错误:代码= 0x8004102f说明=方法无效参数(s)
设施= WMI
wmic /node:10.162.xx / user:tech1 \ xxxx / password:xxxx os call Shutdown(1)
动词或方法没有input参数。
wmic /node:10.162.xx / user:tech1 \ xxxx / password:xxxx os call Win32Shutdown(1)
执行(Win32_OperatingSystem) – > Win32Shutdown()
错误:
代码= 0x8004102f
说明=方法无效参数(s)
设施= WMI
wmic /node:10.162.xx / user:tech1 \ xxxx / password:xxxx path Win32_OperatingSystem调用Shutdown(1)
动词或方法没有input参数。
wmic /node:10.162.xx / user:tech1 \ xxxx / password:xxxx path Win32_OperatingSystem call Shutdown
执行(Win32_OperatingSystem) – >关机()
错误:代码= 0x8004102f说明=无效的方法参数Facility = WMI
我不知道为什么WMIC不工作,但PowerShell版本确实工作:
$cred = get-credential tech1\xxxxx (gwmi -comp 10.162.xx -cred $cred Win32_OperatingSystem).Shutdown()
系统会提示您input密码,但没有办法提示您input密码。
第一个,但你需要在ipaddress和/用户之间的空间:
添加一个where子句
就像是
wmic os在那里“版本像'%'”调用win32shutdown 2
wmic /node: "machinename" os where primary="true" call shutdown
必须有空格之后:必须有机器名和真实的引号
如果需要进行身份validation,请在机器/user:username和操作系统之间使用/user:username