Tech Community Live: Microsoft Intune
Oct 01 2024, 07:30 AM - 11:30 AM (PDT)
Microsoft Tech Community

Is there a way to imediatly install an application to an enroled VM through Intune?

Copper Contributor

To set a little bit of context
We are testing if the application installs on VM that was automatically created by us and reporting the successful installation of the app in a central DB. All the steps involved are done programmatically

We want to do the same test with applications that are in Intune.
The questions are:
1. If I know the application ID from Intune, can I immediately initiate an installation of the app to a VM? This triggering can be done from the VM itself or from an Intune API, whatever is easier to be done.
2. I would like to know if the application installation was successful or not? So for this I have to know that there was an installation attempt and what was the result of this attempt?

5 Replies

@Mihes1735 

 

 

Not completely sure what type of app you are creating. But if you are using Intune to deploy the apps it is in principle most convenient to use the Graph API and create a scrip that uses the Graph Api. 

 

1. This one you can accomplish by assigning the app to a group, you do this by app id indeed, see here: https://learn.microsoft.com/en-us/graph/api/intune-shared-mobileapp-assign?view=graph-rest-beta and use the GroupAssignmentTarget: https://learn.microsoft.com/en-us/graph/api/resources/intune-shared-groupassignmenttarget?view=graph...

 

2. This is difficult if you like to get some actual installation conformation but it is possible to query the device and verify if the apps is indeed installed after step 1 is completed by using the MobileAppInstallStatusResource: https://learn.microsoft.com/en-us/graph/api/resources/intune-apps-mobileappinstallstatus?view=graph-...

The app is already exported to Intune as an intuwin file. I'm not asking about how to export an application. I'm asking how to trigger the installation of a certain app, known by it's Id and get a notification when the app was installed. For us would be more convenient to do it like in case of winget: winget install <the_package_id>. If we can achive the command by a power shell script is even better.

Hi I showed you that (at least a method) by assigning the app to a group (dynamic or static) see the first link and read it carefully, you can do this with Powershell, there are no direct cmdlets but use the Rest Api method as described in the link, you can further script assignment to groups also very easy..

And point 2 is for getting the installation confirmation, is limited but is no direct easy method, did you read my comment at all ? 🙂
Yes I read your comments and i know that we can use the Graph Api methods to monitor if the installation was successful but from our investigation we found thet there is an ammount of time that can be even hours, between assignning an app to an group, forcing a refresh on the target VM and the installation itself.
My question is if will do a force refresh as it is explained here: https://cloudinfra.net/how-to-force-intune-sync-using-powershell/ does this installs the application imediatly? Or just sync's the metadata of the app's that has to be installed on the target VM and than the target VM will ask for the app installation itself? Why i'm asking this is because we are monitoring the process that does the installation and I have to know when the installation starts and when it finishes on the target VM.