Showing posts with label Exchange. Show all posts
Showing posts with label Exchange. Show all posts

Wednesday, February 13, 2013

Assigning a Throttling Policy to all iOS 6.1 Devices in Exchange 2010

UPDATE 14-Feb-2013: After being linked to from Ars Technica, I felt the need to improve the script. My original version of the script tried to use the UserDisplayName field that is returned from Get-ActiveSyncDevice.  However, that field had a maximum number of characters, and a number of longer user DNs got cut off, which would make the script fail for that user. I figured out a way around it, and the script has been updated.

If you're an Exchange administrator, you have probably heard about the issues caused by Apple's iOS 6.1 on Exchange servers.  It seems that screwy calendar code in iOS 6.1 ends up generating tons of transaction logs in Exchange, and can bring CAS servers to its knees.

As an aside, its rather timely that this has come up just after the new Blackberry 10 came out.  Coincidence??????  Heh.

The temporary workarounds that MS recommends were to either apply a throttling policy to affected users, or block iOS 6.1 devices completely.  Since an all-out block is generally a Bad Thing, throttling policy is the way to go.  However, determining who is using iOS 6.1 and applying a throttling policy to them was not provided.

A company I do work for experienced the exact issue.  Exchange transaction logs were being generated at a prodigious rate.  So, rather than blocking them, we went the throttling route.  First, I created a throttling policy called iOS61 and set the ActiveSync throttling to the lowest recommended values:
New-ThrottlingPolicy -Name iOS61 -EASPercentTimeInCAS 10 -EASPercentTimeInAD 10 -EASPercentTimeInMailboxRPC 10
Then, I created a short Powershell script to apply the policy to any user with a device using iOS 6.1:
$DeviceList = Get-ActiveSyncDevice -ResultSize Unlimited | Where {$_.DeviceOS -match "iOS 6.1"}
foreach ($Device in $DeviceList)
{
$DeviceDN = $Device.DistinguishedName
 $MBName=$DeviceDN.SubString($DeviceDN.IndexOf("CN=ExchangeActiveSyncDevices,")+29)
Set-Mailbox $MBName -ThrottlingPolicy iOS61
}
The script will likely throw up some warnings about completing the command but not making any changes.  This happens because users may have more than one device, and the script tries to update the mailbox for every device it finds.  Nothing to be alarmed about.

Quick and dirty, but gets the job done.

