Answer the question
In order to leave comments, you need to log in
How to change print permissions via PowerShell Script?
I have 25 Windows Server 2012r2 terminal servers, periodically change printers and have to add new printers, and this work is dreary to say the least)
I solved this problem with a PowerShell script that adds printers in all servers, I don’t understand how to implement printing rights in the script and changing the document for users.
Script
Answer the question
In order to leave comments, you need to log in
I found a very simple solution using the SetACL.exe utility.
The commands below give the user the right to print and manage a document and delete Everyone.
SetACL.exe -on "\\servername\printname" -ot prn -actn ace -ace "n:domain\user;p:print,man_docs"
SetACL.exe -on "\\servername\printname" -ot prn -actn trustee -trst "n1:Everyone;ta:remtrst;w:dacl,sacl" -rec cont_obj -ignoreerr
wmi:
GetSecurityDescriptor()
SetSecurityDescriptor()
But there, if you construct these descriptors yourself, it turns out very muddy. It is possible, but difficult :)
I would suggest using the
PowerShellAccessControl module or something similar
. True, I have not tried it myself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question