Troubleshoot · 2 tools

Inactive Configuration Manager clients in a collection

Summary

Lists devices in a collection whose ConfigMgr client is inactive or missing, with the last activity time, so you can repair clients before a deployment or a co-management change.

Implementation

Choose your tool. Your choice is remembered on other samples.

ConfigurationManager module
# Run from a machine with the ConfigMgr console
Import-Module "$($env:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1"
$site = (Get-PSDrive -PSProvider CMSite).Name
Set-Location "$($site):"

Get-CMDevice -CollectionName "All Desktop and Server Clients" |
  Where-Object { -not $_.IsClient -or -not $_.IsActive } |
  Select-Object Name, IsClient, IsActive, ClientActiveStatus, LastActiveTime, LastPolicyRequest, DeviceOS |
  Export-Csv "$env:USERPROFILE\inactive-clients.csv" -NoTypeInformation

Prerequisites

  • Configuration Manager console installed
  • Read-only Analyst or higher

Output

CSV of inactive or client-less devices.

Related answers

Contributors

AuthorRole
Priyanshu UpadhyaySolution Architect, Microsoft 365 and Azure
Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.