How to add members to Azure Active Directory groups using PowerShell scripts

Administrators use Azure Active Directory (AD) groups to collectively manage users and their permissions. The cmdlets 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 members can be added to groups in Azure Active Directory using PowerShell scripts and ADManager Plus.

Azure PowerShell

Steps to add members to Azure AD groups using PowerShell scripts:

  1. Obtain the GUID of the group to which you would like to add the members.
  2. Obtain the GUID of the members that you would to add.
  3. Execute the following PowerShell script and add members to the desired groups
 Copied
Add-AzADGroupMember -TargetGroupObjectId $groupid -MemberObjectId $members
Click to copy entire script

ADManager Plus

Steps to add members to Azure AD groups using ADManager Plus:

  1. Log in to ADManager Plus and navigate to Microsoft 365 tab > Management > Group Management.
  2. Under Group Member Management, click Add/Remove Group Members using CSV or the option that works best for you based on the group type. These options enable you to search for groups and add members to them.
  3. Select the desired Microsoft 365 tenant from the Microsoft Tenant drop-down list.
  4. Browse and select the CSV file containing the list of members along with group information and click Import Group(s)/Member(s).
  5. Select the desired group members and click Apply.

Limitations of using PowerShell scripts to add members to groups:

  • Administrators must have sufficient permissions to read 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.

Benefits of using ADManager Plus:

  • The ability to access 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.
  • Management actions come built-in with ADManager Plus and can be performed at the click of a button.

Hassle-free Azure AD group membership management

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link