In this Azure ad tutorial, we will discuss how to add bulk guest users in Azure AD B2B from the Azure portal and PowerShell.
Table of Contents
Bulk Invite Guest Users Azure
We can use Azure active directory B2B collaboration to work with vendors or external partners. Here, we can invite bulk guest users to our organization.
Add bulk users in Azure AD B2B Collaboration from Azure Portal
Microsoft allows us to add bulk users in Azure AD B2B collaboration from the Microsoft Azure portal through a CSV file.
External users can have any type of account like Gmail.com, yahoo.com, or outlook.com.
- Log in to the Azure portal. You can create a free Azure account.
- Then, select the Azure active directory.
- Then Click on Users, which is under Manage.
4. This will display all the users. Here, click on Bulk invite, which will display the bulk invite users page and an option to download a template, it is a CSV file.
This is a sample or template which you can modify and upload here. Here, you can add all the guest users you want to invite.
The CSV file looks like the following:
You can modify and add all the guest users you want to invite.
Once the CSV file is ready, upload it like below:
5. Click on Submit.
Once it is done, it will show a successful message like the one below:
You can also click on the “Click here to view the status of each operation” link to check the status of each request.
The users will appear as Guests in the Azure AD.
The users will receive the email invitations and can accept the invitation.
Check Bulk Operations Results
You can also check the bulk operations results. Click on Bulk operation results from the left navigation to display the File name, Status, Success, Failures, Total requests, etc.
This is how we can add bulk guest users in Azure AD B2B collaboration from Azure Portal.
Azure AD bulk invite guest users using PowerShell
We can also use the PowerShell command New-AzureADMSInvitation to add bulk guest users in Azure AD B2B collaboration.
To work with PowerShell, ensure you have installed the latest version of the AzureADPreview module.
You can also run the below command to check which AzureAD PowerShell module has been installed in your system.
Get-Module -ListAvailable AzureAD*
You can check the tutorial below on installing the AzureADPreview PowerShell module.
Once you install the AzureADPreview module, you must prepare the CSV file.
Create a CSV file with the following columns:
You can create an Excel and save the file in .csv format in your system drive. The Excel file looks like the following:
Now, run the below PowerShell command in PowerShell ISE to add bulk guest users in Azure AD B2B using PowerShell.
Connect-AzureAD -TenantDomain "SPSkyTraining.onmicrosoft.com"
$csvfilepath = import-csv e:\Bijay\BulkUsers.csv
$messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo
$messageInfo.customizedMessageBody = "Hello. Join TSInfo Team."
foreach ($email in $csvfilepath)
-InvitedUserEmailAddress $email.InvitedUserEmailAddress `
-InvitedUserDisplayName $email.Name `
-InviteRedirectUrl https://myapps.microsoft.com `
-InvitedUserMessageInfo $messageInfo `
You can see the invites in the screenshot below.
You can check the users in Azure AD.
Or also, you can check the guest users in the Microsoft 365 admin center.
You may like the following Azure tutorials:
In this tutorial, we learned how to bulk invite Guest users to Azure AD using Azure Portal and PowerShell.
I am Bijay, a Microsoft MVP (10 times) having more than 17 years of experience in the software industry. During my IT career, I got a chance to share my expertise in SharePoint and Microsoft Azure, like Azure VM, Azure Active Directory, Azure PowerShell, etc. I hope you will learn from these Azure tutorials. Read more