chocolatey - Grundinstallation mit Intune
- Florian Salzmann
- Veröffentlicht am 14 Aug, 2021
- Aktualisiert am 23 Aug, 2022
- 02 Mins read
- Microsoft Intune,PowerShell,Win32 Applikationen
Um Programme via Chocolatey in Intune zu installieren, muss als Basis Chocolatey selbst installiert werden.
Wie das geht und was Chocolatey ist, habe ich dir hier zusammengefasst.
_Dieser Beitrag ist der erste Teil einer Serie zur Verwaltung von Chocolatey Applikationen via Intune.
_Hier zeige ich dir, wie du die Grundinstallation von Chocolatey mit Intune und einem Win32 App machen kannst.
Part 1: Dieser Beitrag.
Part 2: chocolatey - Programm Installation - Intune | scloud
Part 3: chocolatey - Programme up to date halten - Intune | scloud
Was ist chocolatey?
Chocolatey ist ein riesiges Paket Repository mit Installationspaketen für Windows. Die Pakete sind Community gepflegt, durchlaufen vor der Veröffentlichung aber immer einen strengen Überprüfungsprozess.
Mehr Informationen: Chocolatey Software Docs | Moderation
Wie funktioniert chocolatey?
Chocolatey kann einfach via PowerShell installiert werden. Ist die Basis einmal auf einem Gerät vorhanden, können Applikationen mit dem Befehl “choco install Applikation” installiert, oder mit “choco upgrade Applikation” upgedatet werden.
Chocolatey als win32 App verteilen
Installiert kann Chocolatey via PowerShell (Admin) mit einem Einzeiler werden:
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'))
Um die Verteilung via Endpoint Manager zu verbessern und einige Einstellungen zu setzten, habe ich die Zeile etwas erweitert:
$PackageName = "chocolatey"
$Path_local = "$Env:Programfiles\_MEM"
Start-Transcript -Path "$Path_local\Log\$ProgramName-install.log" -Force
try{
if(!(test-path "C:\ProgramData\chocolatey\choco.exe")){
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'))
}
C:\ProgramData\chocolatey\choco.exe list -lo
choco feature enable -n=useRememberedArgumentsForUpgrades
exit 0
}catch{exit 1618}
Stop-Transcript
Das ganze Paket inkl. Erkennungsregel ist hier zu finden: scloud/chocolatey/chocolatey at main · FlorianSLZ/scloud (github.com)
Zur Verteilung werden folgende Parameter gesetzt:
| Settings | Wert |
|---|---|
| Win32 File | install.intunewin |
| Install command | %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -command .\install.ps1 |
| Uninstall command | no uninstall |
| Requirements | 64 bit |
| Detection rule | custom script, check.ps1 |
| Dependencies | none |
Möchtest du etwas an der Installations Routine ändern, so kannst du einfach das “install.ps1” File anpassen und ein neues intunewin generieren.
Hier eine Anleitung zur Generierung von Win32 Applikationen: Win32 App / .intunewin erstellen | scloud
