PrincipalContext principalContext = new PrincipalContext(ContextType.Domain); GroupPrincipal group = GroupPrincipal.FindByIdentity(principalContext, "IT_DEPARTMENT_USERS"); foreach (var userPrincipal in GroupPrincipal.FindByIdentity(principalContext, "IT_DEPARTMENT_USERS").GetMembers().OfType<UserPrincipal>()) { string EmpNo = userPrincipal.EmployeeId; string DispName = userPrincipal.DisplayName; string Email = userPrincipal.EmailAddress; string firstName = userPrincipal.GivenName; string lastName = userPrincipal.Surname; string SamAccountName = userPrincipal.SamAccountName; //string Dept = userPrincipal }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)