microsoftgraph / powershell-intune-samples

This repository of PowerShell sample scripts show how to access Intune service resources. They demonstrate this by making HTTPS RESTful API requests to the Microsoft Graph API from PowerShell.
MIT License
1.36k stars 657 forks source link

Application_MDM_Get #L437 -GroupID intead of -id #238

Open n-ster opened 1 year ago

n-ster commented 1 year ago

L437 write-host "AAD Group:"(Get-AADGroup -id $Assignment.target.GroupId).displayName "- Install Intent:"$Assignment.intent

fix: write-host "AAD Group:"(Get-AADGroup -GroupID $Assignment.target.GroupId).displayName "- Install Intent:"$Assignment.intent

Was getting errors and simply changing it to -GroupID fixed it for me, can't comment on why or whether this issue requires a better fix, but worked for me!

1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP commented 1 year ago

I added Remove-Item Alias:GetAADGroup -ErrorAction SilentlyContinue at the start of the script.