I have a lot of scripts. Most of them are for me, written for one situation and adjusted for the next. In the lazy way to bulk access packages, I tried to boil a few of them down into a single script.
While I was writing that post, I kept thinking a module wouldn’t be such a bad idea. Especially with the no-secrets way to govern distribution lists coming up. Bulk-creating access packages for the distribution lists you decide to keep is exactly the kind of job where you want ready-made templates and functions that can batch. Ideally, it’s also something you can automate instead of running by hand.
What I wanted was for my scripts to actually hang together. One function should be able to call another, the output of one should pipe straight into the next, and the plumbing (connecting, batching, retrying, checking IDs, reporting) should be written once instead of in every script. Without giving up the part I care about: being able to deploy things in Entra quickly.
That’s SiSGovernance. (SiS, because every module needs a prefix and naming things is hard. SS didn’t come with the best associations, so I added my middle name: Sandra Irean Saluti.) It’s out now as a first public preview, and it will grow. In this post I’ll walk through what it solves, how it’s built, and why.
TL;DR
- SiSGovernance gathers my Entitlement Management scripts into one tested PowerShell module, starting with access packages.
- Creating a package and changing what it grants are separate jobs, so you can swap a license without touching the approvals.
- It bulk creates, updates and assigns with
-WhatIf, one confirmation, batching and safe re-runs.- It also gets distribution lists into access packages, ready for the Logic App that manages them.
Fifty access packages is where the portal stops being fun
Access packages are, in my opinion, the right way to hand out access in Entra ID. One thing to request, someone to approve it, a review that actually removes people, and an end date that means something. I’m a fan. The problem isn’t the model. It’s what happens the day you have more than a handful of them, and have to choose how to manage them:
| Approach | What it solves | Where it falls short |
|---|---|---|
| Entra admin center | Perfect for one package and one change | Fifty packages is a day of clicking, and there’s no easy way to repeat it |
Microsoft Graph PowerShell (Mg cmdlets) | Every API call, one-to-one | No bulk preview, no batching, and no idea the thing already exists |
| My own scripts | Exactly what that situation needed | Only I knew how to run them safely |
And the moment you script it, you run into Graph’s opinions about how fast you write: roughly 3,000 writes per 2.5 minutes per app and tenant, and if everyone runs the Graph PowerShell app, everyone shares it.
A simple loop finds the throttling limit quickly. Then you get to guess which requests made it.
So I wanted something in between: as fast as a script, as careful as the portal, and the same every time.
Why creating and filling a package are separate
If you take one thing from this post, make it this: an access package is a stable identity, and the resources inside it are swappable content.
The package is what people see. It has a name that follows your naming standard (you have one, right?), a description, policies, approvers and access reviews. Ideally that barely changes, because every change is something you have to explain to someone. What the package grants is a different story. Licenses get upgraded, apps get replaced, and SharePoint sites get reorganized by someone who didn’t tell anyone.

