How to add a Guest User to a Tenant via Azure B2B
This article will walk you through the process of creating a guest user for Azure B2B collaboration. For this exercise we will be using 2 tenants. We will be inviting users from an external tenant (tenantB.com) to the Source Tenant (tenantA.com) Source Tenant: TenantA.comExternal Tenant: TenantB.comFor an External User in (tenantB.com) to access resources in the Source tenant (TenantA.com) an Azure B2B invitation must be sent out from the source tenant (TeantA.com)After accepting the Azure B2B invitation the External User will be visible as an Azure B2B Guest user in the source tenant (TenantA.com).By doing this the user in the external directory (tenantB.com), will be able to switch directories to the destination directory (tenantA.com) and view details for Azure B2B collaboration.The Advantage of this is that the external user can use the same credentials (UserName and Password) to access resource in the Source Tenant (TenantA.com)Sign in to the Source directory (tenantA.com) via portal.azure.com > Azure Active Directory > Users > New Guest User
Once the user is added as a guest > Navigate to the External directory (tenantB.com) > Click on the Profile Picture > Switch directory >
If you see the Source Directory (tenantA.com), you know that another directory is added and thus the external guest user can switch between directories (tenantA.com and TenantB.com) using the same credentials. To do this in Bulk via PowerShell: Connect-AzureAD -AccountId [email protected] -InvitedUserDisplayName "Name of the External User" -InvitedUserEmailAddress [email protected] -InviteRedirectURL https://myapps.azure.com -SendInvitationMessage $true To add the user to a unified group: Add-UnifiedGroupLinks -Identity UnifiedGroupName -LinkType members -Links [email protected] BULK: Create a .Csv file with Name and InvitedUserEmailAddress > save it to a location $invitations = import-csv c:usersinvitations.csv $messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo $messageInfo.customizedMessageBody = "You are invited to the Tenant A." foreach ($email in $invitations) {New-AzureADMSInvitation -InvitedUserEmailAddress $email.InvitedUserEmailAddress -InvitedUserDisplayName $email.Name -InviteRedirectUrl https://myapps.azure.com -InvitedUserMessageInfo $messageInfo -SendInvitationMessage $true} To add them to unified groups: Import-csv c:usersinvitations.csv| foreach{Add-UnifiedGroupLinks -Identity UnifiedGroupName -LinkType members -Links $_.inviteduseremailaddress.csv} Read the full article













