Exchange Server Management
Transport Rules
Add Disclaimer to Outbound Email
$Condition = Get-TransportRulePredicate FromScope
$Condition.Scope = "InOrganization"
$Condition2 = Get-TransportRulePredicate SentToScope
$Condition2.Scope = "NotInOrganization"
$Action = Get-TransportRuleAction ApplyDisclaimer
$Action.Text = "Sample disclaimer text"
New-TransportRule -Name "Sample disclaimer" `
-Condition @($Condition, $Condition2) `
-Action @($Action)
Client Access Array
Remove Client Access Array
Remove-ClientAccessArray owa.contoso.com
Create New Client Access Array
New-ClientAccessArray "Hayward CAS Array" `
-Fqdn "webemail.contoso.com" `
-Site "Hayward-Site-10"
Set RPC Client Access Server for Databases
Set-MailboxDatabase DB01 -RpcClientAccessServer "webemail.contoso.com"
Set-MailboxDatabase DB02 -RpcClientAccessServer "webemail.contoso.com"
Set-MailboxDatabase DB03 -RpcClientAccessServer "webemail.contoso.com"
Set-MailboxDatabase DB04 -RpcClientAccessServer "webemail.contoso.com"
Database Management
View Activation Preference
Get-MailboxDatabase | Format-List Name, Ac*
Example output:
Name : MBDB1
ActivationPreference : {[VKD-EXS-01, 1], [VKD-EXS-02, 2]}
Name : MBDB2
ActivationPreference : {[VKD-EXS-02, 1], [VKD-EXS-01, 2]}
Set Activation Preference
Set-MailboxDatabaseCopy -Identity MBDB2\VKD-EXS-01 -ActivationPreference 1
Move Database Path and Log Folder
Move-DatabasePath "<database-name>" `
-EdbFilePath "C:\Newlocation\DBname.edb" `
-LogFolderPath "C:\Newlocation"
Caution: This will dismount the store temporarily causing downtime.
Verify Database Path
Get-MailboxDatabase "<database-name>" | Format-List Name, *Path*
Check Database White Space
# Mailbox databases
Get-MailboxDatabase -Status |
Select-Object Server, Name, AvailableNewMailboxSpace
# Public folder databases (Exchange 2010)
Get-PublicFolderDatabase -Status "<database-name>" |
Format-Table Name, DatabaseSize, AvailableNewMailboxSpace
Offline Defragmentation
# Check for dirty shutdown
Eseutil /mh <database-path>
# If dirty shutdown, perform offline defrag
Eseutil /d <database-path>
Address Lists & OAB
Update Address Lists and OAB
# Update Global Address List
Get-GlobalAddressList | Update-GlobalAddressList
# Update Address Lists
Get-AddressList | Update-AddressList
# Update Offline Address Book
Get-OfflineAddressBook | Update-OfflineAddressBook
# Update File Distribution Service
Update-FileDistributionService -Identity "<server-name>"