Once Apple comes up with a solution, you can remove the throttling policy like this (assumes the users didn't have a throttling policy before this whole debacle):
Get-Mailbox -ResultSize Unlimited | Where {$_.ThrottlingPolicy -eq 'iOS61'} | Set-Mailbox -ThrottlingPolicy $NULL




Tuesday, December 14, 2010

Finally! Exchange 2010 OWA Redirect Bug Fixed!

Ever since the release of Exchange 2010 SP1, there have been numerous reports of users being prompted that they have to be redirected to another server, instead of the silent redirect that had worked like a charm until SP1.  I blogged about this in September after I experienced the issue for myself.  Since then, it's been one of the most-read pages on my blog.

I've just received word that the issue has finally been fixed in Exchange 2010 SP1 Rollup 2.  This KB article describes the issue and the confirmation that it's been fixed by RU2.

You can get Rollup 2 here.

Friday, October 1, 2010

Check your Exchange 2010 UM Dial Plans Before Upgrading to SP1

I thought I'd pass along my experience with some undocumented UM changes in Exchange 2010 SP1 that recently caused a client some grief. 

This particular client has made extensive use of UM dial plans and auto attendants, with it all tied in to a Cisco Call Manager telephony environment.  The way they configured their AAs wasn't done in a manner recommended by Microsoft.  Specifically, they didn't consistently assign Dialing Rule Groups to their AAs. 

If you're not familiar with Dialing Rule Groups, they are essentially groupings of dialing rules used to determine the types of calls that users can make when they make outgoing calls via Exchange UM.  For instance, you might have a dialing rule group that contains a set of rules that only allows local calls.  According to MS Best Practices, every dial plan and auto attendant should have at least one dialing rule group assigned to handle every possible combination of numbers it is expected to see.

The UM Dial Plans used by this client were almost exclusively set to 4 digits.  Many of the AAs had key mappings (ie Press 1 to reach Sales) that routed to 7-digit extensions.  There were no dialing rule groups in place on the AAs.  In Exchange 2007 and Exchange 2010 RTM, this didn't seem to matter.  The auto attendants always routed the calls properly.

However, once we put in SP1, all the auto attendants that routed calls to extensions with more than 4 digits failed.  Users would get to the main menu, press the button corresponding to the key mapping and get a message saying the call could not be completed, and the caller was returned to the main menu. 

After much sweating, hand-wringing and a call to MS Premier Support, we determined that we required a dialing rule group on each of the auto attendants that routed to 7-digit extensions.  Once done, calls were routed as before.

The Microsoft support rep said that the AAs should never have worked using the configuration this client had in place.  However, this client had successfully used this method in both Exchange 2007 and Exchange 2010 RTM.  It was only Exchange 2010 SP1 where this became an issue.  One way you could look at it is that Exchange 2010 SP1 corrected an logical oversight in previous versions.

So, in essense, make sure your dial plans and auto attendants are configured according to Microsoft's Best Practices BEFORE upgrading to Exchange 2010 SP1.

Wednesday, September 29, 2010

E2K7 OWA Redirect Bug Introduced with Exchange 2010 SP1

I just deployed Exchange 2010 SP1 to an enterprise customer that has a mix of Exchange 2007 and Exchange 2010 users.  It seems that SP1 has introduced a rather aggravating and obvious bug.  Before I get into that, I'll give some background on how Exchange 2010 coexists with previous versions of Exchange.

When you have a mix of Exchange 2010 and older versions in your environment, you have to do a bit of work to make the two work together for your external users.  In a nutshell, you use Exchange 2010 Client Access Server (CAS) as your primary entry point for all external users. 

Say you use owa.company.com as your externally accessible URL.  If an Exchange 2010 user logs in from the Internet, the Exchange 2010 CAS will do its thing and the user will get a nice Outlook Web App screen.

If an Exchange 2007 user logs in using owa.company.com, the Exchange 2010 CAS will redirect the user to an externally accessible Exchange 2007 CAS using a different URL (like legacy.company.com).  The redirection is silent, but the user may notice their browser changed to legacy.company.com. 

How the redirect is handled is managed by the LegacyRedirectType setting in the Exchange 2010 OWA virtual directory.  In most cases, LegacyRedirectType is set to Silent.  To see what the setting is in your environment, run:
Get-OWAVirtualDirectory -Server <CASservername> | FL Identity, LegacyRedirectType
In SP1, this redirection is no longer silent.  When your Exchange 2007 user logs in via owa.company.com, they are presented with this screen:

The text reads:
A temporary change has occurred that requires you to connect to a different server.  To connect, click the button below.  For security reasons, you'll be asked to enter your user name and password again.
Sure enough, when you click Connect, you are redirected to legacy.company.com, where you have to re-enter your user information.

Thankfully, the same sort of thing doesn't seem to happen with Outlook Anywhere or ActiveSync clients.

I checked the LegacyRedirectType value on my 2010 SP1 CAS boxes and they are all still set to Silent.  I've read the issue occurs because the OWA virtual directory value for LegacyRedirectType is being ignored.  Apparently, this bug was to be addressed in Exchange 2010 SP1 RU1, but that wasn't the case.  Hopefully, Rollup 2 will fix the issue.

This is an extraordinarily unfortunate thing to have been introduced with SP1.   If you have a mixed Exchange 2007/2010 environment, I suggest you wait before deploying SP1.

UPDATE (01-Dec-2010):  Thanks to an anonymous commenter below, there is a workaround for the OWA redirect issue.  Navigate to C:\Program Files\Microsoft\Exchange\v14\ClientAccess\Owa (or whereever you installed Exchange) and edit the casredirect.aspx with Notepad.

Add the following line just under the existing meta-tag that starts with <meta http-equiv...:
<meta http-equiv="refresh" content="0;URL=https://legacy.domain.com/owa">
Replace legacy.domain.com with whatever you are using for your redirect URL.  Save the file and issue an IISRESET from the command line.  When your legacy users logon to OWA, they will still see the redirect page, but users will not have to press the button to continue.  It should automatically switch them to the legacy URL. 

It's not perfect, but at least its something.  Thanks again to the anonomous user who brought this to my attention!

FINAL UPDATE (14-Dec-2010): The redirect issue has finally been fixed in Exchange 2010 SP1 Rollup 2!  Read more about it here.

Monday, August 30, 2010

Migrating Exchange 2007 UC Custom Prompts to 2010 SP1

If you've migrated from Exchange 2007 to Exchange 2010, you may have experienced some frustration at Microsoft's documentation on how to migrate UC custom prompts (customized audio files for UM autoattendants etc) to Exchange 2010.  A bit of background:  When you recorded a custom greeting for an Exchange 2007 autoattendant or dialplan, the audio file got copied to a fileshare known as the prompt publishing point, a folder that stored all the audio files for a given dialplan.  The Exchange File Distribution Service would copy the audio files to other UM servers in the dialplan.  In Exchange 2010, the audio files are now stored in a system mailbox.  Since there is no automatic synchronization of custom prompts between Exchange 2007 and 2010, some migration process is necessary to copy the 2007 custom prompts to 2010.

A Technet article helpfully explained how to migrate individual custom prompts, but the process was far too tedious to migrate any more than a handful.  I created a simple Powershell script that did the job fairly nicely for a client with several hundred custom prompts, but it still involved multiple steps and had to be run directly on each UM publishing point.  I was going to publish the details here, but I don't need to do that now.

Thankfully, with the release of Exchange 2010 SP1, there is now a very simple way to migrate ALL your custom prompts with a single Powershell script provided by Microsoft: MigrateUMCustomPrompts.ps1.  You can find the script in the Scripts folder on any Exchange 2010 SP1 server installation (or even on the DVD).  Just run the script without any switches and it will copy all custom prompts from all publishing points into Exchange 2010.

A VERY helpful script that hasn't seen much publicity yet.

Tuesday, August 24, 2010

Can't log on to migrated mailbox

I'm working at a client, migrating from Exchange 2007 to 2010.  We're well into the mailbox migration portion of the project and it's been going very well.  However, today after migrating a bunch of service account mailboxes, users who had access to one of the mailboxes couldn't log on to it via Outlook anymore.  They kept getting the error message:
Cannot display the folder. Microsoft Exchange is not available. Either there are network problems or the Exchange computer is down for maintenance.
I tried accessing the same mailbox from both inside and outside the network and got the same error.  Even creating a new Outlook profile didn't help.  However, OWA worked fine.

After doing some digging, I saw this interesting error message on one of the 2010 CAS servers whenever I tried to access the problem mailbox:
Unhandled Exception "Multiple objects with legacy DN /o=COMPANYNAME/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=investors were found."
Stack trace: at Microsoft.Exchange.Data.Directory.Recipient.ADRecipientSession.FindByLegacyExchangeDN(String legacyExchangeDN)
at Microsoft.Exchange.Autodiscover.Providers.Outlook.OutlookAutoDiscoverProvider.GetADRecipientForRequestedUser(ADRecipientSession adRecipientSession, ADRecipient callerRecipient)
Did some more digging and found lots of references to the legacyExchangeDN being set to ADCDisabledMail (from legacy Exchange 5.5 ADC), but that wasn't my issue.  Tried searching for other AD objects with the same legacyExchangeDN, but nothing else popped up.  Finally found another mailbox with the same X500 email address in its ProxyAddresses.  I changed the X500 address of the other mailbox and the troubled mailbox could be opened without any further issue!
 
Why this didn't pop up in Exchange 2007?  Who knows.  But its something to look out for.

UPDATE (11-Oct-2011):  A Technet forum user called "Hotfix" posted a Powershell command that can be used to find users with an X500 address that points to an existing mailbox.  Hotfix wanted to post it here as a comment, but couldn't for some reason.  Here it is below:

# Gather all mailboxes.
$AllMailboxes = Get-Mailbox -ResultSize:Unlimited
# Check the LegacyExchangeDN of each mailbox.
$AllMailboxes | Foreach {
# Build the X500 address pattern match by pre-pending "X500:" in front of the mailbox LegacyExchangeDN.
$X500Address = "X500:" + $_.LegacyExchangeDN
# Perform a search for any recipient object with that X500 address. NOTE: This is not Exchange 2010 PowerShell remoting friendly.
$X500Check = Get-Recipient -Filter {EmailAddresses -eq $X500Address}
# If there was a match found, write it to the screen. This can be modified to be any type of desired output.
If ($X500Check) {
Write-Host $X500Check.PrimarySmtpAddress " - " $X500Address
}
}