Solved

Creating Distribution Groups in bulk using Powershell---error

Posted on 2013-01-25
4
1,191 Views
Last Modified: 2013-01-25
I am trying to create Distribution Groups using the following scritp:


Import-CSV "D:\NewDL3.csv" | foreach {New-DistributionGroup -Name $_.name -Type $_.Type }


and I'm getting the following error: (See attachment for csv being used)  Any thoughts?

Cannot process argument transformation on parameter 'Type'. Cannot convert null to type "Microsoft.Exchange.Management.
RecipientTasks.GroupType" due to invalid enumeration values. Specify one of the following enumeration values and try again. The possible enumeration values are "Distribution, Security".
    + CategoryInfo          : InvalidData: (:) [New-DistributionGroup], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,New-DistributionGroup
NewDL3.csv
0
Comment
Question by:K Anthony O365
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Expert Comment

by:R--R
ID: 38818793
Add value security or universal in the type in the csv file and run command again.
0
 
LVL 19

Expert Comment

by:R--R
ID: 38818833
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38818872
There is a space added in the header of your CSV after Type..remove that space and run the script. Then it should work..

'Name,Type '

CSV format..
Name,Type
All Employees  USA-New York Corporate,Distribution
All Employees  USA-New York ,Distribution

Open in new window

NewDL3.csv
0
 

Author Closing Comment

by:K Anthony O365
ID: 38819431
Yes, the space in the "Type" column field was the issue!<br /><br />Thanks!
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question