Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


windows:powershell_commands:exchange

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
windows:powershell_commands:exchange [2016/12/22 11:09]
tplecko
windows:powershell_commands:exchange [2019/10/31 09:06] (current)
Line 1: Line 1:
 +====== Managing Exchange using PowerShell ======
 +<code bash| New distribution group>
 +new-distributiongroup -name "Group Name" -Alias "​groupalias"​ -type "​distribution"​ -organizationalunit example.com/​OU_Name/​Distribution Groups"​ -primarysmtpaddress "​group.name@example.com"​
 +</​code>​
  
 +User named: First Last at external.com
 +<code bash| New mail contact>
 +New-MailContact -Name "First Last" -ExternalEmailAddress "​first.last@external.com"​ -alias "​flast"​
 +</​code>​
 +
 +User named: First Last
 +<code bash| New Mailbox and New AD user at the same time>
 +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)
 +</​code>​
 +**-Name** will be used as the **-DisplayName** if no display name is specified
 +
 +<code bash| List users with no mailbox>
 +Get-User -RecipientTypeDetails User -Filter {UserPrincipalName -ne $null } -ResultSize unlimited
 +</​code>​
 +
 +<code bash | Enable mailbox for user with no mailbox>
 +Enable-Mailbox -Identity flast@example.com -Alias "​flast"​ -DisplayName "First Last" -Database "​mdb01"​
 +</​code>​
 +**-Alias, -DisplayName and -Database** aren't mandatory and can be populated automatically
 +
 +Did the above enabling work? check using:
 +<code bash| Get user info>
 +Get-Mailbox -Identity flast | Format-List Name,​DisplayName,​Alias,​PrimarySmtpAddress,​Database
 +</​code>​
 +
 +Get distribution list members
 +<code bash>
 +Get-DistributionGroupMember -Identity GroupName
 +</​code>​
windows/powershell_commands/exchange.txt · Last modified: 2019/10/31 09:06 (external edit)