Thursday, December 14, 2017

Surviving a botched Windows update: recover your Outlook profiles

I returned from a client meeting and saw a required reboot after a Windows 10 or Office 2016 Update (I'm not sure which).  After the reboot, the Windows startup said the boot drive was inaccessible.  After spending a half day trying to recover, I gave up and "recovered Windows 10."  Of course that meant I lost every installed application on my hard drive.  Recover kept my user files.  Fortunately most are stored on a different drive and on Sumatra's SAN and cloud drives.

The hardest part was recovering my Outlook Profile -- i was not looking forward to re-entering all of the credentials for my various email accounts.  Windows moved the old windows to a new folder "Windows.Old"  found my old registry hive, and was able to extract the Outlook Profile.

Here's the steps.   Thanks to JRich from Mass General for blog post that pointed me in the right direction!!

In Powershell, run as the administrator:
1. Use the REG command to load the "old hive" into your registry under the HK Local Machine

reg load 'HKLM\_OldOutlook' "C:\Windows.old\Users\riuliano\NTUSER.DAT"

2. Open RegEdit navigate to Outlook, i.e.
HKEY_Local_Machine\_OldOutlook\Software\Microsoft\Office\16.0\Outlook\

3. In Regedit, right-click on "Profiles" and Export the file

4. Edit the exported profile file, and replace "Hkey_Local_Machine\_OldOutlook" with "HKey_Current_User\".  Save the file

5. Back in RegEdit, Import the "reg" file you just edited.

6. Back in Powershell, remove the registry key and garbage collect.
reg unload hklm\OldOutlook

[gc]::collect()

That's IT!



BTW, if you want to see what the director looks like in powershell, you can create a virtual directory of the old hive:
New-PSDrive -Name OldOutlook -PSProvider Registry -Root "HKLM\_OldOutlook"

then you can "cd OldOutlook:"
and get-item and value.  I'm sure i could have looped through and copied each profile key from the old hive to the new hive.  Export seemed much simpler, though.

Remember to remove the PSDrive:
Remove-PSDrive OldOutlook


No comments: