new-distributiongroup -name "Group Name" -Alias "groupalias" -type "distribution" -organizationalunit example.com/OU_Name/Distribution Groups" -primarysmtpaddress "group.name@example.com"
User named: First Last at external.com
New-MailContact -Name "First Last" -ExternalEmailAddress "first.last@external.com" -alias "flast"
User named: First Last
New-Mailbox -Name "First last" -Alias "flast" -FirstName "First" -LastName "Last" -DisplayName "First Last" -OrganizationalUnit "example.com/users" -UserPrincipalName "flast@example.com" -Password (ConvertTo-SecureString -String 'password_complying_to_ad_password_policy' -AsPlainText -Force)
-Name will be used as the -DisplayName if no display name is specified
Get-User -RecipientTypeDetails User -Filter {UserPrincipalName -ne $null } -ResultSize unlimited
Enable-Mailbox -Identity flast@example.com -Alias "flast" -DisplayName "First Last" -Database "mdb01"
-Alias, -DisplayName and -Database aren't mandatory and can be populated automatically
Did the above enabling work? check using:
Get-Mailbox -Identity flast | Format-List Name,DisplayName,Alias,PrimarySmtpAddress,Database
Get distribution list members
Get-DistributionGroupMember -Identity GroupName