create external user

Glenn Maxwell 13,141 Reputation points
2024-11-18T22:34:34.3833333+00:00

I would like to invite an external user via PowerShell. Can anyone help me with the PowerShell syntax for the required settings? I am mostly using the default settings.

ext1

ext2

ext3

Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Entra | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    2024-11-19T02:51:29.8+00:00

    Hi, @Glenn Maxwell

    The answer to Andy is the best direction.

    After my testing, this works.

    You can use the following command to invite external users:

    New-MgInvitation -InvitedUserDisplayName "FL LN External" -InvitedUserEmailAddress ******@gmail.com -InviteRedirectUrl "Your RedirectUrl"-SendInvitationMessage:$true
    

    It should be noted that you first need to install and import the Microsoft.Graph and Microsoft.Graph.Identity.SignIns modules.

    The test results are shown in the figure below.

    User's image

    You can see in Azure AD that the external user you just added was successfully added.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Andy David - MVP 159.7K Reputation points MVP Volunteer Moderator
    2024-11-18T22:43:02.9133333+00:00
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.