public bool AddUserToGroup(string userlogin, string groupName) { try { using (HostingEnvironment.Impersonate()) { _directoryEntry = null; ADManager admanager = new ADManager(LDAPDomain); //, LDAPUser, LDAPPassword); admanager.AddUserToGroup(userlogin, groupName); return(true); } } catch (Exception ex) { return(false); } }