create external user

Glenn Maxwell 11,621 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

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,609 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,634 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,934 questions
Microsoft Entra
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,266 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xintao Qiao-MSFT 4,235 Reputation points Microsoft Vendor
    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 someid@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 149.7K Reputation points MVP
    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 Answers by the question author, which helps users to know the answer solved the author's problem.