2024 - Learn package Apps in Microsoft Intune like an expert - become a hero at work!

Поделиться
HTML-код
  • Опубликовано: 7 авг 2024
  • You will learn how to package any application in the Winget.exe repository (and there are many) to always have the latest version without repackaging each new release.
    No previous skills are needed. Just need to follow along! This is a skill you must know about in 2024.
    We will be writing PowerShell scripts called Winget.exe to install and uninstall our software of choice, in this video, we chose Microsoft SQL Management Studio, but you can replace only two words in the scripts and change to any software you want (you need to know the Winget ID of the software but we show how to find that also).
    We will also write a detection script, again with the help of winget.exe
    Let's get started and thanks for watching!
    Links:
    github.com/Microsoft/Microsof...
    3 SCRIPTS from the video ###
    Install-MicrosoftSQLManagementStudioLATESTx86.ps1 - COPY the below ##
    Install the latest Microsoft SQL Management Studio from Winget repository
    Author: John Bryntze
    Date: 2nd February 2024
    set variables
    $JBNWingetAppID = "Microsoft.SQLServerManagementStudio"
    Help SYSTEM find winget.exe folder
    Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
    Install Microsoft SQL Management Studio software with winget.exe
    .\winget.exe install -e --id $JBNWingetAppID --silent --accept-package-agreements --accept-source-agreements --force
    Uninstall-MicrosoftSQLManagementStudiox86.ps1 COPY the below ##
    Uninstall the latest Microsoft SQL Management Studio from Winget repository
    Author: John Bryntze
    Date: 2nd February 2024
    set variables
    $JBNWingetAppID = "Microsoft.SQLServerManagementStudio"
    Help SYSTEM find winget.exe folder
    Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
    Install Microsoft SQL Management Studio software with winget.exe
    .\winget.exe Uninstall -e --id $JBNWingetAppID --silent --accept-source-agreements --force
    DetectionScriptMicrosoftSQLManagementStudio.ps1 COPY the below ##
    Purpose: Checking that locally installed Microsoft SQL Management Studio is equal or greater to the latest found online
    Author: John Bryntze
    Date: 2nd February 2024
    set variables
    $JBNWingetAppID = "Microsoft.SQLServerManagementStudio"
    Help SYSTEM find winget.exe folder
    Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
    What is the latest version online
    $JBNSearch = .\winget.exe search -e --id $JBNWingetAppID --accept-source-agreements
    $JBNOnlineVersion = (-split $JBNSearch[-1])[-2]
    What is the version installed
    $JBNLocalSearch = .\winget.exe list -e --id $JBNWingetAppID
    #If not installed exit here...
    if($JBNLocalSearch[-1] -eq 'No installed package found matching input criteria.')
    {
    exit 1
    #no Microsoft SQL Management Studio is installed...
    }
    Check if the installed version has a newer version on the web...
    $JBNCheckIfAvailavbleExist = (-split $JBNLocalSearch[-3])[-2]
    if($JBNCheckIfAvailavbleExist -eq "Available")
    {
    $JBNLocalVersion = (-split $JBNLocalSearch[-1])[-3]
    }
    else
    {
    $JBNLocalVersion = (-split $JBNLocalSearch[-1])[-2]
    }
    if($JBNLocalVersion -ge $JBNOnlineVersion)
    {
    Write-Output "The Device got the latest version installed."
    exit 0
    #Detection success
    }
    else
    {
    exit 1
    #Detection failed
    }
    Chapters
    00:00:00 Introduction
    00:08:25 Package, folder, files, Intunewin file, PowerShell...
    00:27:27 Intune Console creating the Win32 App
    00:43:03 Install from Company Portal
    00:47:10: Outro

