How to recover a ‘disassociated’ Windows NT user account’s files and settings into a new profile when the SAM ID is no longer valid on the machine or domain

System Requirements:

  • Windows Vista
  • Windows Server 2008, R2
  • Windows 7

The Problem:

Take the hypothetical situation: Windows 7 fails to boot, you don’t want to lose your user data so you install 7 onto a clean partition. However your old user profile is associated with the random SAM ID from the old installation and the new Windows installation cannot mount the profile. You can copy your data files back over, but you really don’t want to configure the start menu settings for the 1,000,000th time.

Or how about: Your only domain controller failed leaving disassociated roaming profiles on a roaming profile share and you want to recover as much of the user settings and data as possible for use on the newly build AD forest. <– That actually happened to Matt, hence I day dreamed this up.

More Information:

NT user accounts are associated to a Security Account Manager (SAM) ID. The SAM ID is Windows’s SAM or the Active Directory domain user services way of identifying a user, in effect the SAM ID is a super key that identifies a user account on a windows system, acting as a GUID for that profile.

The user name itself is irrelevant and plays no part in identifying the user account apart from being used to performing a reverse lookup to get to the SAM ID, on which Windows bases its logon activities and security token generation in AD.

When you reinstall Windows, the new installation has no awareness of any of the accounts, so if you copy the profiles back into the Windows users directory you will be unable to re-associate that profile with the local SAM database.

The Fix

The simplest way of restoring user data and crucially environment settings (such as desktop wallpaper, window settings and the like) is to follow this process:

  1. Create a new user account for the user you want to migrate onto the new domain/installation
  2. Set the accounts roaming profile settings (if dealing with a roaming profile)
  3. Logon to the machine with Administrator rights
  4. Load Regedit
  5. Click on HKEY_USERS
  6. From the File menu, select Load Hive…
  7. Browse to the NTUser.dat from the previous install/roaming profile for the profile that you are trying to recover and click OK e.g.
    d:\rescued_users\Matt\NTUser.dat
  8. When prompted for a name just enter temp and click OK
  9. Expand and click on:
    HKEY_USERS\temp
  10. From File select export and save the export file as:
    c:\temp.reg
  11. From File, select Unload Hive…
  12. Exit Regedit
  13. Open c:\temp.reg
  14. From the Edit menu select Replace…
  15. In Find What: enter:
    HKEY_USERS\temp
    In Replace With: enter:
    HKEY_CURRENT_USER
    Press Replace All
  16. Save the reg file and exit notepad
  17. Log off of Administrator
  18. Log on as the new user
  19. Double click on c:\temp.reg and import the reg file into the new (completely default) user account. If you are using a system with UAC you will need to import the reg file using an administrators account.
  20. Immediately log off
  21. Log back in as Administrator
  22. Go to the recovered profile folder e.g.
    d:\rescued_users\matt\
  23. Select all files in the folder apart from NTUser.dat, NTUser.ini and NTUser.dat.log and copy them
  24. Paste the data into the new user profile e.g.
    c:\users\matt
  25. The data and the profile settings have now been recovered. Logging back in as the recovered user will restore much of the user profile and all of their data.

Note: It may be necessary to reset folder permissions and ownership on all of the files pasted into the folder to match that of the new user account.

Thanks to Matt Gillard of MGComputing for some testing of my theory.

ADODB.Connection error ‘800a0e7a’ – Provider cannot be found. It may not be properly installed

System Requirements:

  • Windows NT 4.0
  • Windows 2000
  • Windows XP (x86)
  • Windows Server 2003 (x86)
  • Windows Server 2008 (x86)
  • Windows 7 (x86)
  • Windows Server 2003 (x64)
  • Windows Vista (x64)
  • Windows 7 (x64)
  • Windows Server 2008 (x64)
  • Windows Server 2008 R2 (x64)
  • Windows Server 2012 (x64)

The Problem:

When you attempt to connect to a Microsoft Access database using the ODBC provider Microsoft.Jet.OLEDB.4.0 you receive the error message:

ADODB.Connection error ‘800a0e7a’
Provider cannot be found. It may not be properly installed./path/file.asp, line ##

 

More Information:

For x64 Systems:

The Microsoft.Jet.OLEDB.4.0 is only available as a 32-bit (x86) module. In order to use it via IIS you must change the web site to run in a 32-bit application pool.

