Manage cmdlet extension agents

 

適用版本:Exchange Server 2013

上次修改主題的時間:2012-11-19

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 extension agents.

  • Estimated time to complete each procedure: less than 5 minutes

  • 您必須已獲指派權限,才能執行此程序或這些程序。若要查看您需要的權限,請參閱 "Cmdlet extension agents" entry in the Exchange 及命令介面基礎結構權限 topic.

  • Before you enable the Scripting Agent, you must verify that it's configured correctly. For more information about the Scripting Agent, see Cmdlet extension agents.

  • You must use the Shell to perform these procedures.

  • 如需適用於此主題中程序的快速鍵相關資訊,請參閱 Exchange 系統管理中心的鍵盤快速鍵

提示提示:
有問題嗎?在 Exchange 論壇中尋求協助。此論壇的網址為:Exchange ServerExchange OnlineExchange Online Protection

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. Before you enable the Scripting Agent, you need to make sure that you've deployed the ScriptingAgentConfig.xml configuration file to all the servers in your organization. If you don't deploy the configuration file first and you enable the Scripting Agent, all non-Get cmdlets fail when they're run. This example enables the Scripting Agent.

Enable-CmdletExtensionAgent "Scripting Agent"

For detailed syntax and parameter information, see Enable-CmdletExtensionAgent.

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. This example disables the Scripting Agent.

Disable-CmdletExtensionAgent "Scripting Agent"

For detailed syntax and parameter information, see Disable-CmdletExtensionAgent.

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. In this example, the details of the Mailbox Permissions Agent are returned.

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.

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. This is especially useful if you create a custom script that's run in the Scripting Agent, and you want that script to take precedence over a built-in agent. For more information about the Scripting Agent, see Cmdlet extension agents.

注意注意:
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 extension agents.

This example changes the priority of a cmdlet extension agent by using the Set-CmdletExtensionAgent cmdlet. In this example, the priority of the Scripting Agent is changed to 3.

Set-CmdletExtensionAgent "Scripting Agent" -Priority 3

For detailed syntax and parameter information, see Set-CmdletExtensionAgent.

 
顯示: