I'm looking for a way to add guest users in bulk, including their display names and email addresses, but I want to do this without sending any notifications. Can anyone guide me on how to accomplish this?
1 Answer
You can accomplish this easily using the Graph module with PowerShell! The command **New-MgInvitation** can be used, and it has all the necessary fields you need. Just loop through a list of users that contains their display names and UPN, and send the invites without notifications. Here's a simple example:
```powershell
Foreach($user in $users){
$InviteParams = @{
InvitedUserEmailAddress = $user.UserPrincipalName
InviteRedirectUrl = "https://myapps.microsoft.com"
InvitedUserDisplayName = $user.displayName
SendInvitationMessage = $false
InvitedUserType = "guest"
}
New-MgInvitation -BodyParameter $InviteParams
}
```
This should work perfectly!

Thanks for the detailed example! It worked perfectly for me.