Under IIS 7.0, 7.5 or 8.0:

  • Assuming that you will not want to use ASP .net, in the IIS console in the Application Pools section, create a no managed code, integrated application pool. If you do want to maintain access to ASP .net, select the framework version you require.
  • Once created, in its advanced settings set “Enable 32-bit Applications” to true
  • In the Basic Settings… for the web site entry you are experiencing the error on, change the Application Pool to the newly created 32-bit pool.
  • Restart the web site

In most cases where the system is running under an x64 architecture, this should fix the problem.

For x86 and x64 Systems:

We had a server down for an entire day because of this one. It was either an attempt to fix a security database fault, or an update from Microsoft Update delivered in the April 2008 patch cycle, but after the reboot for the patches, none of the JET (Access) databases on the particular server, in any IIS web would operate.

I will simply cut to the fix for you in the beginning, to expedite your likely finding of a resolution to this problem. Something had caused the service provider for the Microsoft.Jet.OLEDB.4.0 provider to become unregistered. To fix the problem issue the following command from a Command Prompt or Run:

regsvr32.exe msjetoledb40.dll

You shouldn’t need to reboot to solve the problem, it didn’t in my case. However, if nothing happens do restart before progressing to the next step.

 

Additional Steps: Step 1

Reregister the components from MDAC, JET and ADO in their entirety. Simply copy the below into a BAT file and run it.

:: ADODB.Connection error '800a0e7a'

:: Provider cannot be found. It may not be properly installed.regsvr32.exe cfgmgr32.dll -s

regsvr32.exe cliconfg.dll -s

regsvr32.exe dasetupr.dll -s

regsvr32.exe dbmsgnet.dll -s

regsvr32.exe dbmsrpcn.dll -s

regsvr32.exe dbnetlib.dll -s

regsvr32.exe dbnmpntw.dll -s

regsvr32.exe expsrv.dll -s

regsvr32.exe msadce.dll -s

regsvr32.exe msadcer.dll -s

regsvr32.exe msadcf.dll -s

regsvr32.exe msadcfr.dll -s

regsvr32.exe msadco.dll -s

regsvr32.exe msadcor.dll -s

regsvr32.exe msadcs.dll -s

regsvr32.exe msadds.dll -s

regsvr32.exe msaddsr.dll -s

regsvr32.exe msader15.dll -s

regsvr32.exe msado15.dll -s

regsvr32.exe msadomd.dll -s

regsvr32.exe msador15.dll -s

regsvr32.exe msADOX.dll -s

regsvr32.exe msadrh15.dll -s

regsvr32.exe mscpxl32.dll -s

regsvr32.exe msdadc.dll -s

regsvr32.exe msdadiag.dll -s

regsvr32.exe msdaenum.dll -s

regsvr32.exe msdaer.dll -s

regsvr32.exe msdaora.dll -s

regsvr32.exe msdaorar.dll -s

regsvr32.exe MSDAOSP.dll -s

regsvr32.exe msdaprsr.dll -s

regsvr32.exe msdaprst.dll -s

regsvr32.exe msdaps.dll -s

regsvr32.exe msdarem.dll -s

regsvr32.exe msdaremr.dll -s

regsvr32.exe msdart.dll -s

regsvr32.exe msdasc.dll -s

regsvr32.exe msdasql.dll -s

regsvr32.exe msdasqlr.dll -s

regsvr32.exe msdatl3.dll -s

regsvr32.exe msdatt.dll -s

regsvr32.exe msdaurl.dll -s

regsvr32.exe msdfmap.dll -s

regsvr32.exe msjro.dll -s

regsvr32.exe msjtes40.dll -s

regsvr32.exe msorc32r.dll -s

regsvr32.exe msorcl32.dll -s

regsvr32.exe msvcirt.dll -s

regsvr32.exe msvcrt.dll -s

regsvr32.exe mswdat10.dll -s

regsvr32.exe mswstr10.dll -s

regsvr32.exe msxactps.dll -s

regsvr32.exe msxml3.dll -s

regsvr32.exe msxml3a.dll -s

regsvr32.exe msxml3r.dll -s

regsvr32.exe mtxdm.dll -s

regsvr32.exe mtxoci.dll -s

