Disable Printer Sharing when deploying printers via Casper

In my line of work, I always look for ways to make the lives of my users as simple as possible when it comes to the use of the technology I provide them with.

As such, one of my project was to roll out printers via Self Service in Casper but the caveat was that after adding the printer, it enabled the printer for sharing by default.

Screen Shot 2014-09-10 at 4.31.54 PM

Screen Shot 2014-09-10 at 4.31.41 PM

While the Printer Sharing is still off under the Sharing tab, it only takes one user to turn it on and it would chaos.

The fix was this command line which needed to be typed after the printer was added

 lpadmin -p <printer_name> -o printer-is-shared=false where <printer_name> is the name of the printer

To implement this in Casper I used the Files and Processes option when making a policy

The last option within Files and Processes is Execute command, so you would paste the command into the field and once your printer is installed, the command will execute and remove the sharing on that printer only.

Screen Shot 2014-09-10 at 4.46.20 PM

The following command will however remove sharing on all printers installed

lpstat -p | awk ‘{print $2}’| xargs -I{} lpadmin -p {} -o printer-is-shared=false

While you can add printers via Command line/ script, this is much simpler to deploy.

Screen Shot 2014-09-10 at 4.52.05 PM

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s