Forum Discussion
zenna
Mar 24, 2020Copper Contributor
Make office365 security group or Microsoft Teams group from CSV
Hi all, Is there a possible way to make a office365 security group or a Microsoft Teams group from a CSV file? Kind Regards, Zenna
Victor_Ebhojie
Mar 26, 2020Copper Contributor
Hi @zenna
- Create a CSV file with one column as shown in the Screenshot below.
- Label the header of the CSV file as 'users'
- Populate the column with the email address of the users to Add to the DL
- https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps
- run the following one liner code
import-csv -Path "C:\Users\user\Desktop\book1.csv" | ForEach-Object { Add-UnifiedGroupLinks -Identity "<nameofO365group>" -LinkType "members" -Links $_.users }
*replace -Path with the path of the CSV file you created and <nameofO365group> with the name of the Group (remove the angle brackets).
This should work