本文介绍了检索Active Directory用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在域中有数千个Active Directory用户.

现在,我想检索一些(例如前100名)Active Directory用户.

怎么做.


问候

Hi,

I have some thousands of Active directory users in the domain.

Now i want to retrieve some( say top 100) Active directory users.

How to do it.


Regards

推荐答案

DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://" + Environment.MachineName);
string userNames="Users : ";
foreach (DirectoryEntry child in directoryEntry.Children)
{
   if (child.SchemaClassName == "User")
   {
       userNames += child.Name + Environment.NewLine ;
   }
}
MessageBox.Show(userNames);




这篇关于检索Active Directory用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 22:57