Searching Computer Names from AD in MOSS 2007
In MOSS 2007, I 开发者_开发百科want to search/get Computer Names from Active Directory in SharePoint just like search users.
Assuming you want to retrieve these names programmatically:
As far as I know there is no SharePoint API to retrieve computer names from the AD.
Though there are methods on SPUtility
to retrieve Users and Groups from the AD.
To query computer names you have to implement you own Ldap query:
Use the .Net types System.DirectoryServices.DirectoryEntry
/ System.DirectoryServices.DirecorySearcher
to query against the AD.
If you were using .Net 3.5 you could use the types System.DirectoryServices.AccountManagement.ComputerPrincipal
and System.DirectoryServices.AccountManagement.PrincipalSearcher
to do so.
精彩评论