Win32_OperatingSystem 的 64 位等效项是什么?

发布于 2024-08-31 14:11:56 字数 539 浏览 3 评论 0原文

我继承了一个在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫腻 2024-09-07 14:11:56

没什么可翻译的。这适用于 Windows 2008(32 位和 64 位)。

There's nothing to translate. This works on Windows 2008 (both 32 and 64 bits).

孤云独去闲 2024-09-07 14:11:56

它仍然存在于 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.

弥枳 2024-09-07 14:11:56

如上所述,脚本是正确的。问题在于防火墙设置不允许来自远程计算机的 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....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文