Created
January 29, 2018 15:10
-
-
Save f-bader/61059ae98dcdd4c99190aa7685c70d07 to your computer and use it in GitHub Desktop.
Create invite URL for Azure B2B
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Azure AD Username | |
$User = "AzureUsername" | |
$TargetTenant = "TargetTenant" | |
# Login | |
$Cred = Get-Credential | |
Connect-AzureAD -Credential $cred | |
# Generate Invitation, but do not send | |
$Invitation = New-AzureADMSInvitation -InvitedUserEmailAddress $User -InvitedUserDisplayName $User -InviteRedirectUrl "https://portal.azure.com/$($TargetTenant)" -SendInvitationMessage $false | |
# Copy redeem URL to clipboard | |
$Invitation | Select-Object –ExpandProperty InviteRedeemUrl | clip | |
# Send the URL to the user. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment