Powershell – Update content on an application with Powershell or WMI in Microsoft SCMM 2012 SP1

applicationpowershellsccm-2012wmi

While right-clicking an applications deployment type(s), we can select Update Content. Is there a way of doing this action using Powershell or a WMI-method?

Best Answer

I'm currently using this powershell script to update the content of all applications, only caveat is, the revision always gets increased:

try
{
    Get-Wmiobject -Namespace "root\SMS\Site_<sitecode>" -Class SMS_Application -Filter "isLatest='true' and isExpired='false'" | foreach{
           $name = $_.LocalizedDisplayName
           echo "Application : $name"
           $dptypes = Get-CMDeploymentType -ApplicationName "$name"
           foreach ($dpt in $dptypes){
                $dptname = $dpt.LocalizedDisplayName
                echo "Deployment Type: $dptname"
                Update-CMDistributionPoint -ApplicationName "$name" -DeploymentTypeName "$dptname"
                }
           }
}
catch
{
    $_.Exception.Message
}