I don’t really know why I put this blog up, but generally I write stuff here after I muddle through some ridiculous problem that may have ended up being easily resolved, but whose solution was hard to find. That’s definitely the case with this post. Currently I’m in the middle of moving my company’s email from Exchange 2003 to Exchange 2010. Microsoft has provided some pretty good documentation on how to do this, but they do assume a certain level of familiarity with the product. For example, I probably spent 30 minutes trying to run Exchange cmdlets in Powershell before I realized there’s a special shell just for Exchange, the Exchange Management Shell.
Anyway, I’m trying to setup a Client Access Server to replace our Exchange 2003 Outlook Web Access (webmail) system. Again, Microsoft’s walkthrough is pretty good, and everything seemed to be working until I got to section 4c of their instructions:
Exchange ActiveSync: Set-ActiveSyncVirtualDirectory -Identity \Microsoft-Server-ActiveSync -ExternalURL https://mail.contoso.com
For the other examples they provided, I had been replacing with the internal name of my new CAS, “EXCH2010FE1,” so that’s what I attempted to do here as well, however it threw this error:
[PS] C:\Windows\system32>Set-ActiveSyncVirtualDirectory -Identity EXCH2010FE1\Microsoft-Server-ActiveSync -ExternalURL https://webmail.example.com
The operation couldn’t be performed because object
‘EXCH2010FE1\Microsoft-Server-ActiveSync’ couldn’t be found on ‘activedir.example.com’.
+ CategoryInfo : NotSpecified: (0:Int32) [Set-ActiveSyncVirtualDirectory], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : B33731BE,Microsoft.Exchange.Management.SystemConfigurationTasks. SetMobileSyncVirtualDirectory
I racked my brain on this for a while. I discovered the Get-ActiveSyncVirtualDirectory command, hoping it would magically solve the problem (telling me what the “Identity” was), but it didn’t – at least not at first:
[PS] C:\Windows\system32>Get-ActiveSyncVirtualDirectory -server exch2010fe1
Name Server InternalUrl
—- —— ———–
Microsoft-Server-ActiveSync (Default… EXCH2010FE1 https://exch2010fe1.example.com/Microsoft-Se…
It was showing me the server, but not the Identity, which is what I wanted. Having never used Powershell before, I figured there had to be a way to get that property out of the command, but I had no idea what it was. Some more Googling finally helped me resolve it:
[PS] C:\Windows\system32>Get-ActiveSyncVirtualDirectory -server exch2010fe1 | Select-Object Identity
EXCH2010FE1\Microsoft-Server-ActiveSync (Default Web Site)
Once I supplied “EXCH2010FE1\Microsoft-Server-ActiveSync (Default Web Site)” for the Identity parameter the command completed correctly. I also tried piping the Get-ActiveSyncVirtualDirectory command directly to Set-ActiveSyncVirtualDirectory, like this:
[PS] C:\Windows\system32>Get-ActiveSyncVirtualDirectory -Server exch2010fe1 | Set-ActiveSyncVirtualDirectory -ExternalURL https://webmail.example.com
This appeared to execute successfully, but I don’t know if it actually did what I intended, so I stuck with specifying the identity manually.
The Exchange 2010 CAS is properly redirecting users to legacy.example.com, but ActiveSync isn’t working (I’m testing with my iPhone), so I guess the problem I was having above wasn’t the source of all my ills, sadly. The battle continues…
22 Replies to “Exchange 2010 and Set-ActiveSyncVirtualDirectory Identity”
Thanks for posting this. I was facing the exact same problem and you clarified the otherwise not so clear MS documentation. I’ve noticed the inconsistancy in their documentation for including the (Default Web Site) portion of the identity, or even the identity string at all sometimes. I’m just glad you rambled this one out.
Thanks again! 🙂
Glad to help!
Thanks a bunch, sir. This helped me out a great deal.
Awesome! I was in the same boat… I’ve been following TechNet articles step by step to upgrade our environment to 2010. When I got to this command and it wasn’t working, it was p*ssin’ me off. Thank you!!
great help! got anymore, Im currently having an issue with the set-outlookanywhere command (with the identity string)
Wow … thanks … I had the same issue … what me really pissed of with the MS Stuff is the documentation. NOWHERE … was explained it must be the default website…
Nice Work. I appreciate the assistance in getting my issue corrected. It’s been a long migration day!
Took me forever to find this but it worked perfectly! Thanks!
Glad I could help!
how’s your activesync doing? we have 2010 on coexistence mode. activesync seems to work on iPhone and Android for users with mailbox that are still in 2003. however, sync is very slow. i have to search for a fix (or a patch) for the slow activesync.
We’ve phased out our 2003 server completely at this point; ActiveSync is working fine on our Exchange 2010 server. Not sure I can offer any advice since we don’t have a 2003 server anymore.
thanks mate, this had me stumped as well.
Anyone know why activesynch is slow for mailboxes on a 2003 wen in coexist mode with 2010
Thank you! This resolved my current issue….now on to the next. This migration isn’t as straight-forward as I would have hoped.
Microsoft’s documentation hasn’t repaired this yet and your directions here were very helpful. Thanks!
this was helpful to me.
I had exactly the same issue and your article helped me fix it!
Thanks – your post got me one step closer to finishing this !@#$%& migration