Exchange 2010 Common commands
1, check the mailbox size
Get-Mailbox | Get-MailboxStatistics | ft DisplayName,TotalItemSize > C:\ size.txt
2, default address list and policy updates
Default E-Mail Address Policy:
Set-EmailAddressPolicy "Default Policy"-IncludedRecipients AllRecipients-ForceUpgrade
Default Address Lists:
Set-AddressList "All Contacts"-IncludedRecipients MailContacts-ForceUpgrade
Set-AddressList "All Groups"-IncludedRecipients MailGroups-ForceUpgrade
Set-AddressList "All Users"-IncludedRecipients MailboxUsers-ForceUpgrade
Set-GlobalAddressList "Default GlobalAddressList"-RecipientFilter {(Alias-ne $null-and (ObjectClass-eq 'user'-or ObjectClass-eq' contact'-or ObjectClass-eq 'msExchSystemMailbox'-or ObjectClass-eq' msExchDynamicDistributionList'-or ObjectClass-eq 'group'-or ObjectClass-eq' publicFolder'))}-ForceUpgrade
Set-AddressList "Public Folders"-RecipientFilter {RecipientType-eq 'PublicFolder'}-ForceUpgrade
Set-AddressList itdept-RecipientFilter {(RecipientType-eq 'UserMailbox')-and (Department-like' itdept')}
3, recipient Policy
Set-EmailAddressPolicy "Default Policy"-IncludedRecipients AllRecipients
Set-EmailAddressPolicy "gcr.com"-IncludedRecipients AllRecipients
4, get the public folder
Get-PublicFolder-Recurse | ft name,replicas
5. Modify the message transfer size
Get-ReceiveConnector | Set-ReceiveConnector-MaxMessageSize 11MB
Get-SendConnector | Set-SendConnector-MaxMessageSize 11MB
Set-TransportConfig-MaxSendSize 11MB-MaxReceiveSize 11MB
Set-TransportConfig-InternalDsnMaxMessageSize 20MB
Get-Mailbox | Set-Mailbox-MaxSendSize 11MB-MaxReceiveSize 11MB
6, add and delete roles
Driver:\ setup / mode:install/uninstall / role:ht ca...
7. Set rpc access not to be encrypted
Set-RpcClientAccess-ServerExchange_server_name-EncryptionRequired $true
Http://support.microsoft.com/kb/2006508
Update address list
Get-addresslist | update-addresslist
Add permissions for client users to access the contents of public folders
Add-PublicFolderClientPermission cmdlet
Or use the script AddUsersToPFRecursive.ps1
Remove or replace public folder client permissions
Remove-PublicFolderClientPermission cmdlet or RemoveUserFromPFRecursive.ps1 user management script
View public folder client permission settings
Get-PublicFolderClientPermission cmdlet
View public folder management permission settings
Get-PublicFolderAdministrativePermission
Create or delete custom resource properties
Get-ResourceConfig and Set-ResourceConfig
Response message for custom resource scheduling
Set-MailboxCalendarSettings cmdlet
Set resource booking policy
Set-MailboxCalendarSettings cmdlet
Set scheduling role membership
Set-MailboxCalendarSettings cmdlet
Upgrade Exchange 2003-based resource mailboxes that automatically accept agents to Exchange 2007
Run RegisterMailbox.vbs / u from a command prompt window on an Exchange 2003 computer
Set-Mailbox-Identity ConferenceRoom1-Type Room
Set-MailboxCalendarSettings-Identity TedBremer-AutomateProcessing AutoAccept
Enable or disable automatic handling of conference messages
Set-MailboxCalendarSettings cmdlet
Delete expired meeting requests and responses
Set-MailboxCalendarSettings-Identity "Ellen Adams"-RemoveOldMeetingMessages:$true
Disable deletion of expired meeting requests and responses
Set-MailboxCalendarSettings-Identity "Ellen Adams"-RemoveOldMeetingMessages:$false
Enable external out-of-office mail based on each user
Set-Mailbox "Ellen Adams"-ExternalOofOptions External
Manage quota messages
New-SystemMessage, Get-SystemMessage, Set-SystemMessage and Remove-SystemMessage cmdlet
Move public folder contents from one public folder database to another
MoveAllReplicas.ps1
ReplaceReplicaOnPFRecursive.ps1
Restore replication of public folder contents
Resume-PublicFolderReplication
Suspend public folder content replication
Suspend-PublicFolderReplication
Get statistics for public folders
Get-PublicFolderStatistics-Identity
Add a resource mailbox to the address list
Set-AddressList cmdlet
Mobile address list
Move-AddressList-Identity-Target
Create an address list using a recipient filter
New-AddressList-Name-RecipientFilter
View the members of the address list
Get-Recipient cmdlet
Create an offline address book virtual directory
New-OABVirtualDirectorycmdlet
Delete, recreate, and reconnect offline address book virtual directories
Get-OABVirtualDirectory
Remove-OABVirtualDirectory
SSL is required for offline address book distribution
Set-OABVirtualDirectory
Create an email address policy using recipient filters
New-EmailAddressPolicy-Name-RecipientFilter
Disable or enable Exchange search
Set-MailboxDatabase MailboxDatabaseName-IndexEnabled $false
Set-MailboxDatabase MailboxDatabaseName-IndexEnabled $true
Get-MailboxDatabase cmdlet or Test-ExchangeSearch cmdlet
Create a global address list and modify deletions and updates
New-GlobalAddressList cmdlet
Set-GlobalAddressList cmdlet
Remove-GlobalAddressList cmdlet
Update-GlobalAddressList cmdlet
Create an Outlook Web Access virtual directory in Exchange 2007 and view the modification and deletion
New-OWAVirtualDirectory cmdlet
Get-OWAVirtualDirectory
Set-owavirtualdirectory
Remove-OwaVirtualDirectory
Enable explicit login in Outlook Web Access
Add-MailboxPermission
Configure Gzip compression settings
Set-OwaVirtualDirectory-identity "owa (Default Web Site)"-GzipLevel High
Configure login and error language settings for Outlook Web Access
Set-OwaVirtualDirectory-identity "Owa (Default Web Site)"-DefaultClientLangugage
Configure client language settings for a single mailbox
Set-OwaVirtualDirectory-identity "Owa (Default Web Site)"-DefaultClientLangugage
Create and delete Exchange ActiveSync virtual directories.
New-ActiveSyncVirtualDirectory
Remove-ActiveSyncVirtualDirectory
Use the Exchange Management Shell to configure Autodiscover in Exchange ActiveSync
Set-ActiveSyncVirtualDirectory-Identity "COMPUTERNAME\ Microsoft-Server-ActiveSync (Default Web Site)"-ExternalURL
Generate Exchange ActiveSync report
Export-ActiveSyncLog
Devices with Exchange ActiveSync disabled
Set-CASMailbox-Identity: "EmailAlias"-ActiveSyncAllowedDeviceIDs: ","
Check the mailbox size and number of messages for all users
Get-MailboxStatistics | select DisplayName, ItemCount, TotalItemSize
Enables POP3 and IMAP4 users to use default protocol settings
Set-PopSettings or Set-ImapSettings cmdlet
Configure POP3 access to the Exchange 2003 server
Set-PopSettings-ProxyTargetPort 110
Disable POP3 access to Exchange 2003 servers
Set-PopSettings-ProxyTargetPort 0
Configure IMAP4 to access the Exchange 2003 server
Set-ImapSettings-ProxyTargetPort 143
Set-ImapSettings-ProxyTargetPort 0 (disabled)
Create a new automatic discovery service virtual directory
New-AutodiscoverVirtualDirectory-Websitename-BasicAuthentication:$true-WindowsAuthentication:$true
Delete the default autodiscover service virtual directory
Remove-AutodiscoverVirtualDirectory-Identity "MyServer\ autodiscover (autodiscover.contoso.com)"
Test Outlook 2007 auto-discovery connectivity
Test-OutlookWebServices-ClientAccessServer "CASServer01"
Multiple forests configure Autodiscover service
Export-AutodiscoverConfig cmdlet
Configure the autodiscovery service to use site associations
Set-ClientAccessServer-Identity "ServerName"-AutodiscoverServiceInternalURI "https://internalsitename/autodiscover/autodiscover.xml" AutodiscoverSiteScope" SiteName
Configure availability services for network load-balanced computers
Set-WebServicesVirtualDirectory cmdlet
Diagnose problems with availability servic
Test-OutlookWebServices cmdlet
Replace the default SSL certificate with another trusted certificate
Get-ExchangeCertificate cmdlet
Export-ExchangeCertificate
Request SSL certificate
New-ExchangeCertificate
Configure anti-spam on a single mailbox
Set-Mailbox-Identity-AntispamBypassEnabled-RequireSenderAuthenticationEnabled-SCLDeleteEnabled-SCLDeleteThreshold-SCLJunkEnabled-SCLJunkThreshold-SCLQuarantineEnabled-SCLQuarantineThreshold-SCLRejectEnabled-SCLRejectThreshold
Anti-spam feature is configured on multiple mailboxes
Set-OrganizationConfig-SCLJunkThreshold
Export mailbox data
Export-Mailbox
Import mailbox data from a .pst file
Import-Mailbox-Identity-PSTFolderPath C:\ PSTFiles\ john.pst
Convert mailbox
Set-Mailbox ConfRoom1-Type Room
Change the language of a user's mailbox
Set-Mailbox-Identity "user"-Languages "Languages"
The hypervisor limits the number of recipients per message throughout the Exchange organization
Set-TransportConfig-MaxRecipientEnvelopeLimit
The hypervisor limits the number of recipients per message in the receive connector
Set-ReceiveConnector-Identity "Contoso ReceiveConnector"-MaxRecipientsPerMessage
The hypervisor limits the number of recipients per message in the Hub Transport server
Set-TransportServer-Identity "Server01"-PickupDirectoryMaxRecipientsPerMessage
Enable or disable automatic booking on the resource mailbox
Set-MailboxCalendarSettings-AutomateProcessing:AutoAccept
Set up delegation on the resource mailbox
Set-MailboxCalendarSettings cmdlet
Set full control access to the resource mailbox schedule.
Add-MailboxPermission cmdlet
Enable mail for multiple existing contacts
Get-Contact | Out-File "C:\ ContactsList.CSV"
Manage the address of the external postmaster
Set-TransportServer-ExternalPostmasterAddress
Move mailboxes between forests
Move-Mailbox cmdlet
The GlobalCatalog and SourceForestGlobalCatalog parameters are used to find mailboxes in the target and source forests
Merge mailboxes
Move-Mailbox-Identity john-TargetDatabase "Mailbox Database"-AllowMerge $true
View the number of active calls from the UM server
Get-UMActiveCalls-Server MyUMServer
Add a Unified messaging language to the Unified messaging server
Setup.com / AddUmLanguagePack: / s: d:\
Remove the Unified messaging language pack from the Unified messaging server
Setup.com / RemoveUmLanguagePack: / s: d:\
Link the receive connector to the new send connector
New-SendConnector-Name-LinkedReceiveConnector-SmartHosts-SmartHostAuthMechanism-DNSRoutingEnabled $False-MaxMessageSize unlimited
Link a receive connector to an existing send connector
Set-SendConnector-LinkedReceiveConnector-SmartHosts-SmartHostAuthMechanism AddressSpaces $Null-DNSRoutingEnabled $False-MaxMessageSize unlimited
Modify the default SMTP title
The Banner parameter in Set-ReceiveConnector cmdlet or New-ReceiveConnector cmdlet controls the SMTP title
Set-ReceiveConnector-Banner ""
New View Modification Delete external Connector
New-ForeignConnector
Get-ForeignConnector
Set-ForeignConnector
Remove-ForeignConnector
Configure the delivery directory for the external connector
RootDropDirectoryPath parameters in Set-TransportServer cmdlet
DropDirectory parameters in Set-ForeignConnector cmdlet
Verify the recipient's EdgeSync result
Get-User-Identity User | ft Name, GUID
Configure the sorting catalog
Set-TransportServer-PickupDirectoryPath
Configure the replay directory
Set-TransportServer-ReplayDirectoryPath
Install the transport agent
Install-TransportAgent cmdlet
View the transport agent in the transport pipeline
Get-TransportPipeline cmdlet
Configure the pipe trace sender address to capture messages from a specific SMTP address
Set-TransportServer-PipelineTracingSenderAddress
Configure the pipe tracking sender address to capture messages generated by the mail server
Set-TransportServer-PipelineTracingSenderAddress ""
Supported locales for use with system mail
New-SystemMessage and Set-SystemMessage cmdlet
Rewrite a single email address
New-Addre***ewriteEntry-Name-InternalAddress-ExternalAddress
View address rewrite entries
Get-Addre***ewriteEntry
Change the location of the routing table log
Set-TransportServer-RoutingTableLogPath
Change the maximum size of the routing table log directory
Set-TransportServer-RoutingTableLogMaxDirectorySize
Configure the Active Directory site as a central site
Set-AdSite-Identity "Site A"-HubSiteEnabled $true
Set the Exchange cost on links to Active Directory IP sites
Set-AdSiteLink-Identity IPSITELINKAB-ExchangeCost 10
Configure the maximum message size limit on the Active Directory site link
Set-AdSiteLink-Identity DEFAULTIPSITELINK-MaxMessageSize 10MB
Configure the maximum message size limit on the routing group connector
Set-RoutingGroupConnector-Identity "Exchange Administrative Group (FYDIBOHF23SPDLT)\ Exchange RoutingGroup (DWBGZMFD01QNBJR)\ Ex2007 to 2003 RGC"-MaxMessageSize 10MB
Disable or enable AD RMS permissible agent
Disable-TransportAgent "AD RMS Prelicensing Agent"
Enable-TransportAgent "AD RMS Prelicensing Agent"
Configure attachment filtering
Add-AttachmentFilterEntry-Name-Type ContentType
Enable or disable Outlook electronic postmark verification
Set-ContentFilterConfig-OutlookEmailPostmarkValidationEnabled $true
Set-ContentFilterConfig-OutlookEmailPostmarkValidationEnabled $false
Configure the reject response for content filtering
Set-ContentFilterConfig-RejectionResponse
Exclude sender domain and sender domain from sender ID filtering
Set-SenderIDConfig-BypassedRecipients
Set-SenderIDConfig-BypassedSenderDomains
Configure outbound access for sender reputation to achieve the detection function of an open proxy server
Set-SenderReputationConfig-ProxyServerName-ProxyServerPort-ProxyServerType
Specify a spam quarantine mailbox.
Set-ContentFilterConfig-QuarantineMailbox
Enable anti-spam on the Hub Transport server
Install-AntispamAgents.ps1
Configure proxy settings for WinHTTP
Proxycfg-p proxy_server ""
Customize the default message classification
Set-MessageClassification cmdlet
Copy the transport rule configuration on the Edge Transport server
Export-TransportRuleCollection C:\ Backups\ EDGE02.XML
Configure journal mailbox
Set-Mailbox-AcceptMessagesOnlyFrom "Microsoft Exchange"-RequireSenderAuthenticationEnabled $True
Configure alternate journal mailbox
Set-TransportConfig-JournalingReportNdrTo ""
Enable or disable journaling for voicemail and lost call notifications
Set-TransportConfig-VoicemailJournalingEnabled $False
Back up the Edge Transport server using the clone configuration task
ExportEdgeConfig.ps1
Seed local continuous replicas
Update-StorageGroupCopy cmdlet
Switch to a passive copy of the database
Restore-StorageGroupCopy cmdlet
Disable continuous replication on a cluster network
Disable-ContinuousReplicationHostName-Identity-HostName
View failover control configuration
Get-MailboxServer-Identity: | Format-List
View the status of a clustered mailbox server
Get-ClusteredMailboxServerStatus-Identity:
Move storage groups in a cluster continuous replication environment
Suspend-StorageGroupCopy-Identity
Pause replication of cluster continuous replicas
Suspend-StorageGroupCopy-Identity:-suspendcomment:
Restart replication of cluster continuous replicas
Resume-StorageGroupCopy-Identity:
Restore CCR functionality after a failure or change
Get-ClusteredMailboxServer-Identity:
SCR-enabled storage groups move the location of storage group files
Suspend-StorageGroupCopy-Identity-StandbyMachine
View the status of storage groups with standby continuous replication (SCR) enabled
Get-StorageGroupCopyStatus-Identity\-StandbyMachine
SCR and database portability
Test-ReplicationHealth and Get-StorageGroupCopyStatus cmdlet
View the status of clustered mailbox servers in a single copy cluster
Get-ClusteredMailboxServerStatus-Identity: