VB.net Active Directory:如何从OU中的OU读取PC列表 [英] VB.net Active Directory: how to read list of PC's from OU within an OU

查看:117
本文介绍了VB.net Active Directory:如何从OU中的OU读取PC列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个程序,该程序需要从OU结构中向下几层的Active Directory中读取PC列表.

我需要访问的AD路径是这样的:

company.com-Divison1-Site1-电脑

Division 1,Site1和Computers都是OU.

问题是我在网上找到的任何教程都显示了如何仅从Active Directory中读取所有PC.在我的公司中,这将超过22,000台PC.

我需要使用VB.net从上述路径中的计算机" OU中读取所有PC,或者至少读取"Site1" OU中的所有计算机.

有人可以在这里向我指出正确的方向,还是提供实现此目的的代码示例?

非常感谢.

Hi Everyone,

I''m working on a program that needs to read a list of PC''s from Active Directory a few levels down in the OU structure.

The AD path I would need to access is this:

company.com - Divison1 - Site1 - Computers

Division 1, Site1 and Computers are all OUs.

Problem is any tutorials I have found online show how to read only ALL PC''s from Active Directory. That would amount to over 22,000 PCs in my company.

I need to read all PC''s from the ''Computers'' OU in the above path or at least all computers in the ''Site1'' OU using VB.net


Could someone point me in the right direction here or provide code samples for accomplishing this?

Many Thanks.

推荐答案

在所有这些示例中,它们都通过以下路径连接到域控制器:''LDAP://DC=fabrikam,DC=com''.您只需要更加具体,并扩展该路径以包含OU路径即可:''LDAP://OU=someContainer,DC=fabrikam,DC=com''.请注意,使用这样的路径会限制您的结果.您不能使用RDN.
In all of those examples, they all connect to a domain controller with a path something like: ''LDAP://DC=fabrikam,DC=com''. You should just have to be more specific and expand that path to include the OU path: ''LDAP://OU=someContainer,DC=fabrikam,DC=com''. Note, using a path like this limits your results. You cannot use RDN''s.


这篇关于VB.net Active Directory:如何从OU中的OU读取PC列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