Exchange 2010 and Set-ActiveSyncVirtualDirectory Identity

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

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
The operation couldn’t be performed because object
‘EXCH2010FE1\Microsoft-Server-ActiveSync’ couldn’t be found on ‘’.
+ CategoryInfo : NotSpecified: (0:Int32) [Set-ActiveSyncVirtualDirectory], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : B33731BE,Microsoft.Exchange.Management.SystemConfigurationTasks. SetMobileSyncVirtualDirectory

[PS] C:\Windows\system32>

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…

[PS] C:\Windows\system32>

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)

[PS] C:\Windows\system32>

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

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, 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 thoughts on “Exchange 2010 and Set-ActiveSyncVirtualDirectory Identity”

  1. Evan,
    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! 🙂

  2. 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!!

  3. 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…

  4. 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.

    1. 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.

  5. Thank you! This resolved my current issue….now on to the next. This migration isn’t as straight-forward as I would have hoped.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s