This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract Deployment information from MECM (SCCM) through WMI for a specific device. | |
# Useful to monitor specific devide deployment current progression state or to get some history informations | |
$ComputerName = "VM-XXX" # computer to find deployment information | |
$ExecutionTime = '20240327100900.000000+000' # date of the oldest log to extract | |
$SiteCode = "XYZ" | |
pushd "$($SiteCode):" | |
$steps = Get-WmiObject -ComputerName "srv-mecm-01" -Namespace "Root\SMS\site_$SiteCode" -Query "Select * from SMS_TaskSequenceExecutionStatus Where ResourceID='$(get-cmdevice -name $Computername -Fast | select -ExpandProperty ResourceId)' AND ExecutionTime > '$ExecutionTime'" ` |
OlderNewer