Solved

SCCM 1607 - Update content on application by powershell

Posted on 2016-09-19
2
95 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 17

Accepted Solution

by:
Mike T earned 500 total points
ID: 41805577
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
ID: 41805952
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
A brief introduction to what I consider to be the best editor for PowerShell.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

21 Experts available now in Live!

Get 1:1 Help Now