PowerShell Add-UnifiedGroupLinks RRS feed

  • Question

  • Please don't shoot the noob...however, I recently reached out to Microsoft Offfice 365 Support on an issue that I had become very frustrated with. With the emergence of Office 365 Groups, we decided that it would be a great means to incorporate some of our folks that do not own a corporate email account into our communications.

    I did find a wonderful power-shell example of how to create contacts from a CSV. The problem is while it works, its mostly Greek at this point so I really can't decipher it to solve this problem.

    What I was unable to locate within the Admin Center or the Exchange admin Center was a way to add contacts of the v type to an Office 365 group. Support provided a reference to the page for Add-UnifiedGroupLinks. Great I thought! Save for the fact that after following supports instruction, mind yyou while the screen sharing was going on, that it failed to load the module. At which point I was given a story that they can only point to documentation but can't explain its usage or support it when it doen't work.

    Here is what I was told to do:

    Set-ExecutionPolicy RemoteSigned
    $Credential = Get-Credential
    Import-Module MsOnline

    This results in a lot of red across the screen. If I try the following:

    Import-Module MsOnline
    Get-Command -Module MsOnline

    The result is that Add-UnifiedGroupLinks is not in the list that is returned. I've installed the Azure sign o assistant like some pages say to do. Yet, for whatever reason, I do not get a list of modules that contains this module. Ive tried countless posts but they all seem to expect that you can already access this without error. Better yet, they forget there are complete beginers trying this for th first time.

    So, here I am totally confused. All I would like to do is to be able to add a "mail contact" that I have previously created to an Office 365 Group. I'd love it to death if i could do this from a CSV file. However, baby steps I guess. Can anyone possibly point me to an article that takes a complete noob through the steps to gain access to this module? Any assistance or even criticism would be welcome at this point. I simply cannot do business with the alternative of using the web client and adding each one individually as a guest. There's no way to effectively manage the ebb and flow of contacts that way.

    • Moved by Bill_Stewart Friday, January 26, 2018 6:39 PM This is not Office 365 support forum
    Tuesday, December 19, 2017 5:25 AM

