SOLVED

Error using Add-UnifiedGroupLinks

%3CLINGO-SUB%20id%3D%22lingo-sub-1753429%22%20slang%3D%22en-US%22%3EError%20using%20Add-UnifiedGroupLinks%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1753429%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20bulk%20add%20users%20to%20an%20Office%20365%20Mail%20enabled%20security%20group.%20My%20test%20CSV%20file%20only%20has%20one%20user%20in%2C%20so%20I%20can%20run%20it%20quickly%20and%20only%20have%201%20error%20message.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CEM%3E%22Connect-ExchangeOnline%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EImport-CSv%20-Path%20%22N%3A%5CWork%20Stuff%5CAllStudentList1.csv%22%20%7C%20ForEach-Object%20%7BAdd-UnifiedGroupLinks%20-Identity%20%22TestGroup%40whschool.co.uk%22%20-Links%20%24_.UserPrincipalName%20-LinkType%20Members%7D%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EDisconnect-ExchangeOnline%22%3C%2FEM%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWhere%20it%20says%20-Identity%20i've%20tried%20the%20group%20e-mail%20address%2C%20the%20group%20id%20and%20the%20group%20name.%20All%20return%20the%20same%20error%3CBR%20%2F%3E%3CBR%20%2F%3E%3CEM%3E%22The%20operation%20couldn't%20be%20performed%20because%20object%20'TestGroup%40whschool.co.uk'%20couldn't%20be%20found%20on%20'HE1P191A001DC05.EURP191A001.PROD.OUTLOOK.COM'.%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BAdd-UnifiedGroupLinks%5D%2C%20ManagementObjectNotFoundException%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2B%20FullyQualifiedErrorId%20%3A%20%5BServer%3DDB6PR0802MB2197%2CRequestId%3D044db077-9a8b-4e38-903f-e1b306651397%2CTimeStamp%3D07%2F10%2F2020%2009%3A32%3A04%5D%20%5BFailureCategory%3DCmdlet-%20%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EManagementObjectNotFoundException%5D%20A4623CE0%2CMicrosoft.Exchange.Management.RecipientTasks.AddUnifiedGroupLinks%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2B%20PSComputerName%20%3A%20outlook.office365.com%22%3C%2FEM%3E%3CBR%20%2F%3E%3CBR%20%2F%3EIs%20there%20anything%20i'm%20missing%20to%20do%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1753429%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1755389%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20using%20Add-UnifiedGroupLinks%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1755389%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F823156%22%20target%3D%22_blank%22%3E%40DanielPotts%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20the%20exact%20same%20command%20you%20wrote%20and%20just%20change%20the%20group%20name%20and%20the%20user%20to%20fit%20my%20environment%20and%20the%20command%20work%20normally%3C%2FP%3E%3CP%3EAre%20you%20using%20the%20lastest%20Powershell%202.0.3%20module%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Foffice365itpros.com%2F2020%2F09%2F22%2Fmicrosoft-updates-exchange-online-management-module%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Foffice365itpros.com%2F2020%2F09%2F22%2Fmicrosoft-updates-exchange-online-management-module%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E-%20if%20you%20run%20the%20same%20command%20but%20you%20explicitly%20mention%20the%20username%20you%20want%20to%20add%2C%20will%20it%20work%2C%26nbsp%3B%3CEM%3EAdd-UnifiedGroupLinks%20-Identity%20%22TestGroup%40whschool.co.uk%22%20-Links%20Username%40UPN%20-LinkType%20Members%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted

@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

Highlighted
Best Response confirmed by Vasil Michev (MVP)
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!