regsvr32.exe odbc16gt.dll -s

regsvr32.exe ODBC32.dll -s

regsvr32.exe ODBC32GT.dll -s

regsvr32.exe odbcbcp.dll -s

regsvr32.exe odbcconf.dll -s

regsvr32.exe ODBCCP32.dll -s

regsvr32.exe ODBCCR32.dll -s

regsvr32.exe ODBCCU32.dll -s

regsvr32.exe ODBCINT.dll -s

regsvr32.exe ODBCTRAC.dll -s

regsvr32.exe oledb32.dll -s

regsvr32.exe oledb32a.dll -s

regsvr32.exe oledb32r.dll -s

regsvr32.exe setupapi.dll -s

regsvr32.exe sqloledb.dll -s

regsvr32.exe sqlsrv32.dll -s

regsvr32.exe sqlunirl.dll -s

regsvr32.exe sqlxmlx.dll -s

regsvr32.exe vbajet32.dll -s:: OLEdB

regsvr32.exe %SystemRoot%\System32\msjetoledb40.dll:: Jet

regsvr32.exe %SystemDrive%\Program Files\Common Files\Microsoft Shared\DAOdao360.dll -s

regsvr32.exe %SystemRoot%\System32\expsrv.dll -s

regsvr32.exe %SystemRoot%\System32\msexch40.dll -s

regsvr32.exe %SystemRoot%\System32\msexcl40.dll -s

regsvr32.exe %SystemRoot%\System32\jet500.dll -s

regsvr32.exe %SystemRoot%\System32\msjet35.dll -s

regsvr32.exe %SystemRoot%\System32\msjet40.dll -s

regsvr32.exe %SystemRoot%\System32\msjetol1.dll -s

regsvr32.exe %SystemRoot%\System32\msjint40.dll -s

regsvr32.exe %SystemRoot%\System32\msjter40.dll -s

regsvr32.exe %SystemRoot%\System32\msjtes40.dll -s

regsvr32.exe %SystemRoot%\System32\msltus40.dll -s

regsvr32.exe %SystemRoot%\System32\mspbde40.dll -s

regsvr32.exe %SystemRoot%\System32\msrd2x40.dll -s

regsvr32.exe %SystemRoot%\System32\msrd3x40.dll -s

regsvr32.exe %SystemRoot%\System32\msrepl40.dll -s

regsvr32.exe %SystemRoot%\System32\mstext40.dll -s

regsvr32.exe %SystemRoot%\System32\mswdat10.dll -s

regsvr32.exe %SystemRoot%\System32\mswstr10.dll -s

regsvr32.exe %SystemRoot%\System32\msxbde40.dll -s

regsvr32.exe %SystemRoot%\System32\spmsg.dll -s

regsvr32.exe %SystemRoot%\System32\vbajet32.dll -s

:: ADO
regsvr32.exe %SystemDrive%\Program Files\Common Files\System\ado\msader15.dll -s
regsvr32.exe %SystemDrive%\Program Files\Common Files\System\ado\msado15.dll -s
regsvr32.exe %SystemDrive%\Program Files\Common Files\System\ado\msadomd.dll -s
regsvr32.exe %SystemDrive%\Program Files\Common Files\System\ado\msador15.dll -s
regsvr32.exe %SystemDrive%\Program Files\Common Files\System\ado\msadox.dll -s
regsvr32.exe %SystemDrive%\Program Files\Common Files\System\ado\msadrh15.dll -s
regsvr32.exe %SystemDrive%\Program Files\Common Files\System\ado\msjro.dll -s

Additional Steps: Step 2

Reinstall MDAC 2.8 SP1 (Windows XP SP1 or below only). You will need to perform some registry modifications before you can reinstall MDAC as it is a protected system module.

  1. Open Regedit
  2. Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ExceptionComponents
  3. Look through each class ID for the following friendly name values. Delete the Class ID containing the matching friendly names:
    Microsoft MDAC Response Files
    Microsoft MDAC Setup Files
    Microsoft SQL Server ODBC Drivers
    Microsoft SQL Server Net Libs
    Microsoft SQL Server OLEDB Provider
    WebData Setup Exception Package
    Mdac 2.8 Exception Package
  4. Download and reinstall MDAC 2.8 SP1 from Microsoft which should reinstall in full.