Solved

Creating Distribution Groups in bulk using Powershell---error

Posted on 2013-01-25
4
1,113 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:kt KTAdmin
  • 2
4 Comments
 
LVL 19

Expert Comment

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

Expert Comment

by:R--R
Comment Utility
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
Comment Utility
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:kt KTAdmin
Comment Utility
Yes, the space in the "Type" column field was the issue!<br /><br />Thanks!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Synchronize a new Active Directory domain with an existing Office 365 tenant
In this video we show how to create an Address List 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 Organization >> Ad…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now