Microsoft Entra ID via PowerShell
Runs nc-export-entra.ps1 in live mode — it calls Microsoft Graph
directly on your behalf and skips exporting JSON by hand. If you would
rather not install anything, use the
Graph Explorer path instead; both produce the
same output file.
Read the privacy statement first if you have not already — this page assumes you know what the script does and does not send.
Get the script
Download nc-export-entra.ps1 and verify its checksum
against the downloads page before you run it.
Run it
You need: PowerShell 7+ (pwsh), the Microsoft Graph PowerShell SDK
(Install-Module Microsoft.Graph), and an account that can consent to three
read-only Graph scopes. Depending on your tenant's consent settings, an
administrator may need to grant or pre-approve them.
-
Unblock the script (Windows). The script is unsigned and a browser download is marked as from the internet, so PowerShell's default execution policy blocks it until you run this after checking the checksum:
Unblock-File .\nc-export-entra.ps1 -
Run the script from the folder you downloaded it into. It calls Microsoft Graph for you, so there is nothing to export by hand.
pwsh ./nc-export-entra.ps1 -OutDir ./out -
Sign in and consent when prompted. The script asks for exactly
User.Read.All,Application.Read.AllandDirectory.Read.All, and fails loudly if your tenant's consent flow drops one, rather than exporting a partial result.
You will be prompted to sign in and consent the first time. No other flags are required for live mode.
What it asks for, and why
Live mode requests exactly these three delegated scopes — no more:
| Scope | Why |
|---|---|
User.Read.All | Resolve the users behind each grant |
Application.Read.All | Resolve the OAuth clients (apps) behind each grant |
Directory.Read.All | Read oauth2PermissionGrants and app-role assignments across the directory |
Nothing broader than read access to the directory objects the report needs. After you consent, the script checks that all three were actually granted — if your tenant's consent flow silently dropped one, it fails loudly rather than exporting a partial result and letting you believe it was complete.
What you'll see
On success, the script prints a summary and then its closing line:
Skipped rows: 0
Nothing has been sent anywhere. Review discover-export.ndjson, then upload it in the Discover app.
Skipped rows is always printed, even when it is 0 — a row with a
missing or unresolvable identity field is skipped with a warning rather
than silently dropped, and this line is how you'd know.
After it finishes
- Open
./out/discover-export.ndjsonand read it. It is plain newline-delimited JSON — see the export format page if you want the exact field-by-field shape. - Leave
./out/mapping.csvand./out/salt.txtwhere they are. Neither is meant to leave your machine — see the privacy statement for what they're for. - In the setup wizard's Scan step, under Export file
(discover-export.ndjson), click Choose file, select
discover-export.ndjson, then click Upload.
The upload flow is live in Discover; a screenshot of this step is still being prepared and will be added here.