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!