1. 程式人生 > >exchange 2010 常用命令

exchange 2010 常用命令

1,檢視郵箱大小

Get-Mailbox | Get-MailboxStatistics | ft DisplayName,TotalItemSize >C:\size.txt

2,預設地址列表和策略更新

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 Global Address List" -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,收件人策略

Set-EmailAddressPolicy "Default Policy" -IncludedRecipients AllRecipients

Set-EmailAddressPolicy "gcr.com" -IncludedRecipients AllRecipients

4,獲取公用資料夾

Get-PublicFolder -Recurse | ft name,replicas

5,修改郵件傳輸大小

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,新增刪除角色

driver:\setup /mode:install/uninstall /role:ht ca ...

7,設定rpc訪問不加密

set-RpcClientAccess –ServerExchange_server_name–EncryptionRequired $ true

http://support.microsoft.com/kb/2006508

更新地址列表

get-addresslist | update-addresslist

為客戶端使用者新增訪問公用資料夾內容的許可權

Add-PublicFolderClientPermission cmdlet

或使用指令碼 AddUsersToPFRecursive.ps1

刪除或替換公用資料夾客戶端許可權

Remove-PublicFolderClientPermission cmdlet 或 RemoveUserFromPFRecursive.ps1 使用者管理指令碼

檢視公用資料夾客戶端許可權設定

Get-PublicFolderClientPermission cmdlet

檢視公用資料夾管理許可權設定

Get-PublicFolderAdministrativePermission

建立或刪除自定義資源屬性

Get-ResourceConfig 和 Set-ResourceConfig

自定義資源排程的響應郵件

Set-MailboxCalendarSettings cmdlet

設定資源預訂策略

Set-MailboxCalendarSettings cmdlet

設定排程角色成員身份

Set-MailboxCalendarSettings cmdlet

將基於 Exchange 2003 自動接受代理的資源郵箱升級到 Exchange 2007

在 Exchange 2003 計算機的命令提示符視窗中執行 RegisterMailbox.vbs /u

Set-Mailbox -Identity ConferenceRoom1 -Type Room

Set-MailboxCalendarSettings -Identity TedBremer -AutomateProcessing AutoAccept

啟用或禁用對會議郵件的自動處理

Set-MailboxCalendarSettings cmdlet

刪除過期會議請求和響應

Set-MailboxCalendarSettings -Identity "Ellen Adams" -RemoveOldMeetingMessages:$true

禁用刪除過期的會議請求和響應

Set-MailboxCalendarSettings -Identity "Ellen Adams" -RemoveOldMeetingMessages:$false

啟用基於每個使用者的外部外出郵件

Set-Mailbox "Ellen Adams" -ExternalOofOptions External

管理配額郵件

New-SystemMessage、Get-SystemMessage、Set-SystemMessage 和 Remove-SystemMessage cmdlet

將公用資料夾內容從一個公用資料夾資料庫移動到另一個公用資料夾資料庫

MoveAllReplicas.ps1

ReplaceReplicaOnPFRecursive.ps1

恢復公用資料夾內容的複製

Resume-PublicFolderReplication

掛起公用資料夾內容複製

Suspend-PublicFolderReplication

獲取公用資料夾的統計資訊

Get-PublicFolderStatistics -Identity <;PublicFolderIdParameter>

將資源郵箱新增到地址列表

Set-AddressList cmdlet

移動地址列表

Move-AddressList -Identity <AddressListIdParameter> -Target <AddressListIdParameter>

使用收件人篩選器建立地址列表

New-AddressList -Name <String> -RecipientFilter <String>

檢視地址列表的成員

Get-Recipient cmdlet

建立離線通訊簿虛擬目錄

New-OABVirtualDirectorycmdlet

刪除、重新建立和重新連線離線通訊簿虛擬目錄

Get-OABVirtualDirectory

Remove-OABVirtualDirectory

為離線通訊簿分發要求 SSL

Set-OABVirtualDirectory

使用收件人篩選器建立電子郵件地址策略

New-EmailAddressPolicy -Name <String> -RecipientFilter <String>

禁用或啟用 Exchange 搜尋

Set-MailboxDatabase MailboxDatabaseName -IndexEnabled $false

Set-MailboxDatabase MailboxDatabaseName -IndexEnabled $true

Get-MailboxDatabase cmdlet 或 Test-ExchangeSearch cmdlet

建立全域性地址列表 以及修改 刪除 和更新

New-GlobalAddressList cmdlet

Set-GlobalAddressList cmdlet

