If you’ve ever tried installing a printer on Server Core 2008, chances are you’ve probably come across an error when using Print Management (printmanagement.msc) to remotely manage your Server Core install and add your printer. It looks like it’s going to work fine, but then just before it finishes, you get this…
Unable to install <printer name>, Type 3 – User Mode, <architecture> driver. Operation could not be completed (error 0x800f0247).
And then you might also get this…
Failed to add driver. Operation could not be completed (error 0x00000578).
When you try installing this same printer and driver on a GUI machine, it installs without any problems, so you can safely say it’s a Server Core issue.
As you’d expect, the first step would be to lookup the error code… So we have errors 0x800f0247 and 0x00000578.
Converting these codes from hexidecimal to decimal gives us errors 2148467271 and 1400 respectively. The first one is bogus, as it’s out of range, however error code 1400 translates as ERROR_INVALID_WINDOW_HANDLE.
The issue is the fact that Server Core isn’t handling the unsigned drivers by giving the Print Management console information to prompt the user to confirm the installation of the driver, hence the driver fails to install.
To get around this issue, we can pre-install the required drivers from the command line of the Server Core machine, by passing a call to the PrintUI.dll (which luckily is still used for the Server Core printing engine) – You could also theoretically use the prndrvr.vbs file which can be found in %SYSTEMROOT%\System32\Printing_Admin_Scripts\en-us however it seems that it also cannot handle the prompting of the unsigned driver installation either, and because it only passes calls through to PrintUI.dll anyway, we may as well use it directly.
So create a directory called C:\Temp and copy your printer driver folder to this location on your Server Core machine.
Then, from the command prompt of your Server Core machine, use the following syntax…
start /w rundll32 PrintUI.dll,PrintUIEntry /ia /K /m “<driver name>” /h “<architecture>” /v 3 /f “<driver inf file>”
Here is a breakdown of the above command…
- The start /w command will hold the command prompt until the command has finished;
- rundll32 is the process we use to invoke PrintUI.dll;
- ,PrintUIEntry tells rundll32 that we want to use this entry point in PrintUI.dll;
- /ia tells the PrintUI.dll that we want to install a printer driver using an inf file;
- /K (must be capital!) allows us to specificy a numerical value for /v;
- /m is where you provide the name of the driver (in my case “Samsung CLX-3160 Series”) – You can get this by looking inside the inf file for your driver;
- /h is where you provide the architecture for the driver, as “Windows NT x86” for 32-bit architecture, “x64” for 64-bit architecture and “IA64” for Itanium architecture;
- /v specifies that the driver is used for Windows XP or later
- /f is the location to the driver .inf file (which you should have copied to C:\Temp)
So for example, my command looked like this…
start /w rundll32 PrintUI.dll,PrintUIEntry /ia /K /m “Samsung CLX-3160 Series” /h “Windows NT x86” /v 3 /f “C:\Temp\Samsung CLX-3160 Series\driver\sugi1.inf”
After running this command, you get a red unsigned driver warning screen, which you can now accept to install the driver.
When you refresh the Drivers node in Print Management on your GUI machine, you’ll see your new driver listed. You can now go ahead and deploy your printer, however note that if you are running x64 of Server Core 2008 you’ll need to install the x64 driver before you can add the printer (otherwise you won’t be able to select your installed driver during the printer add process).
You can also delete the folders you copied in to C:\Temp now, because the drivers have been copied to their permanent location.