Почему может такое быть при добавлении нового пользователя?
Пароль не устанавливается. (((
public static string CreateUserAccount(string ldapPath, string Login, string userPassword, string userName, string employeeId, string mail, bool addLDAPTags)
{
string path = string.Empty;
string ldapTags = (addLDAPTags ? "LDAP://" : string.Empty);
string connectionPrefix = ldapTags + ldapPath;
DirectoryEntry dirEntry = new DirectoryEntry(connectionPrefix);
try
{
DirectoryEntry newUser = dirEntry.Children.Add("CN=" + userName, "user");
newUser.Properties["samAccountName"].Value = Login;
newUser.Properties["DisplayName"].Value = userName;
newUser.Properties["EmployeeId"].Value = employeeId;
if (mail != String.Empty)
newUser.Properties["mail"].Value = mail;
newUser.CommitChanges();
path = newUser.Path.ToString();
newUser.Invoke("SetPassword", new object[] { userPassword });
newUser.CommitChanges();
newUser.Close();
}
finally
{
dirEntry.Close();
}
return path;
}