如何使用郵件記錄管理的 Exchange 管理命令介面指令碼

 

適用版本: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1, Exchange Server 2007

上次修改主題的時間: 2007-08-07

在這個主題中會說明如何使用 Exchange 管理命令介面中的指令碼,以管理 Microsoft Exchange Server 2007 中的通訊記錄管理 (MRM)。

開始之前

若要執行此程序,必須對您使用的帳戶委派下列項目:

  • Exchange 組織系統管理員角色

如需管理 Exchange Server 2007 所需之權限、委派角色及權利的相關資訊,請參閱權限考量

note附註:
受管理的自訂資料夾是 MRM 的高階功能。每個具有受管理的自訂資料夾之信箱則需要 Exchange Server 企業用戶端存取使用權 (CAL)。具有包含信箱受管理自訂資料夾原則的信箱需要 Exchange Server 企業 CAL。若要深入了解 MRM 的授權需求,請參閱了解通訊記錄管理中的<用戶端存取使用權與 MRM>。

程序

使用 Exchange 管理命令介面管理通訊記錄管理

  1. 在文字編輯器中輸入 Exchange 管理命令介面命令以建立指令碼,如下列範例指令碼所示。

  2. 以 ps1 副檔名儲存指令碼的文字檔 (例如,MRM_Sample_Script.ps1)。

  3. 在 Exchange 管理命令介面的命令提示中,輸入指令碼的路徑和檔案名稱 (例如,C:\Scripts\MRM_Sample_Script.ps1,若是工作目錄中的指令碼則為 .\MRM_Sample_Script.ps1)。

範例指令碼

下列是通訊記錄管理的範例指令碼。如需所執行動作的說明,請參閱指令碼內的註解。

# MRM_Sample_Script.ps1

# This script demonstrates the fundamentals of performing messaging records management by running scripts in the Exchange Management Shell.

# Create a new managed custom folder.
New-ManagedFolder -Name "Important E-mail" -FolderName "Business Folder A" 

# Create a variable, \"$age,\" to use in the next command.
$age = New-TimeSpan -Day 30

# Create managed content settings for the new managed custom folder that delete items after 30 days.
New-ManagedContentSettings -Name "Retention settings for Business Folder A" -FolderName "Business Folder A" -MessageClass VoiceMail -RetentionEnabled:$True -AgeLimitForRetention $Age -RetentionAction PermanentlyDelete

# Create a managed folder mailbox policy.
New-ManagedFolderMailboxPolicy -Name "Business Folder A" -ManagedFolderLinks "Important E-mail"

# Apply the managed folder mailbox policy to a mailbox.
Set-Mailbox -Identity Administrator -ManagedFolderMailboxPolicy "Policy A"

# Schedule the managed folder assistant to run the entire week.
$ServerName= cmd /c echo %computername%
Set-MailboxServer -ID $ServerName -ManagedFolderAssistantSchedule "Sun.12:00-Sun.11:00"

# Start the managed folder assistant. 
Start-ManagedFolderAssistant

相關資訊

如需通訊記錄管理的相關資訊,請參閱下列主題:

如需如何使用 Exchange 管理命令介面命令以管理 Exchange 2007 組織的相關資訊,請參閱 Exchange 管理主控台的新系統管理命令列面

如需透過 Exchange 管理命令介面使用指令碼的相關資訊,請參閱使用 Exchange 管理命令介面撰寫指令碼

若要確保您目前閱讀的是最新資訊,並尋找其他的 Exchange Server 2007 說明文件,請造訪 Exchange Server 技術資源中心.