Adding member to Distribution Group error

Welcome Forums General PowerShell Q&A Adding member to Distribution Group error

This topic contains 7 replies, has 3 voices, and was last updated by

Naw
 
Participant
1 year, 2 months ago.

  • Author
    Posts
  • #80818

    Participant
    Points: 0
    Rank: Member

    Hi,

    I am trying to add an external contact to a distribution group but it keeps failing,

    I have successfully added others but for one particular user it doesn't let me. the error I get is:

    Couldn't find object "username@test.co.uk". Please make sure that it was spelled correctly or specify a different
    object.
    + CategoryInfo : NotSpecified: (:) [Add-DistributionGroupMember], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : [Server=HE1PR0201MB2027,RequestId=8b090dc3-57a5-4fa4-8ee4-7b25e02e2654,TimeStamp=28/09/2
    017 08:30:09] [FailureCategory=Cmdlet-ManagementObjectNotFoundException] E2D3724,Microsoft.Exchange.Management.Rec
    ipientTasks.AddDistributionGroupMember
    + PSComputerName : outlook.office365.com

  • #80824

    Participant
    Points: 0
    Rank: Member

    Do you have such contact ?
    Get-Contact | ? { $_.WindowsEmailAddress -eq 'username@test.co.uk' }

  • #80825

    Participant
    Points: 0
    Rank: Member

    hi..

    no I have amended the email address as I didn't want to show what the users email is

    Do you want me to run the above code?

    • #80827

      Participant
      Points: 0
      Rank: Member

      i ran the above code and it didn't return anything

  • #80855

    Participant
    Points: 0
    Rank: Member
    Help:
    The Member parameter specifies the recipient (mail-enabled object) that you want to add to the group. You can use any value that uniquely identifies the recipient.
    

    you can add existing contacts to distribution list, not just email address, so create contact and add it 🙂

  • #80860
    Naw

    Participant
    Points: 7
    Rank: Member

    Hey Siddra

    Have you created the contact for the person that you are adding to a distribution group?
    You will have to create a contact (or mail user) if the person has an external email.
    Then add it to the Distribution List?
    e.g

    New-MailContact -Name "Chris Ashton" -ExternalEmailAddress "chris@tailspintoys.com"
    Add-DistributionGroupMember -Identity "GroupName" -Member "Chris Ashton"
    
    • #80948

      Participant
      Points: 0
      Rank: Member

      Hi,

      Yes I first tried to create the contact list and it keeps throwing an error. the error i get is:

      Active Directory operation failed on HE1PR02A005DC04.EURPR02A005.PROD.OUTLOOK.COM. The object 'CN=Emma
      Broady,OU=trinityacademyhalifax.onmicrosoft.com,OU=Microsoft Exchange Hosted
      Organizations,DC=EURPR02A005,DC=PROD,DC=OUTLOOK,DC=COM' already exists.
      + CategoryInfo : NotSpecified: (:) [New-MailContact], ADObjectAlreadyExistsException
      + FullyQualifiedErrorId : [Server=HE1PR0201MB2027,RequestId=a95d4a24-05e3-4fb0-8932-9363822c594a,TimeStamp=29/09/2
      017 07:12:17] [FailureCategory=Cmdlet-ADObjectAlreadyExistsException] 334F5F7,Microsoft.Exchange.Management.Recipi
      entTasks.NewMailContact
      + PSComputerName : outlook.office365.com

    • #80975
      Naw

      Participant
      Points: 7
      Rank: Member

      I see. It looks like you already have the Contact created.
      If you have Office 365 AD connect/DirSync running and all your on-premise AD synchronises to Office365 or Azure AD, then you can easily add the Contact (AD object) into the Distribution Group (again AD object) on your local ActiveDirectory Users and Computers. This will then sync across office 365.

      Or, if you manage all your Contact/MailUser and Distribution Group on the office 365 then try
      Get-MailContact -Identity "Chris Ashton" | Format-List
      If it returns the right value then you should be able to Add-DistributionGroupMember

      If this still fails, I will submit a support request on office 365 portal.
      Hope this helps!

The topic ‘Adding member to Distribution Group error’ is closed to new replies.