question

GlennMaxwell-2309 avatar image
0 Votes"
GlennMaxwell-2309 asked emilyhua-msft edited

DL Error A parameter cannot be found

Hi All

I am executing the below syntaxes to create DL and mail enabled security group, i am getting the below error. if i remove -OnPremisesOrganizationalUnit the syntax works fine. i want to create this in a particular OU. Experts guide me.


New-DistributionGroup -Name "DL1" -Alias "DL1" -DisplayName "DL1" -SamAccountName "DL1" -OnPremisesOrganizationalUnit "OU=MyOU,DC=contoso,DC=com"

New-DistributionGroup -Type Security -Name "MG1" -Alias "MG1" -DisplayName "MG1" -SamAccountName "MG1" -OnPremisesOrganizationalUnit "OU=MyOU,DC=contoso,DC=com"

A parameter cannot be found that matches parameter name 'OnPremisesOrganizationalUnit'.
+ CategoryInfo : InvalidArgument: (:) [New-DistributionGroup], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,New-DistributionGroup
+ PSComputerName : myexchangeserver.contoso.com

office-exchange-server-administrationoffice-exchange-online-itprooffice-exchange-hybrid-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AndyDavid avatar image
0 Votes"
AndyDavid answered

Use
-OrganizationalUnit

https://docs.microsoft.com/en-us/powershell/module/exchange/new-distributiongroup?view=exchange-ps

 New-DistributionGroup -Name "DL1" -Alias "DL1" -DisplayName "DL1" -SamAccountName "DL1" -OrganizationalUnit "OU=MyOU,DC=contoso,DC=com"

"OnPremisesOrganizationalUnit" only applies for remote mailboxes:

https://docs.microsoft.com/en-us/powershell/module/exchange/new-remotemailbox?view=exchange-ps

111942-image.png



image.png (47.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.