"Add-UnifiedGroupLinks is not recognized.." even though ExchangeOnlineManagement 2.0.5 is definitely installed

Viewed 39

I'm semi-new to PowerShell, so please excuse if I mix up some terminology. I need to manage M365-Groups via PS. I've inherited a productive machine which had a very old ExchangeOnlineModule installed (v. 0.4578.0). This version did allowed me to read the M365-Group members via get-unifiedGroupLinks -identity "zzz.test" -LinkType Members, but not to add members.

Next installed the latest productive version of the ExchangeOnlineMangement module according to MS' manual. The command

Get-InstalledModule

shows me version 2.0.5. The command

Get-Module -ListAvailable

shows both old an new version, installed in "Directory: C:\Program Files\WindowsPowerShell\Modules"

When I now try to run the following Add-command, I receive the error below:

Add-UnifiedGroupLinks -Identity "zzz.test" -LinkType Members -Links "mytestuser@mydomain.com"
Add-UnifiedGroupLinks : The term 'Add-UnifiedGroupLinks' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, 
verify that the path is correct and try again.
At line:1 char:1
+ Add-UnifiedGroupLinks -Identity "zzz.test" -LinkType Members -Link ...
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-UnifiedGroupLinks:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 

Same after I "manually" import that specific module version with "Import-Module".

Can anyone help me understand why this command works on my test machine, but is simply not recognized on this one? I already restarted that productive machine after the installation.

Thank you in advance & best regards

MK

1 Answers

Figured it with testing: The issue was insufficient access rights in AzureAD for the user used to connect to Exchange Online.

It would seem that the module only loads the commands for which you have the access rights to use into the connected session. Therefor, when you try to use such a command (like Add-UnifiedGroupLins) you get a "Term is not recognized" error, instead of something meaningfull.

For those who care: It worked for me after adding the Exchange administrator role and, obviously, with the Global administrator role. Maybe there is a lesser role that is sufficient, but I haven't found it.

Related