Remove-GlobalAddressList cmdlet

Update-GlobalAddressList cmdlet

在 Exchange 2007 中建立 Outlook Web Access 虛擬目錄並檢視修改刪除

New-OWAVirtualDirectory cmdlet

Get-OWAVirtualDirectory

Set-owavirtualdirectory

Remove-OwaVirtualDirectory

啟用 Outlook Web Access 中的明確登入

Add-MailboxPermission

配置 Gzip 壓縮設定

Set-OwaVirtualDirectory -identity "owa (Default Web Site)" -GzipLevel High

為 Outlook Web Access 配置登入和錯誤語言設定

Set-OwaVirtualDirectory -identity "Owa (Default Web Site)" -DefaultClientLangugage <language code>

為單個郵箱配置客戶端語言設定

Set-OwaVirtualDirectory -identity "Owa (Default Web Site)" -DefaultClientLangugage <language code>

建立和刪除 Exchange ActiveSync 虛擬目錄.

New-ActiveSyncVirtualDirectory

Remove-ActiveSyncVirtualDirectory

在 Exchange ActiveSync 中使用 Exchange 命令列管理程式來配置 Autodiscover

Set-ActiveSyncVirtualDirectory -Identity "COMPUTERNAME\Microsoft-Server-ActiveSync (Default Web Site)" -ExternalURL

生成 Exchange ActiveSync 報告

Export-ActiveSyncLog

禁用 Exchange ActiveSync 的裝置

Set-CASMailbox -Identity: "EmailAlias" -ActiveSyncAllowedDeviceIDs: "<DeviceID_1>","<DeviceID_2>"

檢視所有使用者的郵箱大小及郵件數量

Get-MailboxStatistics | select DisplayName, ItemCount, TotalItemSize

使 POP3 和 IMAP4 使用者能夠使用預設協議設定

Set-PopSettings 或 Set-ImapSettings cmdlet

配置對 Exchange 2003 伺服器的 POP3 訪問

Set-PopSettings -ProxyTargetPort 110

禁用對 Exchange 2003 伺服器的 POP3 訪問

Set-PopSettings -ProxyTargetPort 0

配置 IMAP4 訪問 Exchange 2003 伺服器

Set-ImapSettings -ProxyTargetPort 143

Set-ImapSettings -ProxyTargetPort 0(禁用)

新建自動發現服務虛擬目錄

New-AutodiscoverVirtualDirectory -Websitename <websitename> -BasicAuthentication:$true -WindowsAuthentication:$true

刪除預設的自動發現服務虛擬目錄

Remove-AutodiscoverVirtualDirectory -Identity "MyServer\autodiscover(autodiscover.contoso.com)"

測試 Outlook 2007 自動發現連線性

Test-OutlookWebServices -ClientAccessServer "CASServer01"

多個林配置 Autodiscover 服務

Export-AutodiscoverConfig cmdlet

配置自動發現服務以使用站點關聯

Set-ClientAccessServer -Identity "ServerName" -AutodiscoverServiceInternalURI "https://internalsitename/autodiscover/autodiscover.xml" AutodiscoverSiteScope "SiteName"

為網路負載平衡的計算機配置可用性服務

Set-WebServicesVirtualDirectory cmdlet

診斷可用性服務的問題

Test-OutlookWebServices cmdlet

使用其他受信任的證書替換預設 SSL 證書

Get-ExchangeCertificate cmdlet

Export-ExchangeCertificate

請求 SSL 證書

New-ExchangeCertificate

在單個郵箱上配置反垃圾郵件功能

set-Mailbox -Identity <MailboxIdParameter> -AntispamBypassEnabled <$true | $false> -RequireSenderAuthenticationEnabled <$true | $false> -SCLDeleteEnabled <$true | $false | $null> -SCLDeleteThreshold <Nullable> -SCLJunkEnabled <$true | $false | $null > -SCLJunkThreshold <Nullable> -SCLQuarantineEnabled <$true | $false | $null > -SCLQuarantineThreshold <Nullable> -SCLRejectEnabled <$true | $false | $null > -SCLRejectThreshold <Nullable>

多個郵箱上配置反垃圾郵件功能

Set-OrganizationConfig -SCLJunkThreshold <Int32>

匯出郵箱資料

Export-Mailbox

從 .pst 檔案匯入郵箱資料

Import-Mailbox -Identity -PSTFolderPath C:\PSTFiles\john.pst

轉換郵箱

Set-Mailbox ConfRoom1 -Type Room

更改使用者郵箱的語言

