Wednesday, August 29, 2012

Error uninstalling Exchange Server 2003: One or more users currently use a mailbox store on this server.

So, you're transitioning your Exchange 2003 environment to an Office 365 environment and desparately want to drop kick your Exchange 2003 server out the door.  After migrating everyone's email, you open ESM, delete all of the mailboxes and start to uninstall Exchange.  But then, this frustrating message shows up:

The component "Microsoft Exchange Messaging and Collaboration Services" cannot be assigned the action "Remove" because:
- One or more users currently use a mailbox store on this server.  These users must be moved to a mailbox store on a different server or be mail disabled before uninstalling this server.

Thanks for leaving me the fun part of trying to guess who you think still has a mailbox.

Fortunately, there's an easy way to do this.

Let's say your server name is EXCH01.

  1. Launch Active Directory Users and Computers.
  2. In the navigation pane, right-click on your domain and select Find from the context menu.
  3. In the Find Users, Contacts, and Groups window, click the Advanced tab.
  4. Click the Field button, point to User, and then select Exchange Home Server.
  5. Set the Condition field to Ends With.
  6. Enter the Exchange mailbox server you're decommissioning in the Value field (in our example, EXCH01).
  7. Click Add.
  8. Click Find Now.
  9. Once the list of users is displayed, you can right-click on the user, select Exchange Tasks, and then select Remove Exchange Attributes from the list of options.  Acknowledge the warning, and repeat for each user.
  10. Restart Exchange setup.

Monday, August 27, 2012

Re-create BITS and Windows Update Services for Windows 7

So, you had a bit of nasty malware.  You're almost back to square one, but have now found yourself in the unfortunate position of having missing services--specifically the Background Intelligent Transfer Service and Windows Update services.

Never fear.  These, too, can be recreated in the event that your System Restore points are borked.  Copy/paste the commands into an elevated command prompt.

REM Recreate Windows Update / BITS Services for Windows 7
sc create BITS DisplayName= "Background Intelligent Transfer Service" binpath= "c:\windows\system32\svchost.exe -k netsvcs" Start= delayed-auto depend= EventSystem/RpcSs
sc create wuauserv DisplayName= "Windows Update" binpath= "c:\windows\system32\svchost.exe -k netsvcs" Start= delayed-auto depend= RpcSs

Sunday, August 19, 2012

Bloody Queen Mary

