Link to home
Start Free TrialLog in
Avatar of WTarlton
WTarlton

asked on

Enumerating printers on a print cluster with Powershell

Hi all,
We have a requirement to change security on every printer within our organization. Some of the print servers on our domain are in clusters and some are standalone.

On the standalone I can pull printers just fine with this WMI query:

$Printers = Get-WmiObject -class "Win32_Printer" -computername $Computer

However when I try to query a cluster I only get 1 printer returning which is the only local printer installed on that server even though there are 100's of other printers.

How can I query the printers in the cluster and modify the permissions on them?

Thanks
Avatar of x-men
x-men
Flag of Portugal image

try:

>cluster.exe <YourClusterName> RES | select-string -pattern <printerResourceType>

I'm not in place to test and give you the exact command, Monday I'll be able to give you the exact command.
mix the cluster.exe command with the Select-String cmdlet:

cluster.exe <YourClusterName> RES | Select-String -Pattern "Print Spooler"

and it will list you all the printers configured in the cluster <YourClusterName> :

Resource             Group                Node            Status


from here, you can load them into a variable and "work" them
Avatar of WTarlton
WTarlton

ASKER

Thats a pretty cool command and looks like it would work. Unfortantly it does not pull up any printer names... :/
is there a pattern to the printer resource names that are created on the cluster resources?

the command 'cluster.exe <YourClusterName> RES' will pull all the resources in the cluster, so if you can filter these resources using the 'select-string' cmdlet, you'll get your list
ASKER CERTIFIED SOLUTION
Avatar of WTarlton
WTarlton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
cool
rectifying my previous post/command...:

cluster.exe <YourClusterName> RES /prop | Select-String -Pattern "Print Spooler"