Link to home
Start Free TrialLog in
Avatar of Anthony K O365
Anthony K O365Flag for United States of America

asked on

Creating Distribution Groups in bulk using Powershell---error

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
Avatar of R--R
R--R
Flag of India image

Add value security or universal in the type in the csv file and run command again.
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anthony K O365

ASKER

Yes, the space in the "Type" column field was the issue!<br /><br />Thanks!