Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert Azure Active Directory AAD User from Member to B2B Member. Associated blogpost
# Invite User Request
$inviteDetails = @{
"invitedUserEmailAddress" = $externalEmail.otherMails[0]
"invitedUser" = @{"id" = $ }
"sendInvitationMessage" = $true
"inviteRedirectUrl" = ""
"invitedUserMessageInfo" = @{
"messageLanguage" = "en-AU"
"customizedMessageBody" = "Hi $($updatedUser.displayName), Your user account '$($updatedUser.userPrincipalName)' in the Contoso Azure Tenant has been migrated to a Guest account federated to your Fabrikam '$($updatedUser.otherMails[0])' account. After selecting 'Get Started' below you will be able to access Contoso using your Fabrikam account and credentials. All you access and privilages remain intact. Regards, Contoso IT"
$inviteBody = $inviteDetails | ConvertTo-Json
$invite = Invoke-RestMethod -Headers @{Authorization = "Bearer $($accessToken.AccessToken)"; "content-type" = "application/json" } `
-Uri "" `
-Method Post `
-body $inviteBody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.