string strUserName = o.SAMAccountName; using (var context = new PrincipalContext(ContextType.Domain)) { using (var user1 = UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, strUserName)) { if (user1.IsAccountLockedOut())//Getting below error here// { /* Button visible to Unlock user */ } else { e.Row.Cells[ColumnUnlock].Controls.Clear(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)