You can use the New-DistributionGroup cmdlet to create a distribution group.

New-DistributionGroup -Name "Managers" -OrganizationalUnit "contoso.com/Users" -SamAccountName "Managers" -Type "Distribution"

For Security Group, just change the “Type” like this:

New-DistributionGroup -Name "Managers" -OrganizationalUnit "contoso.com/Users" -SamAccountName "Managers" -Type "Security"

For Example:

1

Result:

2