14 April 2011

Problems connecting to Exchange 2010 from different AD

Not while ago we suggested to our customer that has few other companies to merge all email traffic to one Exchange 2010 server. The plan is that all users use email addresses from their original company. This setup would be like some kind of email hosting. After we migrated first of this external companies to centralized mail server we encountered strange behavior on merged company client side.

External company has few users that use Outlook 2007, just like all other users, with a difference that they can't open Out Of Office Assistant (OOF). If they open this wizard they receive this error:

"Your Out of Office settings cannot be displayed, because the server is currently unavailable. Try again later."

They also receive Offline Address Book (OAB) synchronization error:

"Task 'Microsoft Exchange' reported error (0x8004010f): 'The operation failed. An object could not be found.'"

I started troubleshooting this problem and tried all sorts of suggested solutions that I could found on Google. Steps that didn’t help were:
- checked if there is a proxy problem
- check permissions inheritance in AD on problematic users
- reapplied permissions inheritance on problematic users
- created new user from problematic user (copy) and tested new user. New user doesn't have these problems
- other user, except problematic ones, on the same computer doesn't have problems
- problematic user have problems on different computers
- created new mailbox store, move test user there and test if it works
- checked Exchange autodiscovery

Then I noticed something that pointed me to what could be wrong, but still couldn’t solve the problem. When I deleted user, created new one (with the same username) and attached old orphaned mailbox everything worked well until I:
- Unchecked "Automatically update e-mail addresses based on e-mail address policy."
- Set primary email address from name.surname @ domainA.com to name.surname @ domainB.com

After I made this change problem came back. If I apply the setting "Automatically update e-mail addresses based on e-mail address policy." back the problem remains.

I was so desperate at this point that I went sniffing Outlook traffic with WireShark. After this I finally found out what is going on and prepared a workaround. It looks like autodiscovery messes up Outlook to the point that it thinks that OAB and OOF is located on different address (in our case domainB.com) as other services. I’m not quite sure if this is an Exchange 2010/Outlook bug or my misconfiguration.

Workround goes like this:
For existing user:
- change primary email address of a user back to original domain (name.surname @ domainA.com)
- create new profile in Outlook and open Outlook to setup/initialize new profile and wait to receive few emails
- check if OOF and OAB are working
- close Outlook
- change primary email address of a user back to hosted domain (name.surname @ domainB.com)
- check if OOF and OAB still works

For new user:
- leave primary email address as given by Exchange policy (name.surname @ domainA.com)
- create new profile in Outlook and open Outlook to setup/initialize new profile and wait to receive few emails
- check if OOF and OAB are working
- close Outlook
- change primary email address of a user to hosted domain (name.surname @ domainB.com)
- check if OOF and OAB still works

Customer is now happy and so am I :)

This is it for today. Have fun!

06 April 2011

Unable to remove printer driver from Windows 7

I was contacted by a customer few days ago with yet another challanging problem. He called and said: “Luka hi, we can't upgrade or remove some printer drivers from one third of our Windows 7 x64 SP1 machines.”

The error message when we tried to remove different printer driver packages was:
Failed to remove driver HP Universal Printing PCL 6 (v5.2). The specified printer driver is currently in use.
Failed to remove driver HP Universal Printing PCL 6. The specified printer driver is currently in use.
Failed to remove package hpcu111u.inf. Driver package is in use.

and

Failed to remove driver Kyocera Classic Universaldriver. The specified printer driver is currently in use.
Failed to remove package oemsetup.inf. Driver package is in use.


I started troubleshooting this and tried almost all suggested solutions I could found on the net like:
- stop / start spooler
- reboot to safemode and unistall driver from there
- msconfig disabling all non Microsoft services
- cleanspl.exe
- logged on as every user, deleted both the printer and the driver
- disabling bidirectional support
- RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /c \\MachineName /m "AGFA-AccuSet v52.3" /h "Intel"
- printui /s /t2
- MS forum post: Deleting Printer drivers from Vista system 
- MS Answers question: Trying to un-ininstall print driver error message ...
- Skidzopedia post: How To Fix “Cannot remove or delete network printer” Error in Windows 
- and probably other solutions that also didn't help ...

At the end I found interesting workaround that went like this:
1. First I removed printer in "Devices and Printers"
2. Then I stopped print spooler
3. In registry I opened

HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Print Processors\

4. I renamed all Print Processors that were listed. Like Winprint to Winprint.old, Hpcpp107 to Hpcpp107.old, and so on ...
5. I started print spooler
6. Removed problematic driver pack in Print Management MMC
7. Reopened registry location

HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Print Processors\

8. Renamed back all Print Processors to original name. Like Winprint.old to Winprint, Hpcpp107.old to Hpcpp107, and so on ...
9. Restart print spooler
10. Installed new printer drivers
11. Tested printing

Maybe this procedure will also help someone else with similar problems :)

This is it for today. Have fun!