Created
September 7, 2024 06:09
-
-
Save vicradon/203a56cca7ab650eeb006e93e6553007 to your computer and use it in GitHub Desktop.
Bulk invite guest users azure powershell
This file contains 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
$invitations = import-csv c:\bulkinvite\invitations.csv | |
$messageInfo = [Microsoft.Graph.PowerShell.Models.MicrosoftGraphInvitation]@{ CustomizedMessageBody = "Hello. You are invited to the Contoso organization." } | |
foreach ($email in $invitations) | |
{New-MgInvitation -InviteRedirectUrl https://portal.azure.com -InvitedUserDisplayName $email.Name -InvitedUserEmailAddress $email.InvitedUserEmailAddress -InvitedUserMessageInfo $messageInfo -SendInvitationMessage | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment