Last active
February 20, 2020 18:27
Revisions
-
dev-kperera revised this gist
Feb 20, 2020 . 1 changed file with 9 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,13 @@ # connect $cred = Get-Credential Connect-AzureAD -Credential $cred # setting variables $invitations = import-csv ..\invitations.csv $messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo $messageInfo.customizedMessageBody = "Hey there! Check this out. I created an invitation through PowerShell" # loop foreach ($email in $invitations) { New-AzureADMSInvitation -InvitedUserEmailAddress $email.InvitedUserEmailAddress -InvitedUserDisplayName $email.DispName -InviteRedirectUrl $email.RedirectURL -InvitedUserMessageInfo $messageInfo -SendInvitationMessage $true } -
dev-kperera revised this gist
Feb 20, 2020 . No changes.There are no files selected for viewing
-
dev-kperera created this gist
Feb 20, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ $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}