Solved

Creating Distribution Groups in bulk using Powershell---error

Posted on 2013-01-25
4
1,167 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Contact 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 Recipients >> Contact ta…
To show how to generate a certificate request 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 >> Certificates…

733 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