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 have passed 17 Microsoft certifications since then. My main expertise is on client management with Microsoft Endpoint Manager: Intune and Configuration Manager. I also do a lot of work on the security side with Microsoft Defender for Endpoint. In addition to my Microsoft certification, I also have an ITIL v3 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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.