Skip to content

Instantly share code, notes, and snippets.

@vicradon
Created September 7, 2024 06:09
Show Gist options
  • Save vicradon/203a56cca7ab650eeb006e93e6553007 to your computer and use it in GitHub Desktop.
Save vicradon/203a56cca7ab650eeb006e93e6553007 to your computer and use it in GitHub Desktop.
Bulk invite guest users azure powershell
$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