使用 WMI VBScript 获取工作组中的计算机列表

发布于 2024-09-27 03:18:53 字数 186 浏览 0 评论 0原文

我需要获取工作组中所有计算机的列表。我尝试了

Dim objComputers
设置 objComputers = GetObject("WinNT://WORKGROUP")

但它是Active Directory 对象。有没有办法让计算机没有WinNT://

I need get list of all computers in a WORKGROUP. I tried the

Dim objComputers
Set objComputers = GetObject("WinNT://WORKGROUP")

But it is Active Directory object. Is there any way to get the computers without WinNT://?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

北方。的韩爷 2024-10-04 03:18:53

使用完整 LDAP 路径连接到组对象。

Set objGroup = GetObject("LDAP://" & strGroupLDAP)

您可以使用以下

For Each strMachine In objGroup.Members

内容进行枚举:参考项目:

strMachine.Name or strMachine.samAccountName 

编辑:现在我重新阅读它,我对您的问题感到困惑,问题是什么,您可以使用 winnt:// 绑定到域或计算机吗?

Connect to the group object by using the full LDAP path.

Set objGroup = GetObject("LDAP://" & strGroupLDAP)

You can enumerate after with something like:

For Each strMachine In objGroup.Members

Refer to items by:

strMachine.Name or strMachine.samAccountName 

EDIT: I'm confused by your question now that I reread it, what is the problem, you can use winnt:// to bind to either the domain or a machine?

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