Skip to main content

Overview

Query instances of specific WMI classes with custom filtering and property selection. This command provides direct access to WMI data through the SMS Provider, enabling detailed analysis of SCCM objects and configurations.

Syntax

Parameters

wmi-class
string
required
The WMI class to query (e.g., “SMS_R_System”)
sms-provider
string
The IP address, FQDN, or NetBIOS name of the SMS Provider to connect to
site-code
string
The three-character site code (e.g., “PS1”)
properties
string
Specify properties to retrieve (can be used multiple times)
where-condition
string
Custom WQL WHERE clause for advanced filtering
count
boolean
Return count of results only
verbose
boolean
Display all class properties
dry-run
boolean
Display the WQL query without execution

Examples

Required Permissions

SMS Admins local group membership on the SMS Provider server. Additional permissions may be required for specific classes.

Common Classes

SMS_R_System:
  • Device information and properties
  • Hardware and software inventory
  • User relationships and logon data
SMS_R_User:
  • User account information
  • Domain and authentication data
  • User group memberships
SMS_R_UserGroup:
  • User group definitions
  • Group membership information
  • Security group analysis
SMS_Admin:
  • Administrative user accounts
  • Security role assignments
  • Administrative scope and permissions
SMS_Role:
  • Security role definitions
  • Permission sets and capabilities
  • Role-based access control
SMS_SecuredObject:
  • Object security and permissions
  • Access control lists
  • Security scope assignments
SMS_Collection:
  • Collection definitions and properties
  • Collection types and settings
  • Collection relationships
SMS_FullCollectionMembership:
  • Complete collection membership
  • Member details and properties
  • Collection-device relationships

WQL Query Examples

Intelligence Gathering

Device Analysis:
User Intelligence:
SCCM Administrators:
Security Roles:

Advanced Usage

Multiple Conditions:
Pattern Matching:
Numeric Comparisons:
Essential Properties:
  • Focus on key identifying and security-relevant properties
  • Avoid retrieving unnecessary data for performance
  • Use meaningful property combinations
Security Properties:
  • User authentication and logon information
  • Administrative roles and permissions
  • Network and system configuration data

Use Cases

High-Value Systems:
  • Administrative workstations and servers
  • Systems with privileged user access
  • Critical infrastructure components
User Targeting:
  • Administrative and service accounts
  • High-privilege users
  • Domain administrators
Infrastructure Analysis:
  • Network topology and system distribution
  • Administrative boundaries and relationships
  • User-device relationship mapping
Security Assessment:
  • Permission and role analysis
  • Administrative access patterns
  • Security configuration review