widsnet.com
31Oct/120

List packages with an update schedule

List all packages in SCCM that have an update schedule of some sort.

$SCCMServer = 'Server01'
$NameSpace = 'root\sms\site_SMS'
$Provider = "\\$SCCMServer\$NameSpace"
$Packages = Get-WmiObject -Query "Select * from SMS_Package" -ComputerName $SCCMServer -NameSpace $NameSpace
$Packages | ForEach-Object {
    $PackageID = $_.PackageID
    $Sched = ([wmi]"$($Provider):SMS_Package.PackageID='$PackageID'").RefreshSchedule
    If($Sched) {Write-Host "$PackageID"}
}

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.