Exchange Powershell CMDlets

Page contains various Exchange powershell cmdlets that are helpful from day to day.

Database Availability Groups

Dag Member Maintenance Mode for updates
Start Maintenance Mode – C:\Program Files\Microsoft\Exchange Server\V14\scripts>.\StartDagServerMaintenance.ps1 -serverName ServerName
Stop Maintenance Mode – C:\Program Files\Microsoft\Exchange Server\V14\scripts>.\StopDagServerMaintenance.ps1 -serverName ServerName

Get-DatabaseAvailabilityGroupStatus |fl (preSP1)

Test-ReplicationHealth

Client Access General

Update-FileDistributionService – Identity -Type OAB
Get-ClientAccessServer | Update-FileDistributionService -type oab

Client Access (Autodiscover)

Set-OWAVirtualDirectory \OWA* -Exchange2003URL https://legacy.contoso.com/exchange
Set-OutlookProvider -Identity EXPR -CertPrincipalName *.domain.com
Set-OutlookAnywhere -Identity ‘EXCH1\Rpc (Default Web Site)’ -IISAuthenticationMethods Basic,NTLM
Set-WebServicesVirtualDirectory -Identity “CAS1\EWS (Default Web Site)”
Set-OABVirtualDirectory -Identity “CAS1\oab (Default Web Site)” –
Set-UMVirtualDirectory -Identity “CAS1\unifiedmessaging (Default Web Site)”

Get-AutodiscoverVirtualDirectory

Set-ClientAccessServer -identity “CAS” -autodiscoverserviceinternaluri “https://autodiscover.domain.com/autodiscover/autodiscover.XML

New-ClientAccessArray –FQDN –Site

Set-ExchangeServer -Identity ExchangeServerName -StaticExcludedDomainControllers:dc.company.com

Mailbox, Groups, Public Folder and Database
Get-MailboxFolderPermission -Identity “user:\calendar”
Set-MailboxDatabase -RpcClientAccessServer “array name”
Set-Distributiongroup–identity <DistributionGroupIdParameter> –MemberDepartRestriction Closed
New-MailboxDatabase -Name “MailboxDatabase01” -EdbFilePath D:\DatabaseFiles\MailboxDatabase01.edb
New-DatabaseAvailabilityGroup -Name DAG2 -DatabaseAvailabilityGroupIPAddresses “staticip”
Get-Mailbox –Database “DatabaseName” –arbitration | ft –wrap –auto
AddReplicaToPFRecursive.ps1 -Server “Ex2003ServerName” -TopPublicFolder “\” -ServerToAdd “exchange2010”

New-MoveRequest –Identity “SystemMailbox{abcdeotrnsdosd-thedefaultname-nsdfrnfsfdsds}”
Get-MoveRequest –SourceDatabase “E-DB01”
Remove-MoveRequest “SystemMailbox{abcdeotrnsdosd-thedefaultname-nsdfrnfsfdsds}”
Set-DatabaseAvailabilityGroup DAG1 –DatabaseAvailabilityGroupIpAddresses 10.10.10.150

Hub Transport

Get-ReceiveConnector “Reinjection” | Add-ADPermission -User “NT AUTHORITY\ANONYMOUS LOGON” -ExtendedRights “ms-Exch-SMTP-Accept-Any-Recipient”

BlackBerry Enterprise Server PreRequisites

BesAdmin perms in 2010 per store (must rerun if new store is added): Get-MailboxDatabase | Add-ADPermission -User “BESAdmin” -AccessRights ExtendedRight -ExtendedRights Receive-As, ms-Exch-Store-Admin
Add-RoleGroupMember “View-Only Organization Management” -Member “BESAdmin”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s