There was a customer that had been migrating printers from Windows 2003 SBS Domain Controller/Print Server to Windows 2008 and somehow in the process accidentally deleted all of the shared printers. When this happened, all printing at the company came to a halt. There were almost 20 different printers that had been deleted including all the share names, printer ports, specific settings, etc. It was going to be next to impossible to try and recreate the printers exactly as they were within a decent amount of time.
The customer had VEEAM backups of the system drive, but we decided that restoring the entire drive would most likely be a BAD idea on a Domain Controller. Our preferred plan at this point was to try and merge the printer registry keys from a backup into the current registry. From VEEAM, we restored the C:\Windows\System32\Config folder to an alternate location. This folder contains the registry files named SYSTEM, SOFTWARE, etc. TIP: If you do not have backup of the files, you may be able to find copies of registry files in C:\Windows\Repair folder. Just make sure and look at the timestamps of the modification dates to see if they might be usable. [more]
What we concluded before beginning was that local printers were stored in the registry at HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers. The actual printer shares and security settings were stored in HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Shares. At this point make sure you backup the current registry by doing an export.
Using the LOAD HIVE method in the registry, we mounted our SYSTEM file as SYSTEM_Backup under HKLM. However, the CurrentControlSet subkey was not there. Instead it only had CurrentControlSet001 and CurrentControlset003. Also, the Printers subkey was missing in both CurrentControlSet001 and 003. The reason CurrentControlSet is not there is because it is simply a pointer to CurrentControlSet001. You can verify this by looking at the HKLM\SYSTEM\Select subkey.
The main problem was that we had no idea where the Printers subkey was. I had a feeling that it was also dynamically linked from somewhere else in the registry, so I created a new printer with a unique name as a test and did a registry search. I found what appeared to be all of the printer settings in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print. Now, I went back and loaded the SOFTWARE file as SOFTWARE_Backup under HKLM. When I looked in the Print subkey, I saw all the missing printers. It appears that this location is linked with the missing Printers subkey under Control\Print.
Now to get the data we need for all the printers and the shares, I exported HKEY_LOCAL_MACHINE\SOFTWARE_Backup\Microsoft\Windows NT\CurrentVersion\Print and HKEY_LOCAL_MACHINE\SYSTEM_Backup\ControlSet001\Services\lanmanserver from the loaded registry hives. After that is done, unload the backup hives as they are no longer needed.
Right click your two exported .reg files and open with notepad. Do a replace on SOFTWARE_Backup with SOFTWARE and the same for SYSTEM_Backup with SYSTEM in the appropriate files. After that, the registry files are ready for merging. Right click the .reg file and select "Merge."
After we merged the registry files, we thought we may have to reboot to get the printers to appear, but simply restarting the Print Spool service made the printers reappear like magic.