How to add members to Azure Active Directory groups using PowerShell scripts
Administrators use Azure Active Directory (Azure AD) groups to manage users and their permissions in bulk. The cmdlet in the table below can be used to add members to Azure AD groups. ADManager Plus, a unified Active Directory, Microsoft 365, Exchange, and Google Workspace management and reporting tool, can also be used to accomplish this task.
The following table is a comparison on how to add members to Azure AD groups using PowerShell scripts and ADManager Plus.
Azure PowerShell
Steps to add members to Azure AD groups using PowerShell scripts:
- Note down the ObjectID of the Azure AD group to which members are to be added and the ObjectID of the members to be added.
- Execute the following PowerShell script to add a member to an Azure AD group.
Copied
Add-AzureADGroupMember
-ObjectId "<GroupID>"
-RefObjectId "<MemberId>"
Click to copy entire script
where <GroupID> refers to the ObjectID of the Azure AD group for which the member is to to be added and <MemberID> refers to the ObjectID of the member to be added.
ADManager Plus
Steps to add members to Azure AD groups using ADManager Plus:
- Log in to ADManager Plus and navigate to Microsoft 365 tab > Management > Group Management. Under Group Member Management, select the type of Azure AD group that you want to add the members to.
- Select the Azure AD group that you want to add the members from Add to groups, the desired Microsoft 365 tenant from the Microsoft Tenant drop-down list, type the name of the members in Select User(s) / Group(s), and click Find.
- Select from the list of members generated, and click Apply to add the selected members to the selected Azure AD group.
Limitations of using PowerShell scripts to list Azure AD groups:
- Administrators must have sufficient permissions to modify memberships of Azure AD groups if they wish to use the above-mentioned PowerShell script. However, one wrong move from the administrator can affect the security posture of your organization.
- Only technicians with PowerShell expertise can execute this command.
- PowerShell scripts are time-consuming and can affect productivity.
- The value of the parameters used like ObjectID should be exact.
Benefits of using ADManager Plus:
- The ability to modify group memberships of Azure AD groups can be granularly delegated to technicians without altering their permissions elsewhere.
- ADManager Plus comes with an intuitive UI and does not demand any knowledge in PowerShell.
- Perform bulk operations with ease with just a few clicks using customizable templates, CSV Import, and a built-in search option.
- Fine tune your conditions with various attribute-based filters like Display Name, Group Type, Last Directory Sync Time, and Proxy Address.
- Add multiple conditions and decide on what basis they can be used to filter your reports.
- Reports generation comes built-in with ADManager Plus and can be performed at the click of a button.