Powershell: Adding printer permissions to all network printers


hi gurus,

i've created new sec group , provisioned management access our print server; however, these permissions have not been inherited downward printers themselves.  i'm looking script apply these permissions have not had success.  any appreciated.

the below i've found during search, not know syntax of sddl access: print, manage printers, manage documents, view server, manage server.


$printers = get-printer -computername $printservername -name bld* foreach ($printer in $printers) { set-printer -computername $printservername -name $printer.name -permissionsddl #fill in permissions here }

thanks in advance.

hi pigtaru,

to add printer permission using security definition description language (sddl), function below may helpful , adds full controll rights sddl.

add printer permission

and run function this:

$permissionsddl = get-printer -full -name test99 | select permissionsddl -expandproperty permissionsddl $newsddl = add-lhsprinterpermissionsddl -account "domain\username" -existingsddl $permissionsddl get-printer -name test99 | set-printer -permissionsddl $newsddl -verbose
hope helps.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client