In all of my brilliant wisdom, I thought it would be a wise idea to remove the Microsoft XPS Document Writer from all of my machines.

Why did I do this? Well – three years ago, I had a site that switched to Windows 7. A common complaint was that their default printer would sometimes change to the XPS document writer and the user didn’t know where that printer was located. It was useless to explain that it was a “fictional” printer so I did the logical thing and deleted the printer using Group Policy Preferences. Boy was I dumb! Until now, I thought I was stuck with that change.

Why was I so dumb? Well, now users want to be able to create XPS documents instead of PDF documents. I tried (and failed) to change it to a create preference. Even though the printer driver was still on the machine, a Printer Preference requires a remote printer to connect to. Knowing this, I tried to share the XPS printer on another machine. Sadly, that type of printer could not be shared.

Just when I was about to put that project on hold, I thought about PowerShell.

I took a look at the help file for Add-Printer. The first example was:

So in a single line, I was able to add the printer back automatically!! Now I can use Group Policy Shutdown Scripts to reinstall this printer. In the future, I won’t remove something unless I am sure I can add it back. Lesson learned!

If Group Policies are not used or not available:
This is what I just did on a 2008 server:

Go through the regular motion of adding a printer with the wizard:
– add local printer
– use existing port “XPSPort”
– Select Manufacturer Microsoft, then the XPS Doc. Writer printer.
Then finish up with the wizard as usual.