SCCM PowerShell One-Liners

List outstanding software updates targeted at a remote client:

Get-WmiObject -ComputerName “PC123” -query "SELECT * FROM CCM_SoftwareUpdate" -namespace "ROOT\ccm\ClientSDK" |Select -Property PSComputerName, Name, ArticleID

List outstanding applications targeted at a remote client:

Get-WmiObject -ComputerName “PC123” -query "SELECT * FROM CCM_Application" -namespace "ROOT\ccm\ClientSDK" |Where-Object {$_.InstallState -eq "NotInstalled"}|Select -Property PSComputerName, FullName, InstallState

Invoke Application Deployment Evaluation to a remote client:

Invoke-WMIMethod -ComputerName “PC123” -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000121}"

[Invoke Machine Policy Retrieval and Evaluation to a remote client:

Invoke-WMIMethod -ComputerName “PC123” -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000021}"

Invoke Software Update Deployment Evaluation to a remote client:

Invoke-WMIMethod -ComputerName “PC123” -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000108}"

Invoke Software Update Scan:

Invoke-WMIMethod -ComputerName “PC123” -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000113}"

Invoke Software Inventory:

Invoke-WMIMethod -ComputerName “PC123” -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000002}"

Invoke Hardware Inventory:

Invoke-WMIMethod -ComputerName “PC123” -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000001}"

And a script for a function to check for pending reboots.

 

-JFH

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.