Комментарии • 79

  • @Pilami_
    @Pilami_ 6 месяцев назад +3

    Wow! Great video John!!

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад +1

      Thanks, I have covered most of this video in parts of other video, but this one is maybe the most complete. I think anyone who package apps for Windows in Intune should learn these steps and use them when possible. So nice to package ONCE and then you know the package will always install the latest versions for years to come :)

  • @rashkaViking
    @rashkaViking 6 месяцев назад +1

    Always the best!

  • @abualghoul
    @abualghoul 6 месяцев назад +2

    Really helpful, appreciate each second you share ❤

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад

      Thank you very much Ahmed, appreciate your comment.

  • @danzirulez
    @danzirulez 5 месяцев назад +3

    .... and now to Autopilot, how to make sure that winget is actually a dependency for all apps that were packaged this way ;-) Can be added as a dependency, or winget needs to be added as a blocking app in ESP and make sure that all of these packaged apps have a prereq - for the machine to be PAST OOBE :)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  5 месяцев назад

      you got really good questions (= difficult questions LOL but GOOD!) yes winget is not good for Autopilot unfortunately, better for self service apps or update existing apps already installed. ESP blocking apps isn't so useful, because it will still to run all apps randomly but only present desktop to user once they have installed, so it could result Autopilot error out or user has to wait hours to see desktop.
      your idea a prereq would work fine, good idea, same, user will have to wait a bit to see apps.
      I hope with Windows 12 (release in 2025) winget gets more integrated into the OS itself and be better for Autopilot.

  • @AnbarasanRajLK
    @AnbarasanRajLK 5 месяцев назад +1

    it works great, I have been using this method for several months for many applications that needs frequent update.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  5 месяцев назад

      Well done Anbarasan, happy to hear! yes it is a real time saver, package once and then move on to next. When package static MSI which is good also, but in w few weeks/months the package is already old

  • @eyadabu-khiran1919
    @eyadabu-khiran1919 Месяц назад +1

    Great video thanks very much.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  Месяц назад

      Thank you very much for this nice comments, those gives me energy to do more videos

  • @lukak6372
    @lukak6372 27 дней назад +1

    man you are the best!

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  27 дней назад +1

      Thanks a lot for taking time to comment

    • @lukak6372
      @lukak6372 26 дней назад +1

      @@IntuneVitaDoctrina Bro you give a lot of value!

  • @maryvacherweill8505
    @maryvacherweill8505 15 дней назад +1

    This works great - your videos are among the best available! My current project is to set autopilot (all in the cloud using Entra ID authentication only) to basically lay down a "golden image" by using OOBE on a new (or reimaging) laptop - walk away for 12 hours and come back to an imaged laptop. Where I feel Intune is lacking is that it is difficult to specify an order and simply using Dependencies does not seem to achieve that properly. Have you done this? Is this theoretically possible? (not using SCCM nor any RMM)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  13 дней назад

      Thank you so much for your comment. Intune really misses the SCCM Sequence Task where you know which steps it would take. Dependencies work only if Intune luckily picks the app. It all depends on etc..
      I have not thought so much about fixing that issue, could possibly install all in ONE Win32 app that calls all software with Winget and to different win32 apps per department or app requirements.
      That could be something, but winget is a bit weak on newly set up devices and can take time, but possibly set a delay or requirement.
      Have had the same thought as you, dependency could do it. I don't are so much in which order the apps are installed, would be nice to have anti virus, 365 apps and the primary communication and support tools in place before less important Adobe Reader, VLC, 7-zip etc...

  • @mortenwiingreen9748
    @mortenwiingreen9748 6 месяцев назад +1

    Hi John, great job with the video, you really explain the steps carefully so its easy to understand. I would like also like to see the remediation script to keep the application updated. :)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад

      Thanks a lot Morten, here is the DETECTION SCRIPT
      ### Runs as Dection script if Microsoft SQL Server Management Studio is installed
      ### Author: John Bryntze
      ### Date: 3rd January 2023
      # Help SYSTEM find winget.exe folder
      Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
      ## Check if there is an avilable update
      $LocalInstall = .\winget.exe list -e --id Microsoft.SQLServerManagementStudio --accept-source-agreements
      # split the output and take the third row from the end [-3] and second from right [-2] is Avaiable we know there is an update (and that Firefox is installed)
      $AvailableUpdate = (-split $LocalInstall[-3])[-2]
      if($AvailableUpdate -eq 'Available')
      {
      write-host "Microsoft SQL Server Management Studio is installed and needs an update..."
      exit 1
      }
      if(!$AvailableUpdate)
      {
      write-host "Microsoft SQL Server Management Studio is not installed on this system..."
      exit 0
      }
      if($AvailableUpdate -eq 'Version')
      {
      write-host "Microsoft SQL Server Management Studio is installed on this system and with the latest version..."
      exit 0
      }

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад

      And here is the REMEDIATION Script
      ### Update to the latest Microsoft SQL Server Management Studio
      ### Author: John Bryntze
      ### Date: 3rd January 2023
      # Help SYSTEM find winget.exe folder
      Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
      ## Update Git with winget.exe
      .\winget.exe upgrade -e --id Microsoft.SQLServerManagementStudio --silent --accept-package-agreements --accept-source-agreements

    • @mortenwiingreen9748
      @mortenwiingreen9748 6 месяцев назад +1

      @@IntuneVitaDoctrina This is great. I can use this for all apps we install with winget that is not in the new store (but i guess the new store will get more and more apps over time).

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад

      yes, the store is great, but also with a script you can copy in custom files and reg edit which you cannot with store so it will always be easier to customize this way, But if just need the app and no settings, then store apps is probably the future

  • @patrick__007
    @patrick__007 6 месяцев назад +1

    As always great explaination! Still struggling with writing my own scripts though ^^.
    What will happen if you delete the original .intunewin file and replace it with the edited .intunewin? Does this has any impact on device(s)?
    Please keep on uploading!

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад

      Thanks a lot, if you replace the original .intunewin with a new it will keep the same package ID but get a sort of version to it, like _2 and it will run again if detection rule allows.

  • @CloudTI
    @CloudTI 2 месяца назад +1

    The error below has already occurred, could anyone help me?
    "Falha na pesquisa da origem: winget
    Ocorreu um erro inesperado ao executar o comando:
    0x8a15000f : Os dados exigidos pela origem estão ausentes"

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 месяца назад +1

      See others have this issue, some fixed it here:
      learn.microsoft.com/en-us/answers/questions/1256882/winget-gives-0x8a15000f-error-for-all-applications

  • @Kirrikor
    @Kirrikor 6 месяцев назад +2

    Excellent video!! 👍, if the deploy is required if a new version is released it will be updated automatically?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад +3

      Thanks a lot Matt, it will install the latest at that time. To ensure it stays upgraded to latest after install you can use nearly same scripts but using Remediation script and have them run like once a week, if no upgrade it does nothing and if an upgrade it get it every week. I got a video showing this, think I called it vulnerability hunting, if you want the scripts I use for it let me know and I post here in the comments when I can

    • @Kirrikor
      @Kirrikor 6 месяцев назад +1

      Thanks, I will try to make them (if I have problems I will let you know). Thanks! again

    • @zak.premium
      @zak.premium 6 месяцев назад +2

      But from what I see on the detection script it should keep auto updating the app when it detect it is not the latest version so why would we need remediation script? Excellent job btw !

    • @ToTCaMbIu
      @ToTCaMbIu 6 месяцев назад +1

      @@IntuneVitaDoctrina , very innovative approach and surely IME will try to install the app as soon as the detection script exits with code 1. Am I missing something?

    • @ToTCaMbIu
      @ToTCaMbIu 6 месяцев назад +1

      @@zak.premium That's what I thought. I'm dissecting the script to understand it better, and my understanding is that as soon as the script exits with code 1 Intune/IME, I will try to install the app again. Need to lab this out.

  • @hemmahos
    @hemmahos 4 месяца назад +1

    Great video, but I can't get the detection script to show it as installed in the company portal or have the uninstall option

    • @hemmahos
      @hemmahos 4 месяца назад +1

      Found the error, It was a # that was missing on one line :-(

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  4 месяца назад

      Thanks for letting me know, and GREAT that you fixed it, well done!

  • @pellejpellej
    @pellejpellej 6 месяцев назад +1

    FYI: have the same crash with intunewin as you. I need to be in admin cmd or terminal as well.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 месяцев назад +1

      ah so it is not only me, thanks for letting know!

  • @CloudTI
    @CloudTI 2 месяца назад +1

    All good? Could you explain to me how you do it in the case of Java for x32 and x64 versions, is there a way to identify the different versions?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 месяца назад +1

      thanks all good, hope you too.
      You can specify a switch called: --architecture (or just a) and then if you want 32 bit or 64 bit, if it comes only in 64-bit it will ignore this flag.
      from another video when showing this:
      ## Install Oracle Java 32-bit software with winget.exe
      .\winget.exe install -e --id $JBNWingetAppID --architecture=x86 --silent --accept-package-agreements --accept-source-agreements
      If you want the full video check here: ruclips.net/video/nXOdyZcTjWI/видео.html&ab_channel=Intune%26VitaDoctrina

    • @CloudTI
      @CloudTI 2 месяца назад +1

      @@IntuneVitaDoctrina thanks!!! ❤

  • @dancingkidkul9325
    @dancingkidkul9325 5 месяцев назад +1

    Hi John,
    Does that mean this works similar to the Intune new capability called "Windows Catalog app (Win32)" or its something else?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  5 месяцев назад +1

      Hi, I would say it is something else, the Windows Catalog App (Win32) is limited to what Microsoft pre-package for you, at todays date it is 100 apps, and they are not in Winget format, even their FAQ mention this: learn.microsoft.com/en-us/mem/intune/apps/apps-enterprise-app-management#frequently-asked-questions-faq
      "Does Enterprise App Management use Winget?
      No. Enterprise App Catalog apps are directly installed by the Intune management extension (IME)."
      So different things, I got a video about Enterprise App Catalog: ruclips.net/video/U2xOY5DYHk4/видео.html&ab_channel=Intune%26VitaDoctrina

    • @dancingkidkul9325
      @dancingkidkul9325 5 месяцев назад +1

      @@IntuneVitaDoctrina
      another question;
      If we use winget for apps deployment does that mean those deployed apps would be auto updating when there is new update/version is available from respective vendors or what?
      Also what all apps we can use with this winget cmdlets?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  5 месяцев назад +1

      Correct they will auto update when vendors update in the winget repository :) so you package once and you are good :)
      Winget got one drawback, if you run autopilot it is not always ready so it can delay for installations, it will get there but users have to wait too long, so I prefer Winget for Self Service software, or for existing devices, not newly enrolled :)
      you can search all the apps, I would say nearly all exists there, not all works exactly as I want, for example TeamViewer works but doesn't assign correctly so still MSI package that one for exampke. Do a: winget search --id A and you get all packages with A etc... Winget got a lot! :) hope that helps

    • @dancingkidkul9325
      @dancingkidkul9325 5 месяцев назад +1

      ​@@IntuneVitaDoctrina
      But I think it would be easy and will work for those devices which would be enrolled via Intune autopilot for example: I have deployed an app with 19.2 version and later it was updated to 20.1 version then will it work or not because as its going to deploy the app on device when and whatever was available via Intune during the autopilot enrollment?
      What do you say about this?

    • @dancingkidkul9325
      @dancingkidkul9325 5 месяцев назад +1

      Another question below
      Who is owner of Winget and who does update it with latest patches of apps if we are using the winget for apps deployment via Intune as I know the use case of it but wanted to make sure the apps which are part of winget those are always updated and who is taking ownership of them?

  • @hectorhenriquez6105
    @hectorhenriquez6105 5 месяцев назад +1

    JB, it's great but I still can't get it to work. in my environment I have the microsoft public store blocked. I always get the same error. error from script =Cannot index into a null array.
    At C:\Program Files (x86)\Microsoft Intune Management
    Extension\Content\DetectionScripts\1e08c5da-e5cb-4024-bb83-1932ee58e29e_1.ps1:9 char:1
    + $JBNOnlineVersion = (-split $JBNSearch[-1])[-2]
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  5 месяцев назад +1

      even if disable Microsoft Public Store it should work, if you just block the app or you block more than that?
      If you just open a cmd.exe and type:
      winget.exe
      Do you get any output?

    • @hectorhenriquez6105
      @hectorhenriquez6105 5 месяцев назад

      As administrator not when executing Winget it comes out that it does not exist. but as normal user if. validating the route "C:\Program FilesWindowsApps Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe as adminsitrador this the file winget.exe. @@IntuneVitaDoctrina

    • @hectorhenriquez6105
      @hectorhenriquez6105 5 месяцев назад

      As administrator not when executing Winget it comes out that it does not exist. but as normal user if. validating the route "C:\Program FilesWindowsApps Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe as adminsitrador this the file winget.exe. .. Error Error al ejecutar el programa 'winget.exe': Acceso denegadoEn línea: 12 Carácter: 27
      + ... dSoftware = .\winget.exe list -e --id $AppID --accept-source-agreemen ...@@IntuneVitaDoctrina

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  5 месяцев назад

      I see one errors, it is missing a '\' between:
      "C:\Program Files
      AND
      WindowsApps Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe
      Check if it is not missing there and it could be it

    • @hectorhenriquez6105
      @hectorhenriquez6105 5 месяцев назад

      @@IntuneVitaDoctrina I can't get it to work any time. I have three virtual machines, one works, the other two don't. If you install it from PowerShell directly everything works. but it doesn't work from the company portal. :(