New-AzureADMSInvitation

In this Azure PowerShell article, we will discuss the syntax and usage of the New-AzureADMSInvitation PowerShell command, along with examples of how to use it.

New-AzureADMSInvitation

This excellent Azure PowerShell command can help invite an external user to your Azure Active Directory.

Syntax

Below is the syntax of the New-AzureADMSInvitation PowerShell command.

New-AzureADMSInvitation

 -InvitedUserEmailAddress <String>
[-SendInvitationMessage <Boolean>]
 -InviteRedirectUrl <String>

Let’s discuss a few examples of how to use the New-AzureADMSInvitation PowerShell command.

Example

You can execute the below Azure PowerShell command to invite the user xyz@tsm.com to your Azure AD.

Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228
New-AzureADMSInvitation -InvitedUserEmailAddress xyz@tsm.com -SendInvitationMessage $True -InviteRedirectUrl "http://myapps.microsoft.com"

After executing the above PowerShell command, I got the following output.

PS C:\WINDOWS\system32> Connect-AzureAD -TenantId 5d9d690a-0310-474d-ae8b-42df2d549228
New-AzureADMSInvitation -InvitedUserEmailAddress xyz@tsm.com -SendInvitationMessage $True -InviteRedirectUrl "http://myapps.microsoft.com"

Account Environment TenantId TenantDomain AccountType
------- ----------- -------- ------------ -----------
fewlines4biju@hotmail.com AzureCloud 5d9d690a-0310-474d-ae8b-42df2d549228 fewlines4bijuhotmail.onmicrosoft.com User

Id : 2344a65a-8c9a-4dfe-9dd8-8a513dc4ad56
InvitedUserDisplayName :
InvitedUserEmailAddress : xyz@tsm.com
SendInvitationMessage : True
InviteRedeemUrl : https://login.microsoftonline.com/redeem?rd=https%3a%2f%2finvitations.microsoft.com%2fredeem%2f%3ftenant%3d5d9d690a-0310-474d-ae8b
-42df2d549228%26user%3d2344a65a-8c9a-4dfe-9dd8-8a513dc4ad56%26ticket%3dxuSRxqfrejMGY3uARsyjvK2BHI23OnA2ntBiVbhhp9k%25253d%26ver%3d
2.0
InviteRedirectUrl : http://myapps.microsoft.com/
InvitedUser : class User {
Id: dad56ad9-fc4d-4586-8ce6-5c7e99602d0a
OdataType:
}

InvitedUserMessageInfo : class InvitedUserMessageInfo {
CcRecipients: System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.Recipient]
CustomizedMessageBody:
MessageLanguage:
}

InvitedUserType : Guest
Status : PendingAcceptance
ResetRedemption : False

You can see the same output below

New-AzureADMSInvitation

Then I logged in to the Azure Portal and could see the guest user, and I was able to see a successful entry for the same.

Add Guest Users in Bulk to Azure AD using PowerShell

Final Thoughts

In this Azure article, we discuss the syntax and usage of the New-AzureADMSInvitation PowerShell command, providing examples of how to use it.

You may also like the following articles below.

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!