using (DirectoryEntry companyEntry = companysDir.Children.Find("OU=" + companyName)) { DirectoryEntry newUser = companyEntry.Children.Add("CN=" + login, ADobj.User); newUser.Properties["samAccountName"].Value = login; newUser.CommitChanges(); if (password != null) { newUser.Invoke("SetPassword", new object[] { password }); newUser.CommitChanges(); } newUser.Close() }
<img src="http://s1.ipicture.ru/uploads/20120523/R02782Su.jpg">
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)