View Access Packages assigned to a list of users supplied via a CSV file.

Dan Peters 51 Reputation points
2025-01-07T17:08:49.56+00:00

Hello, Is there a way to use graph (or any other command line utility) to view the Azure Access Packages assigned to a list of users that is provided by a CSV file?

something like:

$users = import-csv c:\files\userlist.csv

Get-MgEntitlementManagementAssignment $users |export-csv c:\files\UserswithAccessPackages.csv

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,357 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 116K Reputation points MVP
    2025-01-07T18:26:37.6+00:00

    Sure, you should be able to use something like this:

    Connect-MgGraph -Scopes EntitlementManagement.Read.All
    
    Import-Csv c:\files\userlist.csv | % { Get-MgBetaEntitlementManagementAccessPackageAssignment -Filter "target/objectid eq $($_.ID)" }
    

    where the c:\files\userlist.csv CSV file should contain a column ID with the GUID of the user. If you want to use a property such as the UPN, you will have to resolve the value first to a GUID, as the resource does not support filtering by UPN.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.