Deploying a network printer painlessly

Source - Flickr, image by Nathan Wells

I searched around on the internet this morning and I couldn’t find an example of exactly what I wanted to do, but I DID figure it out, so I thought I’d post it  here in the hopes that it would be useful to others.

Here’s the situation:

  • You have a new printer on your network.
  • You’ve set up a shared printer queue on your Windows-based server, and it’s printing just fine.
  • You can connect to the shared queue from other computers, and it works alright.
  • You now want to deploy the printer to all the other Windows machines on your network, but it’s a pain in the ass to walk around to every single machine and set them up by hand.

Solution — remotely deploy the printer to your clients by means of your login script.

And here’s the magic formula:

rundll32 printui.dll,PrintUIEntry /in /b “{Printer Name}” /n\\{server}\{shared printer name}

Put that line into your login script, replace {Printer Name} with the name you’d like the printer to have on the client machines, and replace \\{server}\{shared printer name} with the correct UNC path to the printer queue on your server, and BAM, you’re done!

Now, the next time your users log in, they’ll get the new network printer automatically set up on their machines, all ready to go.

Your mileage may vary, of course, and this solution won’t work for Mac client machines.  Those you still have to touch.

Was this tip helpful?  Leave a comment and let me know!