We help IT Professionals succeed at work.

Unable to bulk add members to a Distribution Group

nav2567
nav2567 asked
on
1,824 Views
Last Modified: 2017-07-02
Hello,

I have a CSV file c:\users.csv which has list of UPN.  The format looks like this:

UPN
user1@mydomain.com
user2@mydomain.com
.....

I am able to use the below command to add members to an Office 365 Group:
Import-CSV "C:\users.csv" | % { Add-UnifiedGroupLinks -Identity "Office 365 testgroup" -LinkType Member -Links $_.UPN  }

However, I am getting an error if I specify a Distribution Group I create in the O365 portal Exchange admin console.
"This operation couldnt be performed because object 'testgroup' couldn't be found on ......outlook.com.....

What is the main different between the two type of groups?  How do I fix the issue?

Thanks.
Comment
Watch Question

Senior Systems Admin
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, Adam Brown....

I am trying import-csv "C:\users.csv" | foreach {add-distributiongroupmember -identity test -member $_.UPN} and I am still getting error - The operation couldn't be performed because 'TEST' matches multiple entries...

Test is a distribution group.  My users.csv file remains the same

UPN
user1@mydomain.com
user2@mydomain.com
.....

Please advise again.

Thanks.
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
The problem is with the group, not the members. Find a better identity for the group.
Get-DistributionGroup -Identity 'Test'

Open in new window

Author

Commented:
The distribution group was created in the Exchange Admin console - new>new distribution group.  

I tried Get-DistributionGroup -Identity 'Test'.   I am getting this:

The current operation is not supported on GroupMailbox.
    + CategoryInfo          : NotSpecified: (Test:String) [Get-DistributionGro
   up], RecipientTaskException
    + FullyQualifiedErrorId : [Server=DB9PR0197MB2882,RequestId=6d9e0886-6ec3-
   445a-99e1-75a856118ec2,TimeStamp=4/12/2017 10:13:36 AM] [FailureCategory=C
  mdlet-RecipientTaskException] 206B6623,Microsoft.Exchange.Management.Recip
 ientTasks.GetDistributionGroup
    + PSComputerName        : ps.outlook.com
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Something not quite right there by the looks of it, might need a bit of a look into whether or not that group is working.
Raheman M. AbdulMessaging and Directory Services
CERTIFIED EXPERT

Commented:
see if this shows up:
Get-Recipient Test -RecipientTypeDetails GroupMailbox

Open in new window

for more info refer: https://social.technet.microsoft.com/Forums/lync/en-US/5e33627d-aaaa-43f6-a8a3-38c6d63ab4d0/cant-find-phantom-email-address-on-office-365-tenancy?forum=onlineservicesexchange
this could get you to the right direction

Commented:
Can you check what is the group type of the group you created. Go to Exchange Admin Center> Recipients> Groups. The group type should be "Distribution group" and not "Office 365 Group".

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.