Skip to content

Add missing PIM Group Policy: Export, Import, Backup, Copy - #262

Draft
kayasax with Copilot wants to merge 2 commits into
mainfrom
copilot/review-code-base-for-features
Draft

Add missing PIM Group Policy: Export, Import, Backup, Copy#262
kayasax with Copilot wants to merge 2 commits into
mainfrom
copilot/review-code-base-for-features

Conversation

Copilot AI commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

PIM Groups lacked the full policy management surface available for Azure Resources and Entra Roles. Export, Import, Backup, and Copy operations were absent, making group policy automation and DR workflows impossible.

New public functions

  • Export-PIMGroupPolicy – Export member/owner policy to CSV, by group ID or display name
  • Import-PIMGroupPolicy – Apply policy settings from a CSV back to the Graph API
  • Backup-PIMGroupPolicy – Enumerate all tenant PIM group policy assignments and dump to CSV
  • Copy-PIMGroupPolicy – Clone policy from a source group to one or more target groups

New internal helper

  • Import-GroupSettings – Mirrors Import-EntraRoleSettings; reads CSV rows, builds rule fragments via existing Set-* helpers, resolves PolicyID (from CSV or via Graph fallback on GroupID+RoleName), and patches via Update-EntraRolePolicy

Module registration

Both EasyPIM.psm1 and EasyPIM.psd1 updated to export the four new public functions.

Usage

# Export member policy of a specific group
Export-PIMGroupPolicy -tenantID $tid -groupID $gid -type member -path ./group-backup.csv

# Restore it
Import-PIMGroupPolicy -tenantID $tid -path ./group-backup.csv

# Backup all PIM-enabled groups in the tenant
Backup-PIMGroupPolicy -tenantID $tid -path ./all-groups.csv

# Clone policy from one group to others
Copy-PIMGroupPolicy -tenantID $tid -groupID $gid2,$gid3 -type member -copyFrom $gid1
Original prompt

Please review code base and asses if there is a killer feature that could be missing here?


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: kayasax <1241767+kayasax@users.noreply.github.com>
Copilot AI changed the title [WIP] Assess code base for potential missing features Add missing PIM Group Policy: Export, Import, Backup, Copy Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants