* Create a guest user account in contoso.com. * Run the New-AzureADMSInvitation cmdlet. [For Microsoft Active Directory] * Run the New-MgInvitationcmdlet. [For Microsoft Entra] Note: * New-AzureADMSInvitation This cmdlet is used to invite a new external user to your directory. * New-MgInvitation Microsoft.Graph.Identity.SignIns Use this API to create a new invitation or reset the redemption status for a guest user who already redeemed their invitation. Invitation adds an external user to the organization Reference: https://docs.microsoft.com/en-us/azure/active-directory/external-identities/b2b-quickstart-add- guest-users-portal https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new- mginvitation https://docs.microsoft.com/en-us/powershell/module/azuread/new- azureadmsinvitation?view=azureadps-2.0