<tr>
<td>
<table width="350" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="180" align="right"><%=L_INN%></td>
<td width="7"></td>
<td align="right">
<input id="INN" name="INN" type="text" class="textInputField" runat="server" size="25" autocomplete="off" />
</td>
</tr>
</table>
</td>
</tr>
SearchResultCollection adSearchResult;
using (DirectoryEntry de = new DirectoryEntry("LDAP://esrr.oao.rzd"))
{
using (DirectorySearcher adSearch = new DirectorySearcher(de))
{
adSearch.Filter = $"(&(objectCategory=person)(objectClass=user)(name={searchString}*)(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))";
//adSearch.PropertiesToLoad.Add("displayName");
adSearchResult = adSearch.FindAll();
}
}
public void ResetPassword(string userDn, string password)
{
DirectoryEntry uEntry = new DirectoryEntry(userDn);
uEntry.Invoke("SetPassword", new object[] { password });
uEntry.Properties["LockOutTime"].Value = 0; //unlock account
uEntry.Close();
}