Exchange Mailboxes and ActiveSync Policies
Posted on 2010-04-01
I have written a PowerShell script that runs every night at midnight. Its purpose is to create mailboxes for new users added in the last 24 hours. As all of the user creation logic is closely integrated with third party applications, and completed by using PHP scripts, I cannot just use the new-user cmdlet. Instead, I use the enable-mailbox cmdlet.
The Exchange environment is a mixed environment, with Exchange 2003 as well as Exchange 2007. The PHP scripts are run on a Server 2003 domain controller, and used to automatically generate the Exchange 2003 mailboxes. With Exchange 2007, this luxury no longer exists.
So the PowerShell script runs and executes flawlessly. However, there seems to be a problem with the ActiveSync policy, or the application of said policy. After the creation of the mailbox in this manner, there's no option to "Manage mobile devices" anywhere for that user. We were able to hunt it down to a flag in ADSIEdit, and can go in and configure this manually. However, this really isn't a realistic scenario, as the college has an influx of new users every semester.
I have tried manipulating the value of the Exchange ActiveSync boolean both through the EMC as well as PowerShell. I have tried moving the mailbox to a different Exchange 2007 mail store. Nothing. Still missing. However, if I move it to Exchange 2003, then move it back to Exchange 2007, voila!
What's going on with this? Does anyone have any ideas?