Here’s a baseline license package moving from E5 to E7:
Add-SiSAccessPackageResource -AccessPackageId $apId -GroupId $licE7GroupId Remove-SiSAccessPackageResource -AccessPackageId $apId -GroupId $licE5GroupId
Same package, same name, same approvals. Everyone assigned moves to the new group without being re-approved. And because the new resource goes in before the old one comes out, nobody is without a license in between.
What’s in the box (so far)
Right now there are nine functions in three areas. It’s a start: the beginning of sorting my scripts and making them easier to use (more on what’s next at the end).
| Area | Function | What it does |
|---|---|---|
| Packages and resources | New-SiSAccessPackage | Creates an empty access package in a catalog, and stops if the name already exists there |
Add-SiSAccessPackageResource / Remove-SiSAccessPackageResource | Adds or removes a group, app role or SharePoint site role on one or many packages | |
Get-SiSAccessPackageResourceRole | Lists the roles a resource offers, so you know what to ask for | |
| Assignments | Add-SiSAccessPackageAssignment / Remove-SiSAccessPackageAssignment | Assigns or removes users in bulk, from UPNs, the pipeline, an Excel file or a Graph filter |
Get-SiSGraphUser | Finds users with a Graph filter, to check it before you assign | |
| Distribution lists | Export-SiSDistributionList | Exports every distribution list to Excel for review |
Sync-SiSAccessPackage | Creates, links or updates access packages from that file |
A new package can be piped straight into its first resource:
New-SiSAccessPackage -DisplayName "License - Baseline 5" -Description "Baseline license" `
-CatalogName "Identity - Employee" |
Add-SiSAccessPackageResource -GroupId $groupId
A little paranoia, built in
Better safe than sorry. This is the part nobody will notice when it works. Every function that changes something does the same things in the same order: read, validate, preview, confirm once, change, report. Nothing is touched until everything has been read and checked. If your input has five problems, you hear about all five at once, not one per run, which is a special kind of afternoon.
-WhatIfand-Confirmwork like they do in any Microsoft module.-WhatIfshows exactly what would happen. You’re asked once per run, even when hundreds of objects come down the pipeline, and-Confirm:$falseskips the question when nobody’s there to answer it.- Batching, retry and pacing. Up to 20 requests per Graph call, retries on 429, 503 and 504 that respect
Retry-After, and pauses between write batches that get longer when Graph says it’s close to the limit. I’d rather slow down before the 429s than apologize after them. - No blind resends. If a write gets no answer, the module doesn’t send it again. It might already have worked, and creating the same access package twice is not a fun conversation. It’s reported as outcome unknown, and the next run sorts it out.
- Running it twice is fine. Work that’s already done shows up as
AlreadyAssigned,AlreadyAdded,LinkedorUnchanged, not as an error and not as a duplicate. - Errors behave like PowerShell errors. If the whole run can’t go ahead, you get a real error you can catch. If one user out of four hundred fails, the other 399 carry on, and you get one result per user with a
Status, so the failures are oneWhere-Objectaway.
Distribution lists: the reason this became a module
Distribution lists are where governance goes to retire. Owners who left years ago, and members nobody has looked at since the list was created. Moving them into Entitlement Management means people request them, someone approves, and access reviews take care of the leavers.
There’s a catch: a distribution list can’t be a resource in an access package. So these packages are empty, and the Distribution List Membership Logic App does the actual work, adding and removing list members when an assignment is granted or removed. SiSGovernance does everything before that:
Export-SiSDistributionListexports every list to Excel, with member counts and owners.- You review it with the business or HR: which lists to keep, which belong together, what each package should be called.
Sync-SiSAccessPackagevalidates the whole file, creates or links the packages, writes the IDs back to a new results file, and with-BicepOutputgenerates the mapping the Logic App needs.
And yes, the interface is Excel. On purpose. The people who know which lists matter rarely run PowerShell, and they’re very good at spreadsheets. As a bonus, the file becomes the record of what was decided, which you’ll appreciate the first time someone asks.
Why Excel and not CSV?
I don’t like CSV. Every time I use it, I end up arguing with delimiters that never work, and the formatting going back and forth causes more problems than it solves. Maybe it’s an incompatibility between Sandra and CSV. Either way, thankfully there’s ImportExcel, which reads and writes real Excel files without Excel even being installed.
I’d like to send a rose to Doug Finke, who wrote it and has saved me a fair number of gray hairs.
It shouldn’t need more access than the job
A governance tool that needs Global Administrator to run would be a bit of a contradiction, so I’ve tried hard to make it need as little as possible.
- It never signs in by itself. You connect to Microsoft Graph however suits where it runs: interactively, with a certificate, or with a managed identity in an Azure Function. Each function checks that your connection has what it needs, and if it doesn’t, tells you the exact
Connect-MgGraphcommand to fix it. - Each function asks for the minimum. Reading distribution lists uses
GroupMember.Read.All, notGroup.Read.All. Don’t take my word for it: every Graph API page lists the least privileged permission for its call. - The role matters more than the scope. Use Access package manager or Access package assignment manager on the specific catalog, eligible through PIM. Not Identity Governance Administrator, and definitely not Global Administrator.
- IDs are checked before they go anywhere near a URL. Parameters are typed
[guid], and IDs from Excel are validated row by row. - Text from Entra stays text in Excel. A group called
=HYPERLINK(...)would otherwise become a live formula in a report an admin opens.
Getting started
It runs on Windows PowerShell 5.1 and PowerShell 7, and installs its two dependencies, Microsoft.Graph.Authentication and ImportExcel, for you. Every push runs the Pester tests in both versions, and PSScriptAnalyzer checks the code. The short version:
Install-Module SiSGovernance -Scope CurrentUser -AllowPrerelease Connect-MgGraph -Scopes User.Read.All, GroupMember.Read.All, EntitlementManagement.ReadWrite.All # See what would happen first $upns | Add-SiSAccessPackageAssignment -AccessPackageId $apId -AssignmentPolicyId $policyId -WhatIf # Then for real $upns | Add-SiSAccessPackageAssignment -AccessPackageId $apId -AssignmentPolicyId $policyId
Get-Help about_SiSGovernance gives you the overview, and every function has full help with Get-Help <function> -Full. The documentation in the repository goes through each area properly, including how to run everything unattended. I’d suggest starting with -WhatIf. I still do.
Summary
SiSGovernance is what my Entitlement Management scripts became when they grew up. One module where the pieces fit together, starting with access packages, instead of a folder of scripts that each did their own thing. It bulk-creates packages, swaps their resources, assigns people and gets distribution lists into Entitlement Management.
It’s a preview, and a foundation rather than a finished product. New functions get the same plumbing for free, and there will be more. Assignment policies are first on my list. Today you still create those in the Entra admin center.
If you try it, I’d love to hear what works, what doesn’t, and what you’d want next. Open an issue on GitHub or get in touch. And if it saves you some clicking, I’d like to hear about that too.
- SiSGovernance on GitHub
- SiSGovernance on the PowerShell Gallery
- Microsoft Graph permissions reference
I still prefer my laziness with a little governance around it.
Discover more from Agder in the cloud
Subscribe to get the latest posts sent to your email.

