locked
Scripting with Exchange RRS feed

  • Question

  • I have two servers, both running WIndows Server 2008 r2. One is the AD/DNS server, the other the Exchange server. 

     

    I have a PowerShell script that creates an AD user. I would like this script to also create a mailbox for the user on the Exchange server. 

     

    Ideally, this script would run on the AD server and somehow add the mailbox. If necessary, it could run on the Exchange server, but I'd prefer the former. 

     

    Is this possible? 

     

    Regards,

    Gary

    Tuesday, June 7, 2011 3:04 PM

Answers

  • You should be able to install the Exchange management tools on the AD box.  Once the account is created it's just a matter of running enable-mailbox for the new user, and then set-mailbox to get all the mailbox settings like.  If you're using the Active Directory module for the account creation script, you can start with an Exchange EMS shell, and then import the AD module into that.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Marked as answer by MrGaryMan Wednesday, June 8, 2011 12:59 PM
    Tuesday, June 7, 2011 8:21 PM

All replies

  • It's possible, but without better information (like what Exchange version you've got) it's very difficult to say exactly how.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Tuesday, June 7, 2011 3:47 PM
  • I'm sorry, I forgot to include I'm running Exchange 2010 SP1
    Tuesday, June 7, 2011 8:08 PM
  • You should be able to install the Exchange management tools on the AD box.  Once the account is created it's just a matter of running enable-mailbox for the new user, and then set-mailbox to get all the mailbox settings like.  If you're using the Active Directory module for the account creation script, you can start with an Exchange EMS shell, and then import the AD module into that.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Marked as answer by MrGaryMan Wednesday, June 8, 2011 12:59 PM
    Tuesday, June 7, 2011 8:21 PM
  • Hi,

    How to install Exchange management Tools:

    http://technet.microsoft.com/en-us/library/bb232090.aspx

    Enable-mailbox

    http://technet.microsoft.com/en-us/library/aa998251.aspx

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, June 15, 2011 7:00 AM