In this tutorial, we will go through the steps on How To Add Users To An Azure AD Group Using Powershell.
Add User to Azure Group PowerShell
We can use the PowerShell cmdlet Add-AzureADGroupMember to add a user to the Azure AD group.
How to Add Users To An Azure AD Group Using Powershell
To add users to an Azure AD group you can use the below PowerShell cmdlet.
Add-AzureADGroupMember
Syntax
Add-AzureADGroupMember -ObjectId <String> -RefObjectId <String> [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
We can use the above syntax to add a user to an Azure AD group.
Let’s look at the PowerShell cmdlet to add our test user to the business users Azure Ad group.
Add-AzureADGroupMember -ObjectId "e49b8dbd-97ef-4555-a53a-45ad3ce9a454" -RefObjectId "8837bf51-e511-4c67-bdab-3bb1f75db62b"
Objectid is the group Object id
RefObjectid is the Object id for the user
How to use direct assignment to Add Users To An Azure AD Group in Azure Portal
Using the below steps you can easily add users to an Azure AD group in Azure Portal. The only pre-requisite is that you should have the appropriate roles and permissions.
Follow the below steps to add a user to the Azure AD group.
Step 1: Logon to Azure Portal (https://portal.azure.com )
Step 2: Click on Azure Active Directory.
Step 3: On the Azure active directory overview page click on Groups.
On the left-hand side, menu pane, click on Groups under Manage.
Step 4: Click and open your required group.
Step 5: Under your Azure AD group on the left-hand menu pane, Click on Members
Step 6: Now Click on Add members as shown below
Step 7: On the add members screen, search for the required user and select it.In this example test user.
Step 8: Your selected user will be successfully added to your Azure AD group.
Conclusion
In this tutorial, we have discussed and provided the steps to add users to an Azure AD group using PowerShell as well as Azure Portal.
We hope this tutorial on How To Add Users To An Azure AD Group Using Powershell was helpful.
Related articles :
The term Get-AzureAccount is not recognized error: How to fix it
How to fix Because of Protocol Error Code 0x112d ( Easy Guide)
AZ-120 Exam Study Guide 2021(Planning and Administering Microsoft Azure for SAP Workloads)