Technically Speaking

June 11, 2009

Using Powershell and Subinacl.exe to Permission Printers

Filed under: PowerShell — Chris @ 3:42 pm
Tags: , ,

Hi Folks ,

 

I was given a task at work to add a global group to 100’s of printer queue’s . I knew I wanted to use powershell to do this task but was unsure how to permission printers . I came across this utility (Subinacl.exe) that I knew about but didn’t think it permissioned printer queue’s . It took just one line to accomplish this task . In minutes I permssioned 100’s of queue’s and my manager was very happy with the result .

So here is the one line :

gwmi -class Win32_Printer -comp ServerName | % { $_.Name} | % { subinacl.exe /printer \\ServerName\$_ /grant=DomainName\GroupName=F}

F means Full Control…

You can also use M for Manage Documents or P for Print .

This is a good example also of Powershell’s ability to work with command line utilities .

I thought this was cool and a super time saver . If you have any questions please comment below and I will respond pronto :)

Thanks

Chris

1 Comment »

  1. [...] How to use PowerShell and Subinacl.exe to permission printers [...]

    Pingback by Episode 74 – Devfarm Software talks PowerWF « PowerScripting Podcast — June 19, 2009 @ 9:30 pm


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.