Created
February 20, 2020 18:24
-
-
Save dev-kperera/7ed6a4b715c50f6d423b0524234965de to your computer and use it in GitHub Desktop.
CSV headers
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
$cred = Get-Credential | |
Connect-AzureAD -Credential $cred | |
$invitations = import-csv C:\data\invitations.csv | |
$messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo | |
$messageInfo.customizedMessageBody = "Hey there! Check this out. I created an invitation through PowerShell" | |
foreach ($email in $invitations) {New-AzureADMSInvitation -InvitedUserEmailAddress $email.InvitedUserEmailAddress -InvitedUserDisplayName $email.Name -InviteRedirectUrl https://wingtiptoysonline-dev-ed.my.salesforce.com -InvitedUserMessageInfo $messageInfo -SendInvitationMessage $true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment