Skip to main content

Overview

Map device-to-user relationships by analyzing primary user assignments. This command reveals which users are primarily associated with specific devices, providing valuable intelligence for targeting and lateral movement planning.

Syntax

SharpSCCM get primary-users [options]

Parameters

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”)
user
string
Filter by specific user (supports partial matching)
device
string
Filter by specific device name
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 relationship properties

Examples

# List all primary user relationships
SharpSCCM get primary-users -sms SCCM01.corp.local -sc PS1

# Count total relationships
SharpSCCM get primary-users -c -sms SCCM01.corp.local -sc PS1

Key Properties

PropertyDescriptionUse Case
UniqueUserNameDomain\usernameUser identification
ResourceNameDevice nameDevice identification
ResourceIDDevice resource IDCross-referencing
UserResourceIDUser resource IDUser cross-referencing
IsActiveRelationship statusActive mapping verification
CreationDateRelationship creationTimeline analysis
SourcesRelationship sourcesTrust level assessment

Required Permissions

SMS Admins local group membership on the SMS Provider server

Relationship Analysis

Automatic Detection:
  • User Device Affinity (UDA) based on logon frequency
  • Usage patterns and session duration
  • Windows logon events and activity
Manual Assignment:
  • Administrative assignment
  • Help desk assignments
  • Self-service assignments
Configuration Manager Sources:
  • Exchange Server connector
  • Active Directory integration
  • Third-party connectors
High Confidence:
  • Multiple source confirmations
  • Long-term usage patterns
  • Administrative verification
Medium Confidence:
  • Single source detection
  • Recent relationship establishment
  • Automated detection only
Low Confidence:
  • Temporary assignments
  • Shared device usage
  • Conflicting sources

Intelligence Gathering

High-Value Relationships:
# Admin user devices
SharpSCCM get primary-users -u "admin" -sms SCCM01.corp.local -sc PS1

# Service account devices
SharpSCCM get primary-users -u "svc" -sms SCCM01.corp.local -sc PS1

# Privileged user workstations
SharpSCCM get primary-users -w "UniqueUserName LIKE '%administrator%'" -sms SCCM01.corp.local -sc PS1
Infrastructure Analysis:
# Server primary users
SharpSCCM get primary-users -d "SRV" -sms SCCM01.corp.local -sc PS1

# Domain controller relationships
SharpSCCM get primary-users -d "DC" -sms SCCM01.corp.local -sc PS1
Credential Targeting:
  • Identify devices used by high-privilege users
  • Map service account usage patterns
  • Find administrative workstations
Lateral Movement:
  • User-device relationship exploitation
  • Cross-device credential reuse
  • Privilege escalation paths

Use Cases

High-Privilege Users:
  • Administrative account workstations
  • Service account device assignments
  • Privileged user system access
Device Ownership:
  • Personal vs shared device identification
  • Administrative device assignments
  • Service account system usage
User Path Mapping:
  • Track user access across devices
  • Identify cross-system relationships
  • Map administrative boundaries
Credential Harvesting:
  • Target devices with high-value users
  • Focus on administrative workstations
  • Identify credential reuse patterns

Common Queries

UniqueUserName LIKE '%admin%' OR UniqueUserName LIKE '%administrator%'

Output Analysis

One-to-One:
  • Personal workstations and laptops
  • Dedicated administrative systems
  • Individual user assignments
One-to-Many:
  • Users with multiple devices
  • Administrative access across systems
  • Service account system usage
Many-to-One:
  • Shared workstations
  • Terminal servers
  • Kiosk systems
High-Value Targets:
  • Administrative user workstations
  • Service account assigned systems
  • Multi-device administrative access
Risk Indicators:
  • Privileged users on multiple devices
  • Service accounts with device assignments
  • Administrative access patterns