SOLVED

Error using Add-UnifiedGroupLinks

Copper Contributor

Hi all,

 

I'm trying to bulk add users to an Office 365 Mail enabled security group. My test CSV file only has one user in, so I can run it quickly and only have 1 error message.

"Connect-ExchangeOnline
Import-CSv -Path "N:\Work Stuff\AllStudentList1.csv" | ForEach-Object {Add-UnifiedGroupLinks -Identity "TestGroup@whschool.co.uk" -Links $_.UserPrincipalName -LinkType Members}
Disconnect-ExchangeOnline"

Where it says -Identity i've tried the group e-mail address, the group id and the group name. All return the same error

"The operation couldn't be performed because object 'TestGroup@whschool.co.uk' couldn't be found on 'HE1P191A001DC05.EURP191A001.PROD.OUTLOOK.COM'.
+ CategoryInfo : NotSpecified: (:) [Add-UnifiedGroupLinks], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : [Server=DB6PR0802MB2197,RequestId=044db077-9a8b-4e38-903f-e1b306651397,TimeStamp=07/10/2020 09:32:04] [FailureCategory=Cmdlet-
ManagementObjectNotFoundException] A4623CE0,Microsoft.Exchange.Management.RecipientTasks.AddUnifiedGroupLinks
+ PSComputerName : outlook.office365.com"

Is there anything i'm missing to do this?

 

Dan

2 Replies

@DanielPotts 

I tried the exact same command you wrote and just change the group name and the user to fit my environment and the command work normally

Are you using the lastest Powershell 2.0.3 module

https://office365itpros.com/2020/09/22/microsoft-updates-exchange-online-management-module/

- if you run the same command but you explicitly mention the username you want to add, will it work, Add-UnifiedGroupLinks -Identity "TestGroup@whschool.co.uk" -Links Username@UPN -LinkType Members

best response confirmed by VI_Migration (Silver Contributor)
Solution

@farismalaebThanks for the advice. I have been using the latest version.

 

I tested with a single user and it worked. I then tried again with my CSV and it worked.

 

Not sure why, but I did hear through the grapevine there have been issues with Office 365 over the last couple of days.

 

Thanks for your help!

1 best response

Accepted Solutions
best response confirmed by VI_Migration (Silver Contributor)
Solution

@farismalaebThanks for the advice. I have been using the latest version.

 

I tested with a single user and it worked. I then tried again with my CSV and it worked.

 

Not sure why, but I did hear through the grapevine there have been issues with Office 365 over the last couple of days.

 

Thanks for your help!

View solution in original post