This is a Bloody Mary (it's technically a Caesar because of the clam juice) that will make you famous.  Or at least, a legend in your own mind.

4 1/2 oz Clamato Juice (or a 2:1 mixure of tomato:clam juice)
1 1/2 oz your favorite gin
1 tsp celery salt
1/2 tsp black pepper
1/2 tsp Tabasco sauce
1/2 tsp Lea and Perrin's Worchestershire sauce
1 drop Beano's Horseradish sauce
Juice of 1/4 lime

Combine all ingredients and shake vigorously.  Pour into a Collins or highball glass, and garnish with a deli pickle spear (don't you dare use a dill), rind of the squeezed lime, and leafy celery heart, and a couple of queen olives.

Friday, August 17, 2012

Move Wireless Network Profiles Between Computers

Ran into an interesting customer issue regarding connecting to a wireless network.  For whatever reason, this laptop can't see the wireless network (though others in the office can).  This laptop can connect to other WiFi networks without issue.

My laptop, for example, was able to connect without issue.  Solution?  Either manually create the profile or export it from my laptop.

Since I'm all about finding new and interesting ways to do things, I'd thought I'd try the "Export/Import" route.

There's a little-known gem of a feature in netsh that allows for just this.

  1. Open an elevated command prompt.
  2. Type netsh wlan show profiles and press [ENTER].
    - The output should look something like this:

    C:\Windows\system32>netsh wlan show profile
    Profiles on interface Wireless Network Connection
    Group policy profiles (read only)

    User profiles
        All User Profile     : OPincGuest
        All User Profile     : antares
        All User Profile     : SparkDetroit
        All User Profile     : SecureConnect
        All User Profile     : cobo_free
        All User Profile     : Colonial 1
        All User Profile     : Team Perkis-guest
        All User Profile     : MongoNet [Working]
        All User Profile     : Inn Public
        All User Profile     : Android76
        All User Profile     : bww3
        All User Profile     : TGN
        All User Profile     : attwifi
        All User Profile     : aguilmettes-iPhone MyWi
        All User Profile     : HarborLink - Buffalo Wild Wings
        All User Profile     : milkyway
  3. Find the profile you want to export.  In this example, we're going to export my home profile, "milkyway" to a folder on the thumb drive, F:\wirelessconfig.
  4. Type netsh wlan export profile name="milkyway" folder="F:\wirelessconfig" key=clear and press [ENTER].
  5. Take the USB stick to the target computer and plug it in.  Note the drive letter.
  6. Open an elevated command prompt.
  7. Type netsh wlan add profile filename="F:\wirelessconfig\Wireless Network Connection-milkyway.xml" and press [ENTER].

Monday, July 23, 2012

Office365 Migrations and the legacyExchangeDN

I ran across this problem for a customer and thought I would share my experience/resolution.

Migration Scenario:
- Customer runs Exchange 2003 environment and RPC/HTTP is non-functional for the migration
- Using 3rd-party tools to migrate accounts
- When an internal user replies to messages from another internal user prior to migration, the sender receives an NDR with the X400 address of the legacy Exchange system

Tools required:
- ADFind (
- Microsoft Online Services PowerShell Module
- Text editor

1.     Run ADFIND on the customer's server.  This is the syntax I used:
adfind -csv -h -b "" -f "objectClass=user" -nodn mail legacyexchangedn > userlist.csv

2.     Clean up the email addresses in the userlist.csv file (to make sure they match the Office 365 addresses).
3.     Connect to the Office 365 tenant using PowerShell.
4.     Run the following script:

$csv = import-csv .\userlist.csv -header Username
foreach ($line in $csv)
    $user=Get-Mailbox -Identity $line.Username
    Set-Mailbox -Identity $line.Username -EmailAddresses $user.EmailAddresses

Let me know if this helped you out by leaving a comment.


Wednesday, May 23, 2012

Office 365 DirSync Setup Error 1603

During your journey of Office 365 nirvana, you may decide to install DirSync (or, as the setup window title more verbosely describes it, "Microsoft Online Services Directory Synchronization"). So, you spin up a new Windows Server 2008 R2 VM, join it to your domain, and, start the setup.

And then it happens.

ErrorCoexistence MSI installation failed. msiexec returned 1603 Unable to uninstall the Microsoft Online Services Directory Synchronization tool. Use the Control Panel to remove the Directory Synchronization tool.

What the heck?

Oh, you must have forgotten to install the .NET Framework 3.5.1 Features feature.  How silly of you.

You know what to do.

More MD3000i Trickery

Tonight I found myself recovering a VM on a Windows 2008 R2 cluster connected to an MD3000i SAN.  To make very long and painful story short, it appears that someone applied a series of Windows Updates and then a Dell DSM update that screwed up the multipathing.

In the end, I resorted to breaking the cluster and then mounting the LUNs.  Most of the VMs I kept on one server, but I wanted to move a handful to what used to be the other node of the cluster.  However, when reassigning the LUN in the MD Client to another host, I received an error that there was already a persistent reservation on the volume and that I should talk to my administrator.

In order to free the SCSI-3 reservation on the LUN, I had to run this command:

smcli -n -c "clear virtualDisk [\"virtualDiskName\"] reservations

After that, I was able to successfully re-assign the LUN.

Monday, April 2, 2012

Quick-n-Dirty User Management for Office 365 Hybrid Deployments

Over the past several months, we have deployed Office 365 to dozens of organizations. Several of the larger environments have asked for integration between the on-premise Active Directory environment and the Office 365 environment. For this, Microsoft has provided a roadmap using Active Directory Federation Services (ADFS) and Directory Synchronization (DirSync). This is a great solution for end users, but can be onerous for the system administrator--especially if the customer has been migrated from Exchange 2003.

When running in any sort of Hybrid mode (or having transitioned from Exchange 2003 on-premise), there are two attributes that need to be updated/maintained with the on-premise AD in order to keep things moving along:

- proxyAddresses
- targetAddress

The proxyAddresses multi-valued attribute is used to store all of the various addresses that are bound to a user. These include (but are not limited to) SMTP and X.400 addresses. In an on-premise Exchange environment, this attribute is used to store the addresses assigned by various recipient policies.

The targetAddress attribute stores the unique "" address assigned to each user. During a transition, mail intended for the address skips local mailbox delivery and is automatically forwarded to the address stored in this attribute. If the local Exchange server is kept on-line for local SMTP routing, these attributes *must* be populated for each new user, otherwise mail delivery to them from on-premise services utilizing the Exchange environment will fail.

To work around this, I've put together a very low-end script utilizing the Quest ActiveRoles cmdlets. You will need to install these on either a workstation or server in your environment and then then save the follwing script as a .ps1 file (replacing the placeholders with your own) on the same computer where you have installed the ActiveRoles PowerShell environment.

Write-Host "Please enter the Active Directory ID of the user to update:"
$SamID = Read-Host
$PrimaryDomain = ""
$SecondaryDomain = ""
$Office365Domain = ""

Get-QADuser $SamID Set-QADUser -ObjectAttributes @{targetaddress="SMTP$SamID@$Office365Domain"}
Get-QADUser $SamID Add-QADProxyAddress -Address $SamID@PrimaryDomain -Primary
Get-QADUser $SamID Add-QADProxyAddress -Address $SamID@SecondaryDomain
Get-QADUser $SamID Add-QADProxyAddress -Address $SamID@Office365Domain

Tuesday, February 7, 2012

Boot from VHD is Wicked Awesome

Boot from VHD is a great technology that enables you to host multiple self-contained operating systems on a single hard drive. Similar to dual-booting, but you don't have to worry about installing applications over each other or overwriting program file updates because your secondary OS is fully contained within a single virtual hard disk file.

As someone who spends a lot of time at customer sites, I find this invaluable to maintaining a clean, portable secondary environment. My boot-from-vhd enviornment can be joined/disjoined from customer domains without affecting my corporate laptop build; I can run beta apps and install troubleshooting tools without jeopardizing the stability of my daily work computer.

For my installation, I'm using Windows 7 Ultimate as my primary host computer and will install Windows 2008 R2 inside my VM environment.

- Windows Automated Install Kit (necessary for ImageX)
- Windows 2008 R2 Physical Media (or ISO + utility such as Virtual CloneDrive to mount it)

Now, some of you will probaby grumble about needing to download the whole 1.3GB+ WAIK package for less than 1MB of software necessary to perform this task. It does seem ridiculous, that Microsoft has not made it available separately for this specific purpose (and, since WAIK is a free download, most people don't see why you can't just get the tools you need out of it). If you search around, you can find the ImageX pieces available, such as here or here.

If you want to install just the ImageX componets, you need:
- imagex.exe
- intlcfg.exe
- vsp1cln.exe
- wimfltr.inf
- wimfltr.sys
- wimgapi.dll

Extract the files from such a download to C:\Windows\System32; copy wimfltr.sys to C:\Windows\System32\drivers, and then right-click > Install on wimfltr.inf.

Alternatively, download and install WAIK.

Moving on ...

Create a Directory to Store VHDs
  1. From Windows Explorer, create a new directory (I used C:\VHD).
  2. Yep, that's it.

Create a VHD
  1. On the start menu, click Start, type in cmd, and then press Ctrl+Shift+Enter to start an Elevated Command Prompt. right-click Computer, and then click Manage.
  2. In the User Account Control dialog box, click Yes.
  3. Type compmgmt.msc and press Enter.
  4. In the left pane of the Computer Management console, click Disk Management.
  5. In the right pane, click More Actions, and then click Create VHD.
  6. On the Create and attach Virtual Hard Disk page, specify the location as C:\VHD\Windows2008R2.vhd, the virtual hard disk size as at 50GB, and then set the virtual hard disk format to Fixed or Dynamically expanding (depending on your preference). If it's not something you're going to use often, you can use a Dynamically Expanding VHD to save space. If you choose Fixed, you're going to have to wait for the entire 50GB (or whatever size file it is) VHD to be formatted.
  7. Click OK.
  8. In Disk Management, right-click the newly-created 50 GB disk, and then select Initialize Disk.
  9. On the Initialize Disk page, verify that the VHD is selected. Choose MBR as the partition style, and then click OK.
  10. Once the disk is initialized, right-click the unallocated space of the disk, and then select New Simple Volume.
  11. When the Welcome to the New Simple Volume Wizard starts, click Next.
  12. On the Specify Volume Size page, leave the default values to use the entire disk, and then click Next.
  13. In the Assign Drive Letter or Path list, choose an unused drive letter (I chose V:), and then click Next.
  14. Under Format this volume with the following settings, specify NTFS for the file system, use the default Allocation unit size, specify a volume name Next.
  15. On the Completing the New Simple Volume Wizard page, click Finish.

Mount the Windows Server 2008 R2 Media (If Necessary)

This example uses Slysoft Virtual CloneDrive

  1. Navigate to the folder where you have downloaded the Windows 2008 R2 media.
  2. Right-click the ISO file, and then select Mount (Virtual CloneDrive E:), where E: is the virtual DVD-ROM letter. Mine just so happens to be E:.

Apply the Windows Server 2008 R2 Image to the VHD

  1. Go back to your Elevated Command Prompt (or launch a new one).
  2. Run the following command to determine which Windows Server edition you wish to use:
    dism /Get-Wiminfo /Wimfile:"E:\Sources\install.wim"
  3. Select an index number that corresponds to the edition that you wish to install. In my case, I chose Index 3.
  4. Run the following command to apply the installation image in the appropriate index to the VHD that is currently mounted as V:\:
    imagex /apply "E:\Sources\install.wim" 3 v:

Update the Boot Configuration Data

We'll use BCDEdit /copy to use the current boot configuration entry as the starting point for our new entry.

  1. Run the following command from your Elevated Command Prompt:
    bcdedit /copy {current} /d "Windows 2008 R2 VHD Boot"
  2. Copy the newly-created GUID to the clipboard.
  3. Run the following commands (using the new GUID) to instruct the Boot Manager where to look for the VHD:
    bcdedit /set {enter-new-GUID-here} device vhd="[locate]\VHD\Windows2008R2.vhd”
    bcdedit /set {enter-new-GUID-here} osdevice vhd="[locate]\VHD\Windows2008R2.vhd”
  4. Run the following command to force hardware detection during the initial boot:
    bcdedit /set {enter-new-GUID-here} detecthal yes
  5. Close the elevated command prompt.

Detach VHD

  1. In Disk Management, right-click the disk that is the mounted VHD, and then click Detach VHD.
  2. On the Detach Virtual Hard Disk page, ensure that the Delete the virtual hard disk file after removing the disk check box is NOT selected, and then click OK.
  3. Close the Computer Management console.