Forum Discussion
Graham Young
Nov 02, 2018Copper Contributor
Trying to add a single user to multiple 365 groups
$groups = get-unifiedgroup -filter {(DisplayName -like '*Similar Groups*') -and (DisplayName -ne 'Specific Group I don't want to add')} | select Name Foreach ($group in $groups) { add-unifiedgrou...
- Nov 02, 2018
That's because you are passing the entire object. Try this:
Foreach ($group in $groups) { add-unifiedgrouplinks -identity $group.Name -linktype Members -Links singleuser@email.com -whatif }
VasilMichev
Nov 02, 2018MVP
That's because you are passing the entire object. Try this:
Foreach ($group in $groups) { add-unifiedgrouplinks -identity $group.Name -linktype Members -Links singleuser@email.com -whatif }
- Graham YoungNov 02, 2018Copper Contributor
That did it, thank you!