Forum Discussion
Mihes1735
Mar 20, 2024Copper Contributor
Is there a way to imediatly install an application to an enroled VM through Intune?
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?
- SebastiaanSmitsSteel Contributor
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-rest-1.0
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-rest-beta#properties
- Mihes1735Copper ContributorThe 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.
- SebastiaanSmitsSteel Contributor
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..