WMI request to get clustered Print Server queues

Hi guys,

I'm working on authoring Management Pack (MP) for SCOM 2012 for Print Servers and have several questions concerning clustered Print Servers, specifically clustered Print Server queues. I would appreciate if you could shed a light on this.

Currently Print Server MP requests Print Server queues from Win32_Printer wmi branch, but this works only with non-clustered queues instances. It looks like for clustered instances I have to request another branch -  Win32_ClusterShare. The wmi request is supposed to be called on target computer (cluster node) and used to discover (and as a result to create appropriate objects in SCOM) queues instances.

So I have a bunch of questions regarding:

1. Should "select * from win32_clustershare where type='1 or 2147483649'" be requested on each cluster node or is it something common for cluster group (several cluster nodes)? 

2. Will "select * from win32_clustershare where type='1 or 2147483649'" contain enough information describing print queues on cluster / cluster node?

3. Win32_ClusterShare has two types which might be potentially used for cluster print queues discovery:

1='Print Queue'

2147483649='Print Queue Admin'

http://www.powertheshell.com/reference/wmireference/root/cimv2/win32_clustershare/

Which one should be used?

4. Is it possible that on one specific cluster node print queues information is returned by both Win32_Printer and Win32_ ClusterShare? I think, not, but would like to clarify.

5. Will requesting "select * from win32_clustershare where type='1 or 2147483649'" work for both Windows Server 2008 (R2) and Windows Server 2012 (R2)?

Im wondering this, because I found changes in print role clustering implementation.

Below is the link how to install Print Server on Windows Server 2012:

https://technet.microsoft.com/en-us/library/jj134159.aspx

In Windows Server 2008 R2 there was available Print Server Cluster Role:

https://technet.microsoft.com/en-us/library/cc771509(v=ws.10).aspx

But it looks like Print Server clustering on Windows Server 2012 is performed differently:

https://technet.microsoft.com/en-us/library/jj556311.aspx

Thanks in advance.

February 20th, 2015 11:07am

WMI does not support passing through the spooler name resource.  It's was never supported.

Can you call into the 2012 powershell commands to the spooler.  They will work targeting the clustered spooler name.

https://technet.microsoft.com/en-us/library/hh918357.aspx

Free Windows Admin Tool Kit Click here and download it now
February 20th, 2015 9:28pm

Hi Alan,

Thanks for your answer.

The Print Management cmdlets you're referring to will work only on Windows Server 2012, won't they? But I need common approach for both Windows Server 2008 and Windows Server 2012.

Since WMI won't work, I'm wondering whether this may be what I need:

http://blog.benvirgilio.com/getting-printer-information-from-a-print-server-cluster

Will it work on Windows Server 2008 and Windows Server 2012?

Currently non-clustered printers discovery workflow is targeted to Windows Server computers of specific version with Print Server Role. Should I execute PowerShell commands against HKEY_LOCAL_MACHINE\Cluster\Resources\ on each Windows Server computer with Print Server Role as

February 25th, 2015 3:55pm

Sorry I saw 2012 and equated to the OS. Spooler Powershell commands made it in with Windows 8 / Server 2012.

The cluster registry would work to enumerate that there are printers and drivers but for MP you will never obtain status of the printers.

What other types of information will you need?

Free Windows Admin Tool Kit Click here and download it now
February 28th, 2015 6:17pm

Hi Alan,

Thanks for clarifications. Now I see I could discover clustered printers in this branch of registry on each clustered Print Server node using powershell:

HKLM:\Cluster\Resources\<spooler id>\Printers

As for monitoring workflows, currently for non-clustered printers instances MP monitors Print Queue counters (JobErrors, NotReadyErrors, OutOfPaperErrors) and a bunch of event log messages from Microsoft-Windows-PrintSpooler and Microsoft-Windows-PrintService.

Will it work with newly discovered clustered printers? But most likely I will have to implement brand
new monitoring workflows, or just to discover clustered printers for information only.

March 18th, 2015 8:28am

You will not be able to monitor printers installed on a clustered spooler resource using WMI. You can enumerate them by reading the cluster registry but there is not any status there.

You will need to add code to make calls to the spooler APIs to get the information if you want this to work from a Server 2008R2 and Server 2012/2012R2 machines.

Free Windows Admin Tool Kit Click here and download it now
March 19th, 2015 1:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics