Solved

SCCM 1607 - Update content on application by powershell

Posted on 2016-09-19
2
63 Views
Last Modified: 2016-09-19
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
Comment
Question by:Sum Wum
2 Comments
 
LVL 16

Accepted Solution

by:
Mike T earned 500 total points
Comment Utility
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
 
LVL 1

Author Comment

by:Sum Wum
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
This article will help you understand what HashTables are and how to use them in PowerShell.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now