For Packages
$SiteCode = "DEV"
$siteserver= "Site.server.com"
$Progs = Get-WMIObject -NameSpace "Root\SMS\Site_$($SiteCode)" -ComputerName $siteserver -Class SMS_program
foreach ($Prog in $Progs) {
if (($Prog.ProgramFlags -band 33) -eq 1)
< # change it to -eq 0 in the above condition, if you want to get the package list which are not checked #>
{
" {0}:{1}:{2}" -f $Prog.PackageID, $Prog.PackageName, $Prog.ProgramName
}
}
For Applications
$AppList = Get-CMApplication
foreach ($App in $AppList)
{
if ($App.SDMPackageXML -like '*true*')
{
Write-Output $App.LocalizedDisplayName
}
No comments:
Post a Comment