WMI GetObject 权限被拒绝错误
我编写了一个 VBScript 将 Win2k3 SP2 服务器连接到多个 Win2k3 + SP2 和服务器。 WinXP+SP3机器上可以通过WMI来查询系统的Win32_OperatingSystem和Win32_ComputerSystem类。
Set loWMISvc = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=Pkt}\\" & lsStore & "\root\cimv2")
Note: 'lsStore' is the IP address of the computer system I successfully connection too prior.
然后,我尝试向远程系统创建一个新对象,在该系统中它不断返回权限被拒绝错误(脚本输出):
21/11/2011 1:17:50 PM SUCCESS: Established connection to store
D:\Program Files\SUREfire Systems\Support\MG\QueryStores\QueryStores.vbs(244, 5) Microsoft VBScriptruntime error: Permission denied: 'GetObject'
尽管按预期设置了对象 ImpersonationLevel 和 AuthenticationLevel 名字对象,WMI 似乎也已正确安装在客户端和远程系统上。与远程系统的初始连接也适用于本地管理员用户。
还有什么可能导致我没有看到的权限被拒绝错误?任何帮助将不胜感激。
I've written a VBScript to connect a Win2k3 SP2 server to multiple Win2k3 + SP2 & WinXP + SP3 machines via WMI in order to query the systems Win32_OperatingSystem and Win32_ComputerSystem classes.
Set loWMISvc = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=Pkt}\\" & lsStore & "\root\cimv2")
Note: 'lsStore' is the IP address of the computer system I successfully connection too prior.
I then attempt to create a new object to the remote system where it keeps returning a permission denied error (output of script):
21/11/2011 1:17:50 PM SUCCESS: Established connection to store
D:\Program Files\SUREfire Systems\Support\MG\QueryStores\QueryStores.vbs(244, 5) Microsoft VBScriptruntime error: Permission denied: 'GetObject'
Despite setting the objects ImpersonationLevel and AuthenticationLevel monikers as exepected, WMI also appears installed correctly on client and remote system. The initial connection to remote system is for the local administrator user also.
What else could be the cause the permission denied error that I'm not seeing? Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信我已经解决了我自己的疑问。 “权限被拒绝”错误与 UAC 相关,因此您需要使用与远程系统相同级别的访问和权限来执行脚本。我只是运行了 DOS 命令提示符,以客户端系统上的管理员用户帐户运行它,并且 GetObject 成功了。
尽管管理员帐户在两个不同的系统上看起来是相同的,但这证明您也需要确保遵循相同级别的访问和安全性;)
I believe I've resolved my own query. A 'permission denied' error relates to the UAC so therefore you need to execute a script using the same level of access and permission as per the remote system. I simply ran a DOS command prompt running it as the admin user account on the client system and GetObject was successful.
Although an admin account would appear the same on two different systems, this proves you need to ensure the same level of access and security is adhered too ;)