Wednesday , January 23 2019

How to apply a Policy or Mailbox Settings automatically while Creating a mailbox in Exchange 2010

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

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


About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Exchange Server MVP , Publisher of
Supporting/Deploying/Designing Microsoft Exchange for some years.
Extensive experience on Microsoft Technologies.

Check Also

Windows Server 2016 Activation via Phone

Install Product Key Create Installation ID – Split the digits like 3765111 1729914 6850651 4457015 ...


  1. Hi Satheshwaran,
    Your tutorials helped very much in my migration from Exchange Server 2003 > 2010.
    I have a question, I think others will find it useful to have the answer to.
    There are many more services in Exchange 2010 (and probably 2013?).
    Is there a list somewhere that identifies the functions of all these new services and, are there any that do not actually need to be enabled in a single server configuration with CAS, MBOX, HUB

    • Satheshwaran Manoharan

      I don’t think there is a list as such . default configurations should make things work . which is required for a single server configuration

  2. Hi Satheesh,

    Is there a possible way to add a set of Existing Distribution group while creating a New mailbox if so where i need to change the pattern in the script line.

    Please help me out.

    Thanks in Advance.


  3. Hello

    I have enabled the exchange cmdlet agent scripting in my organization so whenever we create or enable a new user his/her Activesync feature gets disabled. However, we discovered that the command is not executed only when running new-mailbox or enable-mailbox but it executes when we move a mailbox from a database to another which we don’t want. because users in ActiveSync_enabled group should have their ActiveSync feature enable all the time.

    do you have any solution for that?


Leave a Reply

Your email address will not be published.