EasyPIM is a PowerShell module created to help you manage Microsof Entra Privileged Identity Management (PIM).
Packed with more than 30 cmdlets, EasyPIM leverages the ARM and Graph APIs complexity to let you configure PIM Azure Resources, Entra Roles and groups settings and assignments in a simple way .
🆕 V1.7 comes with 6 cmdlets to approve or deny Entra and Azure role approvals.
💥 Support editing multiple roles at once
💥 Copy settings from one role to another
💥 Export role settings to csv
💥 Import role settings from csv
💥 Backup all roles
💥 New in V1.6 get PIM activity reporting
💥 New in V1.7 Approve/Deny pending requests
With the export function you can now edit your PIM settings in Excel then import back your changes 😉
This module is available on the PowerShell gallery: https://www.powershellgallery.com/packages/EasyPIM, install it with:
Install-Module -Name EasyPIM
Updating from an older version:
Update-Module -Name EasyPIM
Note: EasyPIM manage PIM Azure Resource settings at the subscription level by default : enter a tenant ID, a subscription ID, a role name
then the options you want to set, for example require justification on activation.
If you want to manage the role at another level (Management Group, Resource Group or Resource) please use the scope
parameter instead of the subscriptionID
.
🔷 Get configuration of the Azure Resources roles reader and Webmaster
Get-PIMAzureResourcePolicy -TenantID $tenantID -SubscriptionId $subscriptionID -rolename "reader","webmaster"
🔷 Require justification, ticketing and MFA when activating the Entra Role testrole
Set-PIMEntraRolePolicy -tenantID $tenantID -rolename "testrole" -ActivationRequirement "Justification","Ticketing","MultiFactorAuthentication"
🔷 Require approval and set approvers for Azure roles webmaster and contributor
Set-PIMAzureResourcePolicy -TenantID $tenantID -SubscriptionId $subscriptionID -rolename "webmaster","contributor" -Approvers @(@{"Id"="00b34bb3-8a6b-45ce-a7bb-c7f7fb400507";"Name"="John";"Type"="user"}) -ApprovalRequired $true
🔷 Set maximum activation duration to 4h for the member role of a group
Set-PIMGroupPolicy -tenantID $tenantID -groupID "ba6af9bf-6b28-4799-976e-ff71aed3a1bd" -type member -ActivationDuration "PT4H"
🔷 Get a reporting of the PIM activities based on Entra ID Audit logs
$r=Show-PIMReport -tenantID $tenantID
🔷 List all eligible assignments for Azure roles
Get-PIMAzureResourceEligibleAssignment -tenantID $tenantID -subscriptionID $subscriptionId
🔷 Create an active assignment for a principal and the Entra role testrole
New-PIMEntraRoleActiveAssignment -tenantID $tenantID -rolename "testrole" -principalID $groupID
More samples available in the documentation
- Az.Accounts module
- Permission: The PIM API for Azure resource roles is developed on top of the Azure Resource Manager framework. You will need to give consent to Azure Resource Management but won’t need any Microsoft Graph API permission. You will also need to make sure the user or the service principal calling the API has at least the Owner or User Access Administrator role on the resource you are trying to administer.
- an administrator must grant consent these permissions to the Microsoft Graph PowerShell application:
"RoleManagementPolicy.ReadWrite.Directory", "RoleManagement.ReadWrite.Directory", "RoleManagementPolicy.ReadWrite.AzureADGroup", "PrivilegedEligibilitySchedule.ReadWrite.AzureADGroup", "PrivilegedAssignmentSchedule.ReadWrite.AzureADGroup", "PrivilegedAccess.ReadWrite.AzureADGroup"