Acc-Creation

Rising Flight 5,216 Reputation points
2024-06-13T21:41:43.8866667+00:00

Hi All,

I want to create a guest account. I have logged in to the Exchange Online Admin Center and created a mail contact. However, I am not seeing this mail contact in Azure AD. Will mail contacts not show up in Azure AD? If i need to create a guest account in Azure AD should i use invite external user in EntraID? The guest account will be used for B2B. I want to invite external user in Azure EntraID, Please help me with PowerShell syntax to create guest users with below fields in EntraID, is the below syntax correct?

cc1

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,204 questions
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Entra | Other
{count} votes

Accepted answer
  1. Miguel Gonçalves 971 Reputation points
    2024-06-14T22:14:28.86+00:00

    Hi Rising Flight,

    Please note that New-MsolUser is used for creating a new user in Azure AD, not for inviting a guest user. You should use New-AzureADMSInvitation

    A Sample:

    |Invite the user:

    $inv = New-AzureADMSInvitation -InvitedUserEmailAddress "******@domain.com" -InvitedUserDisplayName "FN LN" -SendInvitationMessage $true -InviteRedirectUrl <URL> -InvitedUserType "Guest"

    |Use this command to add the invited user to a group:

    Add-AzureADGroupMember -ObjectId <GroupObjectId> -RefObjectId $inv.InvitedUser.Id


    # 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. Shweta Mathur 30,301 Reputation points Microsoft Employee Moderator
    2024-06-17T08:58:18.5366667+00:00

    Hi @Rising Flight

    Thanks for reaching out.

    About mail contacts, they are not the same as guest users in Entra ID. Mail contacts are used to represent external email addresses in Exchange Online, but they are not user accounts in Entra ID.

    If you want to invite an external user to collaborate with your organization using their own work, school, or social account, you should use the "Invite external user" option in the Azure portal or use the "New-AzureADMSInvitation" PowerShell cmdlet as described above.

    Reference - https://learn.microsoft.com/en-us/powershell/module/azuread/new-azureadmsinvitation?view=azureadps-2.0

    Hope this will help.

    Thanks,

    Shweta

    Please remember to "Accept Answer" if answer helped you.

    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.