天天看點

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-AddressRewriteEntry -Name <address rewrite entry name> -InternalAddress <internal e-mail address> -ExternalAddress <external e-mail address>

檢視位址重寫條目

Get-AddressRewriteEntry

更改路由表日志位置

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>

exchange 2010 常用指令