How do I create a new mailbox on Exchange 2010 with ALM 5.0?

Version 2

    ALM 5.0 can be used to automate creation of mailboxes as well as AD accounts bearing in mind that there is no direct integration between ALM 5.0 and Exchange 2010 yet. This article aims at giving a guideline of how to achieve this automation using ALM 5.0 and PowerShell.

    The solution comes in two parts. These are discussed in detail below.

    The PowerShell Part
    The PowerShell script accepts command line arguments. It will establish a connection to Exhcange 2010's PowerShell virtual directory at http://your_exchange_2010_server.domain/PowerShell/. This implicit remoting allows us to import commands into our local PowerShell session without having the need of installing Exchange 2010 Management tools.

    The ALM 5.0 Part
    This part consists of a form that the user / admin (or whoever is in charge) can access via ALM's web interface.


    The form requires input for

         First Name
         Last Name
         Email Address


    for the new user and his/hers new mailbox creation. Note that depending on your naming convention and password policy, you may remove e-mail and password fields from the form. If you need to do this, you will need to make adjustments either to ALM's workflow and form or PowerShell script (if you need any assistance, please let me know).


    The Workflow has only two actions. The first action will get the form data (that someone entered such as user's first name), and the second action is to call our PowerShell script and pass it four (4) arguments. The arguments are


    FirstName LastName Email Password


    To reap the benefits of the above approach however, there two prerequisites that you need to fulfil first.


    1) You need to allow PowerShell to execute your script! Please read more in this document: How to sign a PowerShell script
    2) The process behind ALM 5.0 is called "LANDesk Service Management". This service by default runs as local system. And local system won't be able to create the mailbox / AD account, and also it may run into problems executing the PowerShell script. So you need to run this service as an Administrator that has rights to run PowerShell and create mailboxes on Exchange 2010.



    1) LPM_NEWMAILBOX.PS1 : this is the PowerShell script
    2) Form_New email form.xml : this is the ALM 5.0 form
    3) Workflow_New Mailbox.xml : this is the ALM 5.0 workflow

    Download all of the attached files to your ALM 5.0 server. On the ALM 5.0 create a folder called Scripts in the root of your C drive, and copy the LPM_NEWMAILBOX.PS1 to this folder. In ALM 5.0 Designer, you need to import both the form and the workflow. If you want to copy the PowerShell script to a different folder, you will need to modify the workflow's PowerShell execution action and update the path to your script.


    Please use this as a guideline. You will most likely have different requirements in a production environment than my little lab. I am not a PowerShell expert. I have put together this PowerShell script from various sources on the Internet. You might find that adjustments, improvements may be needed here and there (since this is a community, it would be nice sharing your thoughts on improvements).


    Please modify the attached PowerShell script and replace the following with your own Exhcange server and domain!