r/PowerShell • • 11h ago

Script Sharing I built a free WinForms GUI to see which mailboxes a user can access in Exchange Online (reverse lookup + grant/copy/remove)

17 Upvotes

Hi r/PowerShell,

one thing that always annoyed me as an M365 admin: the Exchange Admin Center only shows permissions per mailbox. There is no quick way to answer "Which mailboxes, calendars and room mailboxes does user X have access to?" – especially during onboarding/offboarding or when someone changes departments.

So I built MailboxAccess, a PowerShell/WinForms tool on top of the EXO v3 module.

What it does

  • Reverse lookup: enter a user → see all mailboxes they have FullAccess, SendAs, SendOnBehalf or folder/calendar permissions on
  • Room mailboxes: includes calendar permissions and booking delegates
  • Grant / copy / remove: add rights, copy all rights from one user to another (onboarding), or remove everything (offboarding)
  • Mailbox view: who has access to a specific mailbox
  • Tenant report: overview of all non-default permissions
  • Fast: results come from a local cache (seconds instead of minutes). The cache can be refreshed incrementally via the Unified Audit Log (delta update), so you don't have to rebuild it every time
  • Runs locally, no server, no cloud service, data stays in `%LOCALAPPDATA%`

Requirements

  • Windows PowerShell 5.1
  • `ExchangeOnlineManagement` module
  • Exchange admin rights (plus "View-Only Audit Logs" for the delta update)

Download

GitHub: https://github.com/RazeAttack/MailboxExchangeGUI

You can run the `.ps1` directly or use the EXE from the releases (built via GitHub Actions, SHA256 checksums included). The EXE is a ps2exe build and not code-signed yet (code signing via SignPath is in progress), so Defender/SmartScreen may complain – if you prefer, just run the script.

MIT licensed, free. Feedback, issues and PRs are very welcome – especially on performance in larger tenants (I've tested it with ~350 mailboxes).

Screenshots are in the README (tenant data redacted).


r/PowerShell • • 17h ago

Question Do Constants give advantages?

16 Upvotes

So, we all know we can make a Constant by using New-Variable -Name 'ImTryingIguess" -Value 'whatever' -Option Constant
(or using Set-Variable the same way)

Question is: does using a constant instead of a regular variable give any advantage?
Like, smaller memory footprint or something?

So far, from what I managed to understand, its only effect is keeping people from altering the variable, which can be very useful with large scripts manned by multiple people, as one might decide to recycle a variable name that should otherwise stay untouched.

I personally prefix any "constant" name with CONST_(i.e.: $CONST_TitleTemplate) which, so far, has been working well, but I was wondering if I was missing some magic powershell shenanigan.