Lets say I want to apply something default when I Create mailbox in my organization
Its bit easy to do using scripting agents
In this example I am applying Address book policy for newly created users automatically , you can add some more commands as per your requirement
Step 1:
Copy the Below Code
<?xml version=”1.0″ encoding=”utf-8″ ?>
<Configuration version=”1.0″>
<Feature Name=”MailboxProvisioning” Cmdlets=”new-mailbox,enable-mailbox”>
<ApiCall Name=”OnComplete”>
if($succeeded) {
Set-Mailbox $provisioningHandler.UserSpecifiedParameters[“Alias”] –AddressbookPolicy “Policy Name”
}
</ApiCall>
</Feature>
</Configuration>
Step 2:
Save as “ScriptingAgentConfig.xml”
Step 3:
Copy the File in the below location
Default: “C:\Program Files\Microsoft\Exchange Server\V14\Bin\CmdletExtensionAgents”
Step 4:
Enable-CmdletExtensionAgent "Scripting Agent"
Now Try creating a mailbox . It should apply the address book policy automatically
In the Same Format you can add some more commands or you can replace the existing ones
For Sample Code you can check in the Below location
C:\Program Files\Microsoft\Exchange Server\V14\Bin\CmdletExtensionAgents\ScriptingAgentConfig.xml.sample