Need to swap print servers

I have two print servers - PS2 which is replacing PS1

Print queue names are the same on both print servers.

There are about 25 users that are printing to the queue on PS1 and I would like to script a two-step Print Server swap that will, on each user’s machine:

Remove PS1\Queue1
Add PS2\Queue1

I am testing this using a laptop that is typical of those out on the network and would like to do this by running the script against the remote computer from a Util server where I log in with my admin account.

Using this from my Util server:

remove-printer -name \\PS1\Queue1 -computername mytestlaptop

I get error says that:

no MSFT_Printer objects found with property ‘Name’ equal to ‘\PS1\Queue1’

Running Powershell locally on my test laptop, I can add a print queue using
add-printer -connectionName \\PS1\Queue2

it appears in my Printers & Scanners listing, AND I can remove it with this

remove-printer -name \\PS1\Queue2

BUT, If I add the same print queue using the “Add device” button in Printers & Scanners, I can’t remove it - except in the Printers & Scanners tool.

Could be I’m just on the completely wrong track. Can anyone suggest a good way to “swap” the print servers?

Ideally, I’d like to run the script from the Util server and change configuration on remote computer. If I have to log onto each machine and run my script locally, that’s not a show-stopper since there are only a handful to fix.

Have you thought about using GPO to move the users to the new print server ? I would at least google that option.

Thanks for the reply, Tony. GPO is not in the mix for this task, it takes too much in the way of Change Control and associated red tape here for such a small group. GPO would be a solution if it was all 2000+ users.

I may just have to bite the proverbial bullet and remote into each workstation to swap it out. Biggest pain in that is getting 25 folks to coordinate with me so I’m minimizing interruption.

I appreciate your input.

When I last had to switch out a print server, I took the lazy way out - I shut down the old print server and renamed the new one to the old server’s name

If renaming isn’t an option, shutting down the old one and setting up a DNS alias would work too

It sounds like the printers are installed for the user, not the computer. I’d try running those commands as a user specifically. If it works, you could use a login script to accomplish the task.

Yes, Doug, you are correct. The best solution has been to coordinate a TeamViewer session and run the following in Powershell under the user’s profile:

$printr = den-superv-xerox
remove-printer -name \\den-ps1-vm\$printr
start-sleep -s 5
add-printer -connectionName \\den-ps2-vm\$printr
start-sleep -s 5
wmic printer get name

Process is to update the first line in my OneNote page with the printer that needs changing on the current user.

  • Copy the PS code from OneNote
  • Log in to user’s machine
  • Open Powershell
  • Paste into Powershell
  • Confirm the printer list looks right
  • Close Powershell and be on my merry way.

Just a bit more tedious than I was hoping, but I got good cooperation from the userlist and am down to waiting on response from the last five.

Thanks for the input, everybody!

Yo Darwin. That’s a decent approach. Show-stopper here is all the naming stuff was done before I got drafted to finish up the mess.

Got it worked out as you can see below (or above however it shows up)

Thanks for your input!

1 Like