1
在MOSS 2007中,我想像搜索用户一样在Active Directory中搜索/获取计算机名称。在MOSS 2007中从AD中搜索计算机名称
在MOSS 2007中,我想像搜索用户一样在Active Directory中搜索/获取计算机名称。在MOSS 2007中从AD中搜索计算机名称
假设你想以编程方式检索这些名称:
据我所知是没有的SharePoint API,从AD检索计算机名称。 尽管SPUtility
有方法从AD中检索用户和组。 要查询计算机名称,您必须实现您自己的Ldap查询:
使用.Net类型System.DirectoryServices.DirectoryEntry
/System.DirectoryServices.DirecorySearcher
来针对AD进行查询。 如果您使用.Net 3.5,则可以使用类型System.DirectoryServices.AccountManagement.ComputerPrincipal
和System.DirectoryServices.AccountManagement.PrincipalSearcher
来完成此操作。