Example #1
0
 private List<UserData> loadUsersFromTxt()
 {
     List<UserData> users = new List<UserData>();
      if (File.Exists(_usersFile))
      {
     var lines = File.ReadAllLines(_usersFile);
     foreach (var line in lines)
     {
        UserData user = new UserData(line);
        users.Add(user);
     }
     users.Sort();
      }
      return users;
 }
Example #2
0
 private void IterateGroup(GroupPrincipal group, HashSet<UserData> usersHash)
 {
     foreach (Principal p in group.GetMembers())
      {
     if (p is GroupPrincipal)
     {
        IterateGroup((GroupPrincipal)p, usersHash);
     }
     else if (p is UserPrincipal)
     {
        UserData u = new UserData(((UserPrincipal)p).DisplayName, ((UserPrincipal)p).SamAccountName, group.Name);
        usersHash.Add(u);
     }
      }
 }