Support Center

(Windows) Commands Tab Policy - Adding a Printer

Summary


Using the Commands Tab, many administrative users will deploy scripts and commands to further their ability for systems management using JumpCloud.  In working with a varied audience of users and environments, we have collaborated to create some "Policy" commands for purposes ranging from security to software management.

The command listed in this article is specific to deploying an application shortcut to an existing user's desktop on a Windows system.


Considerations


When utilizing Windows, you have the ability to decide if you would like to run the command execution via either PowerShell or CMD.  Some commands will require that one or the other be specified.  With the Disable Guest Login example, you can execute using either Windows Powershell or CMD.  Note the following when wanting to switch between Windows PowerShell and CMD:
  • Select the Windows PowerShell option for PowerShell
  • Unselect the Windows PowerShell option for CMD
  

Execution


Windows (CMD or PowerShell)


The following command examples will allow for adding a network printer. Note that in the CMD example, the driver was uploaded to C:\Windows\Temp using the Files portion of the Command runner.  There is a 1MB file size limit for file attachments, so if the printer driver is larger it may be advisable to put it onto a network location for access.  

Using PowerShell:

C:\> Add-Printer -ConnectionName \\printServer\printerName

NOTE: Depending on your configuration, you may also need to specify the -Name, -DriverName, and/or -PortName of the printer as well. To find this information, you may use the Get-Printer cmdlet on a computer/server on which the printer has already been installed.

 

Using CMD:

cscript c:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_PRINTER_IP_ADDRESS -h PRINTER_IP_ADDRESS´╗┐
printui.exe /if /b "PRINTER_MODEL" /f C:\Windows\Temp\Printer_Driver.inf /u /r "IP_PRINTER_IP_ADDRESS" /m "PRINTER_DRIVER_NAME"

Example:

cscript c:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_192.168.0.5 -h 192.168.0.5
printui.exe /if /b "HP Laser 8850" /f C:\Windows\Temp\hplaser8850.inf /u /r IP_192.168.0.5 /m "HP Laser 8850"


Please feel free to reference the following Microsoft articles that provide reference for all the commands used:

Add-Printer Cmdlet
Prnport.vbs
Rundll32 printui.dll,PrintUIEntry
 
 

Last Updated: May 03, 2018 04:41PM MDT

Related Articles
desk-forwarding@jumpcloud.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete