Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ScottMonolith/2411c0f3b70b79e7dc715c2097fbe81e to your computer and use it in GitHub Desktop.

Select an option

Save ScottMonolith/2411c0f3b70b79e7dc715c2097fbe81e to your computer and use it in GitHub Desktop.
Intune + Chocolatey
https://learn.microsoft.com/en-us/mem/intune/apps/apps-win32-prepare
https://scloud.work/en/chocolatey-program-installation/
https://www.thelazyadministrator.com/2020/02/05/intune-chocolatey-a-match-made-in-heaven/
Use the Choco Install Template folder. Copy it to your local machine.
Grab a copy of the IntuneWinAppUtil.exe
In choco.txt, adjust the chocoID. This should match the Chocolatey install ID (IE for Adobe Acrobat Reader DC, it's 'adobereader') - find from https://community.chocolatey.org/packages/
Put the same 'chocoID' in the 'check.ps1' file.
Any parameters go in parameter.txt (generally not needed)
Download the icon for the app in the top right of the package page
Now launch a cmd prompt, navigate to your IntuneWinAppUtil.exe file, run it with ".\IntuneWinAppUtil.exe" and it will ask you questions.
1. Source Folder - the modified template folder you have above
2. Setup file - install.ps1
3. Output Folder - same as source folder (this is where the .intunewin file is generated)
4. Catalog folder - say no
Now from Intune, Apps --> Windows Apps, click 'Add'. Select Windows app (Win32). Click 'Select app package file' and point it to the install.intunewin file you generated
Name the app appropriately. Description I usually just lift from the Chocolatey package page. Publisher is not critical, generally I put the company producing the package. Category, pick something logical, this is how users will find the application in Company Portal in lieu of searching. Assign the logo based on the image you downloaded from the chocolatey packages page
Install Command: %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -command .\install.ps1
Uninstall command: %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -command .\uninstall.ps1
I generally leave the rest default on the 'Program' step (#2) but feel free to customize as needed
Requirements - select 64-bit as all machines should be 64-bit by now (but doesn't hurt to select 32-bit)
Minimum OS - Windows 10 1607 unless you have higher requirements
Rest can be blank (disk space required, memory, CPU etc)
Detection Rules - use custom script
Select check.ps1 - make sure you've updated it!! Otherwise the package will install but will fail as Intune won't be able to check if it's present. I generally leave run script as 32-bit process and enforce script signature to 'no'.
Dependencies - add Chocolatey, set Automatically Install to 'yes' (should default to that). If you skip this step and for some reason the computer doesn't have Chocolatey the install will fail.
Supersedence - I leave this empty, customize if you need
Assignments - most I specify 'all users' for 'Available for enrolled devices'. But if it's a required app on all devices, configure the 'Required' section accordingly. 'Uninstall' section will uninstall the app for whatever group/user/device you list
It will take some time to show up - you can potentially speed that up on the local machine by going to Settings, Accounts, Access work or school, click on 'Connected to CORP AD domain', then 'Info'. There will be a 'sync' button near the bottom of the page (under 'Device sync status')… although to be honest this manual sync process also takes forever. Patience is key with Intune.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment