Site icon Franky's Web

Exchange 2013: Deactivate mailbox features (Scripting Agent)

Exchange Server 2013 (and also Exchange 2010) provides a function to influence the behavior of standard CMDlets.

In this small example, the scripting agent is used to deactivate OWA, OWA for devices and ActiveSync for all newly created mailboxes. In the default setting, these mailbox functions are activated, which may not always be desired. However, a few steps are necessary to activate the Scripting Agent and thus adjust the behavior of standard CMDlets:

The Scripting Agent is configured using an XML file, which must be present on every Exchange server. An example file is already available in the Exchange installation folder:

C:\Program Files\Microsoft\Exchange Server\V15\Bin\CmdletExtensionAgents

Die Datei „ScriptingAgentConfig.xml.sample“ kann als Vorlage benutzt werden, dazu kann einfach das „.sample“ entfernt werden. Dieser Schritt muss auf jedem Exchange Server erfolgen. Jeder Exchange Server erhält also die gleiche „ScriptingAgentConfig.xml“ Datei:

Für dieses Beispiel hat die Datei „ScriptingAgentConfig.xml“ folgenden Inhalt:

You can also download the file here:

Wie in der Beispiel Datei zu entnehmen ist, enthält die XML Datei etwas PowerShell Code, welcher in diesem Fall ausgeführt wird, wenn das CMDLet „new-mailbox“ oder „enable-mailbox“ erfolgreich abgeschlossen wurde. Der Teil innerhalb der IF-Anweisung holt sich dann den Alias, des Postfachs welches bearbeitet wurde und deaktiviert die entsprechenden Postfachfeatures.

As soon as the XML file has been placed on the Exchange servers, the scripting agent must be activated:

Enable-CmdletExtensionAgent "Scripting Agent"

Mailboxes that are created from now on no longer have ActiveSync, OWA and OWA for devices activated

Other scenarios can also be implemented by making a few adjustments to the XML file. Switching on UC or audit, setting mailbox authorizations, calendar settings, or even an OWA signature, many things are conceivable.

The sample file on the Exchange servers is also well commented so that you can quickly find the relevant instructions.

Exit mobile version