We would like to automate external user invitation in SharePoint. The manual process of what we are trying to achieve works but not the Powershell method.
Manual Process: Share a sharepoint site to an email (e.g. [email protected]) by invitation. When the invited user accepts the invitation, user creates a Microsoft account, that will create an account in our Azure AD tenancy with a UPN a-guest-user_anyemail.com#EXT#@mytenant.onmicrosoft.com. The user can login subsequently using the email as the login id ([email protected]).
Using Powershell Azure AD V2 modules Steps:
- Create users using powershell command
New-AzureADUser -DisplayName "AGuest User" -PasswordProfile $PasswordProfile -AccountEnabled $true -MailNickName "aguestuser" -UserPrincipalName "[email protected]" -UserType "Guest" -OtherEmails "[email protected]"
- Add the users to a relevant SharePoint group (using Add-SPOUser powershell command)
- Users are emailed a link to the SharePoint site (for e.g. https://mytenant.sharepoint.com/sites/myexternalsite)
Once this is done, this user can log in successfully using [email protected], but not using an email i.e. [email protected]
Does any one know how to allow the external user to login using their email account when provisioned using Powershell? Thank you