Adjusting local printer ACL

So I have an environment of Windows 7 SP 1 clients.  I am trying to script the following:

1.) Find any local printers using USB* or LPT* ports or Bluetooth, Wireless etc.

2.) Change the printers ACL to deny printing for the locally logged on user.

I have identified the method when to implement the script.  I am just having a hard time with the permissions portion of the script? Unfortunate, I can't use the Get-Printer cmdlet see how they are Windows 7 clients.  I have had some success with the Get-WmiObject cmdlt to find the info for my first requirement:

Get-WmiObject win32_printer | where-object {($._Portname -ilike "USB*") -and ($_.local -eq $true)}  

I just need to find a way to pipe the results to a foreach loop to change the ACL?  I found the following blog recently and am attempting to work through it.

http://translate.google.com/translate?prev=hp&hl=en&u=http%3A%2F%2Fwww.sysadmins.lv%2FPermaLink%2Cguid%2C22c0550d-0c46-44ca-97ce-2b0bccbb51de.aspx&sl=ru&tl=en

Any help would be appreciated!

April 22nd, 2015 5:28pm

Thanks for the respone and link JRV! Unfortunately, I can't use the Get-Printer cmdlt, I am working w/ Windows 7 clients and it is only available on Windows 8 and 2012.
April 22nd, 2015 6:27pm

Hi BigSkyTech,

To set printer permission on Windows 7, please refer to the cmd "SUBINACL":

foreach($Printer in $shareList)
{ 
 &$shSubinACL /printer $Printer.name /grant=DOMAIN\PrintUsers_Group=p 
} 

Refer to:

How can i set permissions on printers in a 2008 R2 cluster?  (Command Line)

Powershell Batch Creation of Printers

If there is anything else regarding this issue, please feel free to post back.

Best Regards,

Anna Wang

April 23rd, 2015 5:10am

Ann, and jrv thanks for the responses!  I plan on working through the solutions you provided and will update on results.

Thanks,

Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 10:34am

Ann, Thanks! the SubinACL utility will work nicely!  JVC, Thanks for your help I am sure given time I could have gotten your solution to work as well.
April 23rd, 2015 12:04pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics