powershell question – print related

by Jan 30, 2018

Hello. I am a powershell n00b

I would like to have a powershell script that would perform the following:

– audit all print queues on a server and list the network security groups

– list all print queues that have the everyone group

– list all print queues that DO NOT have the everyone group

– output that information to a csv file with server, queue name, everyone group YES / NO

– remove the everyone group from a subset of the output (manually filtered is ok)

– create a log of what queues the everyone group was removed from

– output the log to a csv file with server, queue name, everyone group removed YES / NO

Ideally I would be able to run this from my management server against all of my print servers so being able to use a servers.txt file would be important.

Some of our customers require that the everyone group is removed from some print queues for security reasons. We have 24 print servers and thousands of queues.

I have hacked together a few powershell scripts before but being able to audit then list then change (remove) in bulk the everyone group is beyond my skills. I am researching and trying to learn but as always I am under pressure to come up with this script yesterday.

If anyone has any sample code I could edit or any suggestions on building the script that would be awesome.