一个目录是一个对象树。每个对象OU(容器),用户(你的案例中的叶子)都由一个专有名称来寻址,这个名称由一个由他的容器的可分辨名称后缀的attribute=value
对组成。以下两个屏幕截图向您显示了两个视图,MMC 1和具有所有DN的LDAP视图。
在我来说,这里是我怎么能在这样一个嵌套OU创建用户:
/* Creating a user
* Retreiving a principal context
*/
PrincipalContext domainContextMonou = new PrincipalContext(ContextType.Domain, "WM2008R2ENT:389", "ou=SousMonou,ou=Monou,dc=dom,dc=fr", "user", "pass");
/* Create a user principal object
*/
UserPrincipal aSlxUser = new slxUser(domainContextMonou, "user3.users", "[email protected]", true);
/* assign some properties to the user principal
*/
aSlxUser.GivenName = "user3";
aSlxUser.Surname = "users";
/* Force the user to change password at next logon
*/
//aSlxUser.ExpirePasswordNow();
/* save the user to the directory
*/
aSlxUser.Save();
/* set the password to a new value
*/
aSlxUser.SetPassword("test.2013");
aSlxUser.Save();
有趣,所以外卖的消息我得到的是路径向后规定。谢谢。 – DumpsterDoofus 2015-05-21 01:08:14