Win32_OperatingSystem 的 64 位等效项是什么?
我继承了一个在 Windows Server 2003 上运行的脚本,需要将其移植到 Windows Server 2008。当前的脚本是:
strComputer = "servernamexyz"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(12)
Next
如何将其转换为在 Windows Server 2008 上运行?谢谢!
I inherited a script running on Windows Server 2003 that I need to port to Windows Server 2008. The current script is:
strComputer = "servernamexyz"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(12)
Next
How do I convert this to run on Windows Server 2008? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没什么可翻译的。这适用于 Windows 2008(32 位和 64 位)。
There's nothing to translate. This works on Windows 2008 (both 32 and 64 bits).
它仍然存在于 server2008 上。
Win32 标签有点不幸,windows95 中最重要的并不是从 16 位到 32 位内存的变化,而是到保护模式的切换。
只是“32 位优于 16 位”在广告中更容易解释 - 但它给 64 位操作系统留下了很多内部命名遗产。
It's still present on server2008.
The Win32 label is a bit unfortunate, it wasn't the change from 16bit to 32bit memory that was the big thing in windows95 it was the switch to protected mode.
It's just that "32bit better than 16bit" was easier to explain in the ads - but it has left an awful lot of internal naming legacies with 64bit OSs.
如上所述,脚本是正确的。问题在于防火墙设置不允许来自远程计算机的 WMI。感谢您的快速反馈。它使我能够快速转向不同的方向。抱歉,我还不能投票给你们俩......
As noted above, the script was correct. The problem was with a firewall setting not allowing WMI from a remote computer. Thanks for the quick feedback. it enabled me to look in a different direction quickly. Sorry I cannot vote both of you up yet....