Skip to content

Create a Chocolatey Deployed Software to Intune (With AutoUpdate every Startup)

Notifications You must be signed in to change notification settings

Trinity503/IntuneChocolateyDeployment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 

Repository files navigation

image

Deploy Intune Win32 Applications automated with chocolatey

Description

With this script you automate the APP-Deployment. You can publish Chocolatey APPs with intune and keep them up2date. The Script automaticly creates the application, and installs automaticly the required chocolatey application. It also downloads the Application-Icons from Chocolatey to make it watching nice in the Customer Portal, if you dont want to install it automaticly The Application is published automaticly for every user. You can also make it be installed automaticly

For keeping the installed software updated, the Installer creates a Scheduled Task for every application with fires a "choco upgrade -y" on every startup for every deployed application

Special thanks to Brad Wyatt who gave me the the incentive to that automation https://www.thelazyadministrator.com/2020/02/05/intune-chocolatey-a-match-made-in-heaven/

Install-Guide

  1. Start powershell with elevated rights.
  2. Download The Script and Save it for example to C:\admin
  3. Install and Import all required Modules, chocolatey and Software for icon-converting.
set-executionpolicy unrestricted # not needed but my one is set so, you can try it with other policies
Install-Module IntuneWin32App -Force
Import-Module IntuneWin32App
Install-Module Microsoft.Graph.Intune -Force
Import-Module Microsoft.Graph.Intune
Install-Module -Name chocolatey
Import-Module -Name chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install inkscape -y
  1. OPTIONAL IF YOU USE IT MANUALLY Connect to Intune Graph API (Multi-Tenant Use is possible)
Connect-MSIntuneGraph -TenantID "contoso.com"
  1. OPTIONAL IF YOU USE IT MANUALLY Import Downloaded Script (in this sample from C:\admin)
import-module "C:\admin\ChocoIntuneDeployment-Main.ps1"

How to Use

Animation

in simplest way, easy run the script.

First you will be asked, what tenant you want to connect and you will be asked for M365 Creds to authenticate to Graph API

Then you can choose the software you want to install. (Hold STRG to select more then One)

Start the Process With OK

Everything else is done automaticly now

Optional Steps

Adding Applications to the Softwarelist

You can easy add software you like to the list. You need to find following line and add Software in following pattern

 "<Description>","<choconame>"
$Content = '
<ADD YOUR CONTENT HERE>
"Adobe Acrobat Reader DC","adobereader"
"Google Chrome","googlechrome"
"Mozilla Firefox","firefox"
"Java SE Runtime Environment","jre8"
.
.
.

Install Chocolatey Manually

This step is only required, if you want to install it manually or the automatic process is not working. Normaly, chocolaty will be installed automaticly befor you publish the first application

install-chocolatey

Create a new Application

Installing a new Application is done simply by running the main function

New-IntuneWin32ChocoApplication

You will be prompted to enter a pattern of what Software you want to install. After that select the wanted software.

By default the Software is published but not autoinstalled for every user in the intune Tenant. To make it automaticly installed add the Switch -Required

New-IntuneWin32ChocoApplication -Required

If you know the exact chocolatey name, you can also deploy the software without any userpromt

New-IntuneWin32ChocoApplication "googlechrome"

Results:

New created Windows applications image

Configured chocolatey Application with detection Rule

image

Deployed application with detection script, dependency to the choco application and available for all users

image

image

Result shown in Company Portal:

image

Configured Update Task in Task Scheduler

image

About

Create a Chocolatey Deployed Software to Intune (With AutoUpdate every Startup)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%