40 C
Dubai
Thursday, August 11, 2022
spot_img

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}

 

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Specialized in Microsoft Azure - Office 365 / Microsoft Exchange; conducted numerous projects worldwide in designing, supporting, and implementing messaging and virtualization infrastructure for medium-sized and large enterprises. Further, I am a Cloud Architect and Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here