PowerShell

Automate Pre-Deploy Software to the User’s Primary Device with PowerShell

I want the OSD process to install all user applications if the primary user on the device is known. This is very simple to achive, all you need is an active deployment of the application to the user with the setting “pre-deploy software to the user’s primary device” enabled on the deployment. Only one problem, I had to enable it for 300+ deployments.

Its easy with PowerShell.

This PowerShell script enables “pre-deploy software to the user’s primary device” on all application deployments in Configuration Manager

$deployments = Get-CMDeployment
foreach ($deployment in $deployments)
{
    Set-CMApplicationDeployment -ApplicationName $deployment.SoftwareName -CollectionName $deployment.CollectionName -PreDeploy $true
}

 

 

Anders Rødland

Anders Rødland started his IT career in 2006. My main focus is MS Configuration Manager and client management, and I currently hold active 15 Microsoft certifications. Certified on Windows Server, Windows Client, SQL, Exchange and System Center Configuration Manager. Anders Rødland also holds an ITIL Foundation certification. This is my private blog and do not represent my employer. I use this to share information that I find useful. Sharing is caring.