Enable Programs and Applications to be installed from a Task Sequence without being Deployed!

Updated Post: https://blogs.technet.com/b/brandonlinton/archive/2014/02/18/enable-referenced-programs-and-applications-to-be-installed-from-a-task-sequence-without-being-deployed.aspx

So this has been a common question as far back as Configuration Manager 2007 when a script was incorporated into the Microsoft Deployment Toolkit called EnableProgramForTS.vbs which would enable each program to be installed without being deployed in a Task Sequence.  Well with Configuration Manager 2012 we now have Applications as well as programs but even better we have a wealth of built-in cmdlets that can be utilized to take some of this cumbersome scripting and make it incredibly easy…

I recently had some free time and decided to check out the cmdlets in System Center Configuration Manager 2012 R2 and found that we can easily set this option on both Programs and Applications really easily.

If you are not familiar here are screenshots of what both locations look like:

Application

image

Program

image

Below is the code snippet that should be ran from your ConfigMgr Site server that will automatically find the ConfigMgr Powershell Module import and change the Powershell drive to the Site Code of your site.  It will then attempt to enable these options on both Programs and Applications.

NOTE: Only tested on Configuration Manager 2012 R2 Mileage may vary on other versions.

 import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
 $PSD = Get-PSDrive -PSProvider CMSite
 CD "$($PSD):"
 Get-CMProgram | Foreach-Object {Set-CMProgram -StandardProgramName $_.ProgramName -Id $_.PackageID -EnableTaskSequence $true}
 Get-CMApplication | Foreach-Object {Set-CMApplication -Id $_.CI_ID -AutoInstall $true}

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified
in the
Terms of Use .