0

I work for a company that has approximately 3,000 PC's and approximately 1,500 printers. Currently the method to install a printer is rather manual, and we're looking at automating the process. There are certain restrictions that apply to this question:

  • Must work on Windows 7 and Windows 10
  • Solution cannot be a print server

Apart from that, I have a few personal preferences as to the solution:

  • Preferably does not require administrative rights to the PC
  • Preferably can be managed remotely, i.e. a change to a printer model can be replicated to all users on the domain
  • Preferably little scripting needed, as we plan on getting end users to operate this tool.

The current process we're using is to run the following command (or creating a batch script), but this is definitely not a valid solution:

rundll32 printui.dll,PrintUIEntry /ia /m "Kyocera FS-4100DN KX" /f "\\share\xfer\PRTscript\_drivers\KXDriver\32bit\OEMsetup.inf"

This is not a valid solution as:

  1. We can not replicate changes to the clients (unless we house the 'script' on a share
  2. It requires administrative rights to install the printers
  3. It is a manual task, and fails to distinguish 32 from 64 bit (or at least, it must cater for both)

Now, I know we can use Group Policies option to deploy printers, but that is reliant on two things:

  1. The OU of the business (or at least, security group) being correct and;
  2. The PC's in question are getting Group Policy (they should)

And yes, I know Group Policy matches all my requirements AND preferences, but I just want to look at my options before needing to tidy up my OU (and sub-ou, security groups and existing policies) - in the end GPO would be the wisest solution, but I want a short-term tool whilst I work on this.

So perhaps, I thought, we could use a simple Visual Basic Script - but again, this requires a lot of manual editing and the only way I can think to automate this would be to deploy via Group Policy:

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\Server\Printer"
PrinterDriver = "PrinterDriver"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\Server\Printer"

The next theory I can rule out would be to use PrintBRM

  • So in essence you're looking for an enterprise solution without using any enterprise tools. With those restrictions you should start coding an application for your end users. – Seth Dec 28 '16 at 8:38
1

https://drive.google.com/open?id=0ByhxkwJBdusDczU2MXhrYldfLUU

cscript printer.vbs -u ad\username -w <password> -s <computer name>
cscript printer.vbs -u ad\username -w <password> -s <computer name>
cscript printer.vbs -u ad\username -w <password> -s <computer name>
cscript printer.vbs -u ad\username -w <password> -s <computer name>

The point of this script is to install a printer on a remote computer(s) without visiting the location.

I usually make a list of 25 and copy, paste them into an administrative command window and let them run.

Referring to #3 above 32/64 bit. My script assume 64 bit, and if that fails then it falls back to 32 bit install.

Installing a printer is going to need admin rights, better you do it then allow a user to do it.

To prevent errors, I delete any existing printer/port with the same name and recreate it.

The username and password are domain credentials, not local. Maybe this will give you a starting point. You may have to modify the code so you can add the printer driver info from the command line. I have mainly the same printer so I hard coded it. Also the printer name itself could be made a parameter, I just never did it.

I just tweaked the code.

cscript printer.vbs -p "Printer Name" -d "HP Universal Printing PS (v6.0.0)" -i "prnhp001.inf" -h "\\<server>\drivers\Printer\prnhp001" -u ad\username -w <password> -s <computer name>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.