Forum Discussion
Bulk adding to Office 365 Groups with PowerShell
- Sep 22, 2017
I just did this:
[PS] C:\> $Users = (Get-Recipient -RecipientPreviewFilter {RecipientTypeDetails -eq "UserMailbox" -and CustomAttribute3 -ne "N"}
[PS] C:\> Add-UnifiedGroupLinks -Identity O365Group -LinkTypeMembers -Links $Users.Name
This creates an array of all user mailboxes in the tenant that are not marked with a value in one of the customized attributes. I then use the array as input to Add-UnifiedGroupLinks, which added all (30) the users to the group.
I forgot that I had this example in Chapter 15 of the Office 365 for IT Pros ebook... PowerShell is great!
Office 365 groups have the limitation of 1000 users as members. So maybe you wanna split the group into 3 parts and start adding users. Please read more about limitations of O365 groups here:
https://support.office.com/en-us/article/Learn-about-Office-365-groups-b565caa1-5c40-40ef-9915-60fdb2d97fa2?ui=en-US&rs=en-US&ad=US%20
I understand that 1000 members are a soft limit as if it extends this number, it can get slower when accessing. But it will be one time actions and I mean that some people will leave this group.
- Sep 21, 2017If you are getting throttled when adding 2500 users with Set-UnifiedGroup, I agree that splitting the users to be added into chunks could be a solution...the other way around could be to create a more sofisticad PowerShell script with some Re-Try logic so you can overcome the throttling