All replies

  • All of the information you have been given is bogus.  This is quite normal for O365 support.  THey cannot generally answer any questions with a correct answer.  They all seem to be part of some vague help conspiracy that MS has unleashed on the world.

    The first thing is for you to understand tha the command "Add-UnifiedGroupLinks" is a Microsoft Exchange command.

    See: https://technet.microsoft.com/en-us/library/mt238269(v=exchg.160).aspx

    Install the Exchange support tools for this.

    Start here: https://technet.microsoft.com/en-us/library/jj200677(v=exchg.160).aspx


    Tuesday, December 19, 2017 6:17 AM
  • First, thank you so much. That got me part of the way. Just wondering if I went down the wrong path since I have hit a road block. Here is what I did.

    PS C:\> $UserCredential = Get-Credential
    cmdlet Get-Credential at command pipeline position 1
    Supply values for the following parameters:

    PS C:\> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook
    .office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
    PS C:\> Import-PSSession $Session
    WARNING: The names of some imported commands from the module 'tmp_mylzx3ex.nue' include unapproved verbs that might
    make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the
    Verbose parameter. For a list of approved verbs, type Get-Verb.
    ModuleType Version    Name                                ExportedCommands
    ---------- -------    ----                                ----------------
    Script     1.0        tmp_mylzx3ex.nue                    {Add-AvailabilityAddressSpace, Add-DistributionGroupMember...

    PS C:\> Get-Command -Name "Add-UnifiedGroup*" -Module $modName
    CommandType     Name                                               ModuleName
    -----------     ----                                               ----------
    Function        Add-UnifiedGroupLinks                              tmp_mylzx3ex.nue

    NOTE: https://technet.microsoft.com/library/mt238269(v=exchg.160).aspx

    NOTE: Attempted to link contacts to an office 365 group per the example provided on the page above, Encountered an error

    PS C:\> Add-UnifiedGroupLinks -Identity "employee 001" -LinkType Members -Links someGuyt@hotmail.com,SomeGirl@gmail.com
    Couldn't find object "someGuyt@hotmail.com". Please make sure that it was spelled correctly or specify a different object.
        + CategoryInfo          : NotSpecified: (employee 001:UnifiedGroupIdParameter) [Add-UnifiedGroupLinks], RecipientTaskException
        + FullyQualifiedErrorId : [Server=CY1PR1101MB1132,RequestId=884c9835-6384-42ea-be17-488c0922eb27,TimeStamp=12/19/2017 8:17:24 PM] [FailureCategory=Cmdlet-RecipientTaskException] A4E37840,Microsoft.Exchange.Management.RecipientTasks.AddUnifiedGroupLinks
        + PSComputerName        : outlook.office365.com

    NOTE: Attempted same with Subscribers link type wondering is that was the problem since I assume that contacts whos email is external to the company would be a guest

    PS C:\> Add-UnifiedGroupLinks -Identity "employee 001" -LinkType Subscribers -Links someGuyt@hotmail.com,SomeGirl@gmail.com
    Error on proxy command 'Add-UnifiedGroupLinks -Identity:'employee 001' -LinkType:'Subscribers' -Links:'someGuyt@hotmail.com','SomeGirl@gmail.com' -Confirm:$False' to server CY4PR11MB1973.namprd11.prod.outlook.com: Server version 15.20.0323.0000, Proxy method PSWS:
    Cmdlet error with following error message:
    Microsoft.Exchange.Management.Tasks.RecipientTaskException: Couldn't find object "someGuyt@hotmail.com". Please make sure that it was spelled correctly or specify a different object.
       at Microsoft.Exchange.Configuration.Tasks.Task.ThrowError(Exception exception, ErrorCategory errorCategory, Object target, String helpUrl)
       at Microsoft.Exchange.Configuration.Tasks.Task.WriteError(Exception exception, ErrorCategory category, Object target, Boolean reThrow)
       at Microsoft.Exchange.Management.RecipientTasks.UpdateUnifiedGroupLinksTaskBase.InternalValidate()
       at Microsoft.Exchange.Configuration.Tasks.Task.<ProcessRecord>b__92_1()
       at Microsoft.Exchange.Configuration.Tasks.Task.InvokeRetryableFunc(String funcName, Action func, Boolean terminatePipelineIfFailed)..
        + CategoryInfo          : NotSpecified: (:) [Add-UnifiedGroupLinks], CmdletProxyException
        + FullyQualifiedErrorId : Microsoft.Exchange.Configuration.CmdletProxyException,Microsoft.Exchange.Management.RecipientTasks.AddUnifiedGroupLinks
        + PSComputerName        : outlook.office365.com

    NOTE: Contacts are present in the Admin Center and in the Exchange Admin center

    NOTE: The e-mail address is spelled correctly above and matches what is in the Contact in the Admin center and in the Exchange Admin center

    NOTE: I have tried replacing the email address for the group with its alias and the result is the same

    NOTE: I have tried replacing the email address for the contact with their aliases and the result is the same

    NOTE: I have tried each contact individually and the result is the same

    QUESTION: What am I missing? I don't understand the error output.

    Tuesday, December 19, 2017 9:54 PM
  • anyone?
    Tuesday, December 26, 2017 7:31 PM
  • Hi,

    Are you trying to add these contacts into distribution list or O365 Groups (they are different objects) ?

    For O365 groups you can use "Add-UnifiedGroupLinks" and for distribution list you would use "Add-DistributionGroupMember".

    Hope this will help.



    Tuesday, December 26, 2017 9:19 PM
  • Sok,

    I am attempting to add these contacts which I previously created as contact type "mail contact" for which the contact is an external address like a GMail address.

    I can add these contacts to distribution groups just fine. I cannot add them to Office365 Groups at all.

    Above you will see the attempt and failure messages. Either I am doing something wrong, this isn't possible or those errors hold a clue I do not understand.

    I need some guidance one why this might be failing so that I can get support to pay attention to my ticket. They don't seem to be able to spot the issue. Other than the initial issue of telling me to do completely the wrong thing.

    I am still looking for help on this. Your the second person to suggest "Add-UnifiedGroupLinks" but so far it has been a suggestion. At this point I am looking for some previously tested code where someone has been successful in doing what you suggest as what I am finding online or my interpretation of it isn't working.

    Tuesday, December 26, 2017 9:44 PM
  • Hi,

    Did a test with my account and had the same issue like you (MSonline + PS).

    Reading a bit more, it seems that you cannot add mail contact (non domain email) to O365 groups with PS.

    As per cmdlet docs "Add-UnifiedGroupLinks", it can only add Members, Owners, Subscribers.

    If not wrong you are trying to add external addresses as "Guest", which is not possible yet :).


    The LinkType parameter specifies the Office 365 Group property that you want to modify. Valid values are:

    • Members

    • Owners

    • Subscribers


    I have followed the same steps from OWA and it worked.......!!!!!!

    Check this link for more info, hope it will get you in the right direction.




    Tuesday, December 26, 2017 11:00 PM
  • Sok,

    An there it is! Not possible; days down the toilet after following Office 365 Ambassador Supports advice.

    Thank you for the link. Anyone who imagined that OWA was the solution should be reassigned to work on MS Paint.

    Thanks again.


    Tuesday, December 26, 2017 11:27 PM