r/PowerShell • u/Suspicious_Rest4713 • 17d ago
Script Sharing HybridScope – a WPF GUI that merges AD + Exchange on-prem + Microsoft 365 into one RVTools-style inventory (read-only, PS 5.1)
EDIT – v1.7.0 is out: HybridScope now also reads Microsoft Defender (Business Premium / Defender for Business): per user and PC, vulnerabilities, missing KBs, software to update and a prioritized fix list. Plus an MFA fix. Details in the comments / release notes.
I'm a sysadmin in a hybrid environment (Exchange 2019 + AD + Microsoft 365) and every time someone asked "how many mailboxes are still on-prem, how big are they, who has MFA, which licenses are wasted?" I ended up exporting three CSVs from three consoles and merging them in Excel by hand.
So I built HybridScope: one window, three sources, one merged view per user.
What it does
- Pulls users from Active Directory, mailboxes from Exchange on-prem (
Get-Mailbox,Get-MailboxStatistics,Get-RemoteMailbox) and licenses / sign-ins / OneDrive / MFA from Microsoft Graph - Tells you where each mailbox really lives (
ON-PREM/365/NO MAILBOX) based on Exchange and GraphprovisionedPlans, not on mailbox size - Real MFA status: registered methods, default method, legacy per-user state
- RVTools-style tabs: Overview per OU, Users, Mailboxes on-prem / 365, OneDrive, MFA, Tenant licenses, an "Attention" list (on-prem mailboxes to migrate, licensed users without MFA, licenses on disabled accounts, inactive accounts)
- 5 infrastructure modes with one click: Full Cloud / Full Hybrid / Hybrid (365 + AD) / On-Prem (Exchange + AD) / AD only
- Export to formatted XLSX (ImportExcel) or CSV, all tabs or just the filtered current tab
-Autoswitch for scheduled reports with certificate auth + history tracking- English / Italian UI
Some implementation details you might find interesting
- Windows PowerShell 5.1, single
.ps1, WPF built from XAML - All the heavy lifting runs in a persistent background runspace, so the UI never freezes; log lines come back through a
ConcurrentQueuepolled by aDispatcherTimer. There's a Stop button (BeginStop()on the running pipeline) - Only
Microsoft.Graph.Authenticationis needed: everything goes throughInvoke-MgGraphRequestwith manual paging, no giant SDK install - Exchange via implicit remoting (
Import-PSSession, Kerberos), works from non-domain-joined PCs with explicit credentials - Read-only: it never writes anything to AD, Exchange or the tenant
Repo: https://github.com/Thonno/hybridscope (MIT)
HybridScope - Active Directory, Exchange and Microsoft 365 user report (PowerShell)
Screenshots are in the README (sensitive data blurred).
Full disclosure: I wrote it with a lot of help from an AI assistant and tested it on our own environment, so I'm sure there are edge cases I haven't hit yet. Feedback, issues and PRs are very welcome, especially from people with different setups (multiple Exchange orgs, big tenants, cloud-only).
2
u/BlackV 17d ago
Quick look
$global:HS_MethodNames) a global variable ?$m/$p/$r/etc (and any other single letter variables) clear as mud, is this the$pfrom your splat or the$pfrom your perms1
u/Suspicious_Rest4713 12d ago
Hi all, 1.6.0 released.
What's new / Novità
Export: FULL, presets or custom columns
Dynamic load
Command line
-ExportPreset <name>and-Columns <list>, e.g..\HybridScope.ps1 -Auto -Columns Username,AD_LastLogon,M365_LastSignInAutoExportPreset,ExportFastLoad.Icon
tools\Build-Exe.ps1sets the icon and the version in the exe properties. The exe contains the script: rebuild it after every update.Full details: CHANGELOG
1
u/Suspicious_Rest4713 11d ago
Update – v1.7.0: security with Microsoft Defender
Bought Business Premium? HybridScope now reads Defender for Business / Defender for Endpoint and shows user → PC → what to fix:
Also fixed: MFA % showing 0 for AD users (bug in 1.6.0).
Release: https://github.com/Thonno/hybridscope/releases/latest Setup guide: https://github.com/Thonno/hybridscope#microsoft-defender-security
Feedback welcome, especially from anyone with more PCs onboarded than my test tenant 🙂
1
u/Suspicious_Rest4713 6d ago
Update – v1.8.0-1.8.1
CheckUpdatesAtStartup(defaulttrue); not used by-Auto1
u/Belcia_Baeseler 16d ago
Respect for actually wiring up a persistent background runspace with a queue instead of letting the WPF window freeze for ten minutes. How are you matching the identities across the three sources, just anchoring on UPN or falling back to ImmutableId / GUIDs when UPNs dont match?