WMI Query - Get Terminal server Mode - find TS servers?

Howdy
can anyone help me with trying to write a query and setup an analysis that will show all terminal servers that are enabled in multiple user mode, not just standard RDP mode?

I know the wmi query when trying to use powershell is:

Get-WmiObject -Namespace “root\CIMV2\TerminalServices” -Class “Win32_TerminalServiceSetting” -ComputerName $computer | select -ExpandProperty TerminalServerMode

I am not sure what you mean with “query”, but from your powershell example, it seems you can create an analysis with relevance
(it starts with "win2008" or it starts with "win2012") of (name of operating system as lowercase)
and a property
string value of select "TerminalServerMode from win32_TerminalServiceSetting" of wmi "root\cimv2\terminalservices"
in that analysis.

Of course, BigFix Agent must be installed on each server.

Thanks, this is what I was looking for, how can I get the value of the wmi property?

I am not sure what you mean.
When you create a property, you can view values on Console, Web Report, or export to CSV through Web Report, or use REST API to get value.
If you have WebUI Query, you can send query without creating property and export reported values to CSV.

Akira’s suggestion works for Win2008 and above. We had some older versions, so this is what we used.

If you are creating an analisys, on Relevance (Computers which match all the relevances) the following code detects only servers:
exists (string value of select "ProductType from Win32_OperatingSystem" of wmi) whose (it contains "2" or it contains "3")

Then the code below detects the terminal server mode from various versions of Windows (add it to Properties):
if (exists (wmi "root\CIMV2\Terminalservices")) then ((if it = "0" then "Admin" else "Application") of (string value of property "TerminalServermode" of select object "TerminalServermode FROM Win32_TerminalServiceSetting" of wmi "root\CIMV2\Terminalservices")) else ((if it = "1" then "Admin" else "Application") of (string value of property "LicensingType" of select "LicensingType FROM Win32_TerminalServiceSetting" of wmi))

Note two things:

  1. The main part is the same as Akira’s, but also accounts for older versions of Windows.
  2. The values returned will not be numerical, I format them to Admin or Application. This makes it easy to read reports.

If you decide to create a proeprty directly, the code would be:
if exists (string value of select "ProductType from Win32_OperatingSystem" of wmi) whose (it contains "2" or it contains "3") then if (exists (wmi "root\CIMV2\Terminalservices")) then ((if it = "0" then "Admin" else "Application") of (string value of property "TerminalServermode" of select object "TerminalServermode FROM Win32_TerminalServiceSetting" of wmi "root\CIMV2\Terminalservices")) else ((if it = "1" then "Admin" else "Application") of (string value of property "LicensingType" of select "LicensingType FROM Win32_TerminalServiceSetting" of wmi)) else "N/A"
This would return N/A to non Windows Servers