【问题标题】:Use S.DS.ActiveDirectory namespace for enumerating OU properties使用 S.DS.ActiveDirectory 命名空间枚举 OU 属性
【发布时间】:2011-12-07 14:29:47
【问题描述】:

我想检索类似于S.DS.AccountManagement 的组织单位的所有属性。

由于S.DS.Accountmanagement 仅适用于用户和组,在这种情况下是否可以使用S.DS.ActiveDirectory 命名空间?我没有找到很多使用S.DS.ActiveDirectory的例子。

【问题讨论】:

    标签: c# .net active-directory directoryservices


    【解决方案1】:
    string LdapPath = @"LDAP://" + DomainServer.HostName + "." + domainName + "/" + strOuCn;
    
    DirectoryEntry adEntry = new DirectoryEntry();
    
    adEntry.AuthenticationType = AuthenticationTypes.ServerBind;
    adEntry.Path = LdapPath; //loads OU to adEntry
    

    然后您可以检查您的属性,例如:

    adEntry.Properties["distinguishedName"]
    

    【讨论】:

      猜你喜欢
      • 2011-10-28
      • 2011-09-12
      • 2014-10-25
      • 2012-10-18
      • 2016-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多