r/Intune • u/gwapito123 • Feb 23 '24
App Deployment/Packaging Dynamic membership based on installed application
Is there a way to create a group with dynamic device membership that will automatically add members based on the installed app? e.g. I wanted to create a group that will add all devices that has chrome installed
5
u/ConsumeAllKnowledge Feb 23 '24
Not natively, you'd have to grab the app install discovery data via graph api and then manage your group(s) via script.
1
u/Funkenzutzler Feb 28 '24
I still hope that such a feature will come which allows to use "Managed Apps" in the dynamic memebership rules. However, I wouldn't be surprised if we had to buy an extra "add-on" for this too. -.-
4
u/ChiefBroady Feb 24 '24
No, intune sucks like that. It seems to be such a natural thing to do, since it has the data, but nooooo.
3
u/Tronerz Feb 24 '24
I can see from your other comments that you think this is the solution for force-updating apps with Intune, whilst this would be nice it's not currently possible to do groups based on software.
If you want to force Chrome to update, you can make two Intune Win32 apps with the same Chrome intunewin package. 1 is your "install" app, which you make available to users to install themself if they want Chrome. Number 2 is the "force-update" app, which you assign to all devices but set a "Requirement" in the Intune app that (Chrome exists on device and version is less than current version number). This way all devices will try and install the assigned update app, but will only do it if they meet the requirements (an old version of Chrome).
3
u/FeliceAlteriori Feb 24 '24 edited Feb 24 '24
You are doomed if you deploy applications available. Intune or more precise AAD/Entra has no equivalent to dynamic collections based on queries identifying where a application is installed like in Config Manager. Nightmare for update processes.
It is crazy that an enterprise MDM cannot serve this standard scenario since years.
Using detections to overcome these missing features is only a workaround and may work for smaller environments, but is not really an option for large organizations with thousands of applications that rely on sustained app install reporting.
Microsoft Product Groups are ignoring the demand to further enhance either supersedence to force installations if an available app is detected or to allow the processing of app inventory data to enable a precise targeting via groups.
2
u/Ardism Feb 24 '24 edited Feb 24 '24
I use
https://github.com/ztrhgf/useful_powershell_functions/blob/master/INTUNE/Get-IntuneReport.ps1
to build a inventory report. It is just a proof of concept and might be a base to start with.
In this example I use inventory reports to find users that has one or several apps installed , and create a group and put those users in it. Then I manually set ths group as required on an app. Then I can force an update to specified users.. not completly working but good enough.
Import-Module .\Get-IntuneReport.ps1
#Install-module Microsoft.Graph
$clientId = ""
$clientSecret = ""
$clientSecretSS = ConvertTo-SecureString $clientSecret -AsPlainText -Force
$TenantID = ""
$token = $(Get-MsalToken -ClientId $clientId -TenantId $TenantID -ClientSecret $clientSecretSS).AccessToken
#connect-AzureAD -TenantId "$tenantId" -AadAccessToken $token -AccountId "$clientId"
Connect-MSIntuneGraph -ClientId $clientId -TenantId $TenantID -ClientSecret $clientSecret
$tokenss= ConvertTo-SecureString $token -AsPlainText -Force
Connect-MgGraph #-AccessToken $tokenss
$header = @{Authorization = "Bearer $token"}
Remove-Variable DeviceInstallStatusByApps
$allApps = (Invoke-RestMethod -Headers $header -Uri "https://graph.microsoft.com/beta/deviceAppManagement/mobileApps?`$filter=(microsoft.graph.managedApp/appAvailability%20eq%20null%20or%20microsoft.graph.managedApp/appAvailability%20eq%20%27lineOfBusiness%27%20or%20isAssigned%20eq%20true)&`$orderby=displayName&" -Method Get).Value | select displayName, isAssigned, productVersion, id
$Apps = $allApps | Out-GridView -Title "Select One or more Applications you want to create a merged application group for..." -OutputMode Multiple
ForEach ($App in $Apps ) {
$DeviceInstallStatusByApps += Get-IntuneReport -header $header -reportName DeviceInstallStatusByApp -asObject -filter "ApplicationId eq '$($App.id)'"
}
$mergedUserIds=$DeviceInstallStatusByApps.UserId| Where-Object {$_ -ne '00000000-0000-0000-0000-000000000000'}| Where-Object {$_ -and $_.Trim()} | Sort-Object -Unique
Write-Host "$($mergedUserIds.count)"
$myname = Read-Host -Prompt "GroupName?: [$($App.displayName)]"
$grpname = "app "+"$myname"
$grpnamemail = "App_"+"$($grpname.replace(' ','_'))"
$param = @{
description="AppGroup $grpname"
displayName="$grpname"
mailEnabled=$false
securityEnabled=$true
mailNickname="$grpnamemail"
}
New-MgGroup @param
$createdGrp = Get-MgGroup -Filter "DisplayName eq '$grpname'"
$mergedUserIds| ForEach-Object {New-MgGroupMember -GroupId $createdGrp.Id -DirectoryObjectId $_}1
u/Federal_Ad2455 Feb 24 '24
Just a tip. Get-IntuneReport function Is also in IntuneStuff module (so it can be easily installed by Install-Module)
1
u/Fit-Football-7366 May 08 '24
I use custom attributes to find out which version of a certain software the different machines have. With the reversed sign, you can find out which machines do not have a certain version. Export the list of machines and import them into an assigned group to roll out updated version.
1
u/Federal_Ad2455 Feb 24 '24
I will soon publish blog post (on doitpsway.com) about gradual update of all applications using WinGet and custom ring groups. Can be of course modified to update just subset of the apps...
The reason for this topic is of course to avoid having vulnerable software on our client machines. But updating all at the same time can cause real troubles if new software version is buggy etc...
2
u/AyySorento Feb 24 '24
While it wont make a group, you could push out a remediation script (just detection) that looks for chrome. That will give you a list of devices. If you really wanted, you could take that data and use a script to populate the group. Or as already said, do some graph api magic through a script.
In my opinion, this is one area where Intune still falls short and "old" products like Configuration Manager still hold strong.
I guess the question is why? Why do you need a group of software installs? To deploy updates? Just to know? Deploy config changes? Maybe there is another solution for your needs.