Thursday , January 28 2021

Adding members to Office 365 Security Group via csv

Make sure you Connected to Exchange Online PowerShell

Connect-MsolService

You can get the object id of the group you are planning to add from Azure Active directory portal



CSV Sample – Double quotes is very important otherwise you may see undesirable additions.

Import-Csv users.csv |ForEach-Object {Add-MsolGroupMember -GroupObjectId 6e5db514-b162-4de4-ab93-3f1944ea4167 -GroupMemberType user -GroupMemberObjectId (Get-MsolUser -UserPrincipalName $_.userprincipalname).ObjectId}

 

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Export all distribution Group and all members in Exchange and Office 365

In some situations, we have to Export all the Distribution group/Unified Groups and all the …

Leave a Reply

Your email address will not be published.