Forum Discussion
energy_0
Sep 20, 2024Copper Contributor
Powershell - Change Intune Application Assignments
 Hello,     I'd like to bulk-edit a number of my Intune Win32 assignments. I've got ~30 applications to go through, but I've noted their AppIDs so it would be worth the time investment to find a worki...
KathleenRingberg
Apr 23, 2025Copper Contributor
Create an app registration 
______________________________________________________
# Configuration
$TenantId = ""
$ApplicationId = ""
$ClientSecretValue = ""
# Convert the client secret to a secure string
$pass = ConvertTo-SecureString -String $ClientSecretValue -AsPlainText -Force
# Create a credential object using the client ID and secure string
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $pass
# Connect to Microsoft Graph with Client Secret
Connect-MgGraph -TenantId $TenantId -ClientSecretCredential $cred
# Group ID - Get the ID of the group
$groupID = 'GroupID' 
# App IDs - list all app ids
$AppIDs = @('')
# Create a hashtable for the Target parameter
$target = @{
    "@odata.type" = "#microsoft.graph.groupAssignmentTarget"
    "groupId" = $groupID
}
# Assign apps to the group
foreach ($AppId in $AppIDs) {
    New-MgDeviceAppManagementMobileAppAssignment -MobileAppId $AppId -Intent 'available' -Target $target
}