Wednesday, September 4, 2019

Here is a neat little trick to get the information from SCCM, if the below highlighted options are selected.





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

SCCM Application Deployment Tool

SCCM Application Deployment Tool Streamlining SCCM Application Deployments: Introducing the SCCM Application Deployment Tool. In the realm o...