Assign Group to users massively

Fiammenghi Fabrizio 46 Reputation points
2020-04-18T13:33:36.43+00:00

Hi,
i'm writing on behalf of a friend, that due to coronvirus has been "elected" as one of administraotr of Microsoft for school plan A1.
Unfortuantely he has been involved, once the user had been already created on the tenant.
they have more 600 users divied in teacher, student and external collaborator.
Unfortunately the company who created the user, did not create any AD group to divide them , but they :

  1. follow this rule when creating account :
    ******@schoolname.com where
    xxx is "d" if the user is a teacher
    xxx is "s" if the user is a student
    xxx is "ose" if the user is an external collaborator
  2. The "title" (or role) field contains "Teacher", "Student", "Collaborator" based on the user

He would like to create 3 different AD Group "Teacher", "Student", "Collaborator", but in the user management , he cannot find a way to filter the users based on xxx@schoolname criteria , or sort/filter based on title or role (that is an available display column), so he can select part of the users and massively assign a group.

he has to select one by one , and ufortunatey the users are sorteb by name, so it is a big mess.

is there a way to apply the filter or sorting based on art of the account name ot title ?
is there a way with powershell to do it ?

thanks in advance

Fabrizio

Microsoft Entra
0 comments No comments
{count} vote

Accepted answer
  1. thgibard-MSFT 356 Reputation points
    2020-04-19T11:47:05.583+00:00

    Yes, currently if you want to do it in a large range you will need to do it thanks to PowerShell.

    In this scenario, you can use the PowerShell module called AzureAD and use the following CmdLine to be able to add members to your Azure AD Group : https://learn.microsoft.com/fr-fr/azure/active-directory/users-groups-roles/groups-settings-v2-cmdlets. Azure AD module can be installed easily by typing the command : Install-Module AzureAD from any server that is able to reach Internet. Then, you can see all the available commands by doing the command : Get-Command -Module AzureAD and the CmdLet that will be useful for you will be : Add-AzureADGroupMember. Are you confortable with PowerShell ?

    1 person found this answer helpful.
    0 comments No comments

9 additional answers

Sort by: Most helpful
  1. oh kooi 1 Reputation point
    2020-04-18T15:45:17.09+00:00

    👍emphasized text

    0 comments No comments

  2. Sam Cogan 10,782 Reputation points MVP
    2020-04-18T21:00:10.403+00:00

    You have tagged this with "Azure AD Domain Services", is this actually Azure AD, or just on prem AD?

    0 comments No comments

  3. thgibard-MSFT 356 Reputation points
    2020-04-18T22:39:23.987+00:00

    Hello @Fiammenghi Fabrizio

    According to your first message, I'm guessing it's the quicker scenario with no AAD Connect synchronization involved ? You've created everything directly in Azure Active Directory ? Please, tell us if it's the case of not - because it will not be the same depending on that.

    If you've created all your accounts directly in Azure Active Directory, you can create some groups directly throw the Azure Active Directory portal. To do so, connect to your portal.azure.com then in the Azure Active Directory icon, you will go in "Manage" node and will find "Users" link to manage your users and "Groups" to manage (create, add/remove people from your groups).

    If you've an on-prem Active Directory, you will probably create these groups inside your on-prem Active Directory and make them to be synchronized with Azure Active Directory (with AAD Connect).

    0 comments No comments

  4. Fiammenghi Fabrizio 46 Reputation points
    2020-04-19T07:42:11.203+00:00

    Hi,
    thanks to all for the replies.
    Probably i misexplained.
    The AD is azure AD and there is no premise.

    We tried both from Office 365 administrattion, and both from Azure AD.

    User already know how to greate groups and add users to group.

    The problem is that to add users to groups, my friend needs to select the users one by one, as the criteria to include a user in a group, cannot be filtered via filter functions of office 365
    7601-office365.png

    and neither from Azure active directory

    Tks in advance

    Fabrizio

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.