Azure PIM Admin Report Version 2

Today, I am Sharing the version 2 of the PIM Admin Report Script.

Reason for this another version is because existing scripts that I have previously shared are broken as Microsoft has made changes to the graph beta API.

If any of my followers are using methods in the below blog posts, they need to switch to this new Script.

Extract Report – Azure AD Privileged Identity Management – Part 1 | Tech Wizard

Extract Report – Azure AD Privileged Identity Management – Part 2 | Tech Wizard

This Script utilize the AzureAD preview module (follow the hyperlink for details)

Install the Module using below Command:

Install-module AzureADPreview

Now download the Script from below GIT Link or PowerShell Gallery

Install-Script -Name PIMReportAdminsv2

Run the Script, it will prompt you for TenantID.

How to get TenantID à Log on to
à Azure Active Directory à Properties

Once you will add the tenant id it will ask for the admin credentials to connect to AzureAD and extract all PIM Roles.

It will start extracting all the admins with below fields:

UserPrincipalName :

RoleID : Intune Administrator

AssignmentState : Permanent

StartDateTime :


Reports (CSV) and logs will be shared in respective folders.

Update your PIM script with this new version of you are using the old version.


Thanks for reading and downloading.

Tech Wizard




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s