Hi all.
I'm currently looking for a solution for the following scenario:
We have a Windows 2008 R2 print server with many virtual printers. If there is an incident I would like to have a script which changes the port of this printer to another one, so the print jobs are being printed there instead. And if the printer has been repaired I'd like to change back.
Basically the script should ask for the printer name and the destination port.
What I've found on technet is this:
https://technet.microsoft.com/en-us/library/cc725868(v=ws.11).aspx
(Prnmngr.vbs)
The help shows up as following:
Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Usage: prnmngr [-adxgtl?][c] [-s server][-p printer][-m driver model] [-r port][-u user name][-w password] Arguments: -a - add local printer -ac - add printer connection -d - delete printer -g - get the default printer -l - list printers -m - driver model -p - printer name -r - port name -s - server name -t - set the default printer -u - user name -w - password -x - delete all printers -xc - delete all printer connections -xo - delete all local printers -? - display command usage Examples: prnmngr -a -p "printer" -m "driver" -r "lpt1:" prnmngr -d -p "printer" -s server prnmngr -ac -p "\\server\printer" prnmngr -d -p "\\server\printer" prnmngr -x -s server prnmngr -xo prnmngr -l -s server prnmngr -g prnmngr -t -p "\\server\printer"
So I've tried like this:
Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs -ac -p "Accounting01" -r "accounting02.printers.domain.local"
And get back the following error:
Unable to add printer connection Win32 error code 123
So, my first question is: What's wrong? Without the -ac argument the help screen is showing up.
Thanks and best regards