private static IEnumerable <Group> GenerateRandomGroups(int groupCount)
 {
     while (groupCount-- > 0)
     {
         string name  = GenericHelpers.GenerateRandomEntityName();
         var    group = new Group
         {
             DisplayName     = $"Random test group {name}",
             Description     = $"Random test group {name}",
             MailNickname    = name,
             MailEnabled     = false,
             SecurityEnabled = true
         };
         yield return(group);
     }
 }
 private static IEnumerable <User> GenerateRandomUsers(int userCount, string domainName)
 {
     while (userCount-- > 0)
     {
         string userName = GenericHelpers.GenerateRandomEntityName();
         User   user     = new User
         {
             AccountEnabled  = true,
             MailNickname    = userName,
             DisplayName     = userName,
             PasswordProfile = new PasswordProfile()
         };
         user.PasswordProfile.Password = "******";
         user.PasswordProfile.ForceChangePasswordNextSignIn = false;
         user.UserPrincipalName = $"{userName}@{domainName}";
         user.UsageLocation     = "US";
         user.JobTitle          = "RandomlyCreatedTestUser";
         yield return(user);
     }
 }