Set-Mailbox -Identity "user" -Languages "Languages"

管理程式限制整個 Exchange 組織中每封郵件的收件人數

Set-TransportConfig -MaxRecipientEnvelopeLimit

管理程式限制接收聯結器中每封郵件的收件人數

Set-ReceiveConnector -Identity "Contoso Receive Connector" -MaxRecipientsPerMessage

管理程式限制集線器傳輸伺服器中每封郵件的收件人數

Set-TransportServer -Identity "Server01" -PickupDirectoryMaxRecipientsPerMessage

資源郵箱上啟用或禁用自動預定

Set-MailboxCalendarSettings <Identity> -AutomateProcessing:AutoAccept

設定資源郵箱上的委派

Set-MailboxCalendarSettings cmdlet

設定對資源郵箱日程的完全控制訪問許可權.

Add-MailboxPermission cmdlet

對多個現有聯絡人啟用郵件

Get-Contact | Out-File "C:\ContactsList.CSV"

管理外部郵局主管地址

Set-TransportServer <TransportServerName> -ExternalPostmasterAddress <ExternalPostmasterSMTPAddress>

在林之間移動郵箱

Move-Mailbox cmdlet

GlobalCatalog 和 SourceForestGlobalCatalog 引數用於查詢目標林和源林中的郵箱

合併郵箱

Move-Mailbox -Identity john -TargetDatabase "Mailbox Database" -AllowMerge $true

檢視 UM 伺服器的活動呼叫數

Get-UMActiveCalls -Server MyUMServer

向統一訊息伺服器新增統一訊息語言

Setup.com /AddUmLanguagePack:<UmLanguagePackName> /s: d:\<MyLocalFolder>

從統一訊息伺服器上刪除統一訊息語言包

Setup.com /RemoveUmLanguagePack:<UmLanguagePackName> /s: d:\<MyLocalFolder>

將接收聯結器連結到新的傳送聯結器

New-SendConnector -Name <ConnectorName> -LinkedReceiveConnector <ReceiveConnectorID> -SmartHosts <SmarthostID> -SmartHostAuthMechanism <AuthMechanism> -DNSRoutingEnabled $False -MaxMessageSize unlimited

將接收聯結器連結到現有的傳送聯結器

Set-SendConnector <ConnectorID> -LinkedReceiveConnector <ReceiveConnectorID> -SmartHosts <SmarthostID> -SmartHostAuthMechanism <AuthMechanism> AddressSpaces $Null -DNSRoutingEnabled $False -MaxMessageSize unlimited

修改預設 SMTP 標題

Set-ReceiveConnector cmdlet 或 New-ReceiveConnector cmdlet 中的 Banner 引數可控制 SMTP 標題

Set-ReceiveConnector <ConnectorIdentity> -Banner "<220 RemainingBannerText>"

新建 檢視 修改 刪除外部聯結器

New-ForeignConnector

Get-ForeignConnector

Set-ForeignConnector

Remove-ForeignConnector

配置外部聯結器的投遞目錄

Set-TransportServer cmdlet 中的 RootDropDirectoryPath 引數

Set-ForeignConnector cmdlet 中的 DropDirectory 引數

驗證收件人的 EdgeSync 結果

Get-User -Identity User | ft Name, GUID

配置分揀目錄

Set-TransportServer <Identity> -PickupDirectoryPath <LocalFilePath>

配置重播目錄

Set-TransportServer <Identity> -ReplayDirectoryPath <LocalFilePath>

安裝傳輸代理

Install-TransportAgent cmdlet

檢視傳輸管道中的傳輸代理
Get-TransportPipeline cmdlet

將管道跟蹤發件人地址配置捕獲來自特定 SMTP 地址的郵件

Set-TransportServer <Identity> -PipelineTracingSenderAddress <SMTPAddress>

將管道跟蹤發件人地址配置為捕獲郵件伺服器生成的郵件

Set-TransportServer <Identity> -PipelineTracingSenderAddress "<>"

與系統郵件一起使用的所支援區域設定

New-SystemMessage 和 Set-SystemMessage cmdlet

重寫單個電子郵件地址

New-Addre***ewriteEntry -Name <address rewrite entry name> -InternalAddress <internal e-mail address> -ExternalAddress <external e-mail address>

檢視地址重寫條目

Get-Addre***ewriteEntry

更改路由表日誌位置

Set-TransportServer <Identity> -RoutingTableLogPath <LocalFilePath>

更改路由表日誌目錄的最大大小

Set-TransportServer <Identity> -RoutingTableLogMaxDirectorySize <DirectorySize>

