2011-12-07 9 views
0

S.DS.AccountManagementに似た組織単位のすべてのプロパティを取得する。OUプロパティの列挙にS.DS.ActiveDirectory名前空間を使用する

S.DS.Accountmanagementは、ユーザーとグループのみに適用されるため、この場合にはS.DS.ActiveDirectory名前空間を使用できますか?私はS.DS.ActiveDirectoryを使って多くの例を見つけられませんでした。

答えて

0
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"]