Category filter
Script to set up Printers on macOS devices
Deploying network printers on managed macOS devices is a two-step procedure using scripts. Initially, administrators can use the configuration settings of the printer connected to a wireless network to create scripts. Then, execute these scripts from the Hexnode console to complete the deployment of Wi-Fi/network/Bluetooth printers to Mac.
Deploy printers on Mac
1 2 3 |
#!/bin/bash lpadmin -p <destination> -E -D <destination> -v <device_uri> -m everywhere |
-p
specifies the name of the printer
-E
enables the printer and accepts jobs
-D
sets the system default destination
-v device_uri
specifies the device URI for the printer
-m
everywhere indicates that the printer is compatible with IPP everywhere
You can also define other printer settings to be applied on macOS devices using the lpadmin command. Type in the command lpadmin in the Terminal to retrieve its entire attribute list.
The value listed along with the printer-info corresponds to the destination. The device_uri will be displayed next to the key device-uri.
Remove printers from Mac
1 2 3 |
#!/bin/bash lpadmin -x <destination> |
-x destination
specifies the printer destination to be removed from the device.