管理 Cmdlet 延伸代理程式
適用於:Exchange Server 2013
This topic shows you how to enable, disable, view, and change the priority of cmdlet extension agents in Microsoft Exchange Server 2013. For more information about cmdlet extension agents in Exchange 2013, see Cmdlet 延伸代理程式.
開始之前有哪些須知?
每項程序的預估完成時間:不到 5 分鐘
您必須已獲指派權限,才能執行此程序或這些程序。 若要查看您需要的許可權,請參閱 Exchange 和 Shell 基礎 結構許可權主題中的「Cmdlet 延伸模組代理程式」專案。
啟用
Scripting Agent
之前,您必須確認其已正確設定。 如需 的Scripting Agent
詳細資訊,請參閱 Cmdlet 擴充代理程式。您必須使用命令介面來執行這些程序。
如需適用於此主題中程序的快速鍵相關資訊,請參閱 Exchange 系統管理中心的鍵盤快速鍵。
提示
有問題嗎? 在 Exchange 論壇中尋求協助。 瀏覽 Exchange Server 的論壇。
Enable a cmdlet extension agent
When you enable a cmdlet extension agent in Exchange 2013, the agent is run on every server running Exchange 2013 in the organization. When an agent is enabled, it's made available to cmdlets, which can then use the agent to perform additional operations.
警告
Before you enable an agent, be sure that you're aware of how the agent works and what impact the agent will have on your organization.
This example enables a cmdlet extension agent by using the Enable-CmdletExtensionAgent cmdlet. You must specify the name of the agent you want to enable when you run the cmdlet. 啟用 Scripting Agent
之前,您必須確定已將組態檔部署 ScriptingAgentConfig.xml
到組織中的所有伺服器。 如果您未先部署組態檔並啟用 Scripting ``Agent
,則所有非Get Cmdlet 在執行時都會失敗。 此範例會啟用 Scripting Agent
。
Enable-CmdletExtensionAgent "Scripting Agent"
For detailed syntax and parameter information, see Enable-CmdletExtensionAgent.
Disable a cmdlet extension agent
When you disable a cmdlet extension agent in Exchange 2013, the agent is disabled on every server running Exchange 2013 in the organization. When an agent is disabled, it's not made available to cmdlets. Cmdlets can no longer use the agent to perform additional operations.
警告
Before you disable an agent, be sure that you're aware of how the agent works and what impact disabling the agent will have on your organization.
To disable a cmdlet extension agent, use the Disable-CmdletExtensionAgent cmdlet. Specify the name of the agent you want to disable when you run the cmdlet. 此範例會停用 Scripting Agent
。
Disable-CmdletExtensionAgent "Scripting Agent"
For detailed syntax and parameter information, see Disable-CmdletExtensionAgent.
View existing cmdlet extension agents
Viewing cmdlet extension agents enables you to see which agents are run first and which agents are enabled in an Exchange 2013 organization. For more information about pipelining and the Format-Table cmdlet, see the following topics:
This example gets the details of a specific cmdlet extension agent by using the Get-CmdletExtensionAgent cmdlet. 在此範例中,會傳回 的 Mailbox Permissions Agent
詳細資料。
Get-CmdletExtensionAgent "Mailbox Permissions Agent"
This example gets multiple cmdlet extension agents by using the Get-CmdletExtensionAgent cmdlet, and then pipes the output to the Format-Table cmdlet. This example displays a list of all of the cmdlet extension agents in the organization, and by using the Format-Table cmdlet, the Name, Enabled, and Priority properties of each agent are displayed in a table.
Get-CmdletExtensionAgent | Format-Table Name, Enabled, Priority
For detailed syntax and parameter information, see Get-CmdletExtensionAgent.
Change the priority of a cmdlet extension agent
The ability to change the priority of a cmdlet extension agent in Exchange 2013 is useful when you want a certain agent to be called by a cmdlet before another agent. 如果您建立在 中執行 Scripting Agent
的自訂腳本,而且您希望該腳本優先于內建代理程式,這會特別有用。 如需 的 Scripting Agent
詳細資訊,請參閱 Cmdlet 擴充代理程式。
警告
Changing the priority or replacing the functionality of a built-in agent is an advanced operation. Be sure that you completely understand the changes you're making.
Agents are ordered from zero to the maximum number of agents. The closer to zero the agent is, the higher the priority of the agent. Agents with a higher priority are called first. For more information about agent priorities, see Cmdlet 延伸代理程式.
This example changes the priority of a cmdlet extension agent by using the Set-CmdletExtensionAgent cmdlet. 在此範例中, 的 Scripting Agent
優先順序會變更為 3。
Set-CmdletExtensionAgent "Scripting Agent" -Priority 3
For detailed syntax and parameter information, see Set-CmdletExtensionAgent.