將 Active Directory 網站配置為中心網站

Set-AdSite -Identity "Site A" -HubSiteEnabled $true

設定 Active Directory IP 網站連結上的 Exchange 開銷

Set-AdSiteLink -Identity IPSITELINKAB -ExchangeCost 10

在 Active Directory 站點連結上配置最大郵件大小限制

Set-AdSiteLink -Identity DEFAULTIPSITELINK -MaxMessageSize 10MB

在路由組聯結器上配置最大郵件大小限制

Set-RoutingGroupConnector -Identity "Exchange Administrative Group (FYDIBOHF23SPDLT)\Exchange Routing Group (DWBGZMFD01QNBJR)\Ex2007 to 2003 RGC" -MaxMessageSize 10MB

禁用或啟用 AD RMS 預許可代理

Disable-TransportAgent "AD RMS Prelicensing Agent"

Enable-TransportAgent "AD RMS Prelicensing Agent"

配置附件篩選

Add-AttachmentFilterEntry -Name <MIMEContentType> -Type ContentType

啟用或禁用 Outlook 電子郵戳驗證

Set-ContentFilterConfig -OutlookEmailPostmarkValidationEnabled $true

Set-ContentFilterConfig -OutlookEmailPostmarkValidationEnabled $false

配置內容篩選的拒絕響應

Set-ContentFilterConfig -RejectionResponse <AsciiString>

將收件人域和發件人域排除在發件人 ID 篩選之外

Set-SenderIDConfig -BypassedRecipients <MultiValuedProperty>

Set-SenderIDConfig -BypassedSenderDomains <MultiValuedProperty>

為發件人信譽配置出站訪問以實現開放代理伺服器的檢測功能

Set-SenderReputationConfig -ProxyServerName <String> -ProxyServerPort <Int32> -ProxyServerType <String>

指定垃圾郵件隔離郵箱.

Set-ContentFilterConfig -QuarantineMailbox <SmtpAddress>

在集線器傳輸伺服器上啟用反垃圾郵件功能

install-AntispamAgents.ps1

為 WinHTTP 配置代理設定

proxycfg -p proxy_server "<local>"

自定義預設郵件分類

Set-MessageClassification cmdlet

複製邊緣傳輸伺服器上的傳輸規則配置

Export-TransportRuleCollection C:\Backups\EDGE02.XML

配置日記郵箱

Set-Mailbox <Journaling mailbox to configure> -AcceptMessagesOnlyFrom "Microsoft Exchange" -RequireSenderAuthenticationEnabled $True

配置備用日記郵箱

Set-TransportConfig -JournalingReportNdrTo "<>"

啟用或禁用對語音郵件和丟失呼叫通知記錄日記的功能

Set-TransportConfig -VoicemailJournalingEnabled $False

使用克隆配置任務備份邊緣傳輸伺服器

ExportEdgeConfig.ps1

將本地連續複製副本設定為種子

Update-StorageGroupCopy cmdlet

切換到資料庫的被動副本

Restore-StorageGroupCopy cmdlet

對群集網路禁用連續複製

Disable-ContinuousReplicationHostName -Identity <CMSName> -HostName <HostName>

檢視故障轉移控制配置

Get-MailboxServer -Identity:<CMSName> | Format-List

檢視群集郵箱伺服器的狀態

Get-ClusteredMailboxServerStatus -Identity:<Name>

在群集連續複製環境中移動儲存組

Suspend-StorageGroupCopy -Identity <Server\StorageGroupName>

暫停群集連續複製副本的複製

Suspend-StorageGroupCopy -Identity:<Server\StorageGroup> -suspendcomment:<Comment>

重新啟動群集連續複製副本的複製

Resume-StorageGroupCopy -Identity:<Server\StorageGroup>

在發生故障或更改後還原 CCR 功能

Get-ClusteredMailboxServer -Identity:<Server>

啟用 SCR 的儲存組移動儲存組檔案的位置

Suspend-StorageGroupCopy -Identity <Server\StorageGroupName> -StandbyMachine <NameOfSCRTargetMachine>

檢視已經啟用備用連續複製 (SCR) 的儲存組的狀態

Get-StorageGroupCopyStatus -Identity <Server>\<StorageGroup> -StandbyMachine

SCR 和資料庫可移植性

Test-ReplicationHealth 和 Get-StorageGroupCopyStatus cmdlet

檢視單一副本群集中群集郵箱伺服器的狀態

Get-ClusteredMailboxServerStatus -Identity:<Name>