[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 656
  • Last Modified:

SCCM 1607 - Update content on application by powershell

Hi,

Once per month I would like a script to download the newest content to our Office 365 suite and thereafter update the content in SCCM 1607. The first part is done. Now I need to update the content of an existing application in SCCM, which I normally do by right-clicking on the application and choose "Update content" and then thereafter remove the old revision of the application.

Does any of you guys know how to do this?
0
Sum Wum
Asked:
Sum Wum
1 Solution
 
Mike TLeading EngineerCommented:
Hi,

That would be in PowerShell and a short script, since you want to retire the old version. Given you have 1607 you ought to have the latest cmdlets available which are improving frequently.

The latest is for 1604 so is dated 6/6/2016 - Update Release, version 5.0.8373.1189 and has bug fixes.
Documentation + download Link: https://technet.microsoft.com/en-us/library/dn958404

You need to find out the package name and then it's easy enough:
 Start-CMContentDistribution -ApplicationName "Office365" -CollectionName "All Systems" -DistributionPointName "yourDPservername.CORP.COM" -DistributionPointGroupName "DistPointGroup"

This will update the named group of DPs with new content that you have changed in the application (object) Office365.

I don't know any cmdlet to remove old revisions as there's nothing listed in the docs. It is simple enough to do that as a monthly housekeeping task. (I take it you mean application revision history?).

Mike
0
 
Sum WumAuthor Commented:
Hi Mike,

Thanks! That helped alot. Here is what I ended up with for Office x86 if anyone else could use it. I'll let it run once per month as a scheduled task to update the Office suite and all the other Office applications that we use.

Set-Location -Path "X:\Path\Microsoft Office Suite\2016\x86\"
Remove-Item -Path .\Office -Force -Recurse
Start-Process -FilePath .\setup.exe -ArgumentList "/download .\Download.xml" -Wait -NoNewWindow -PassThru
$ApplicationName = "Microsoft Visio Pro 2016 x64"
$DeploymentType = Get-CMDeploymentType -ApplicationName $ApplicationName
Update-CMDistributionPoint -ApplicationName $ApplicationName -DeploymentTypeName $DeploymentType.LocalizedDisplayName

# Here we go through all the applications and remove all the revisions that is not in use
$SCCMApps = Get-CMApplication
foreach ($SCCMApp in $SCCMApps)
{
      $SCCMAppRevision = $SCCMApp | Get-CMApplicationRevisionHistory
      for ($i = 0;$i -lt $SCCMAppRevision.Count-1;$i++) {Remove-CMApplicationRevisionHistory -name $SCCMApp.LocalizedDisplayName -revision $SCCMAppRevision[$i].CIVersion -Force}
}
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now