Microsoft Entra ID PowerShell FIDO2 Provisioning Script for OneSpan FIDO2 FX Series Hardware Authenticators
This PowerShell script allows administrators to pre-provision OneSpan FX7 FIDO2 security keys in Microsoft Entra ID, either for a single user or in bulk via CSV. It registers FIDO2 passkeys on behalf of users using Microsoft Graph and the DSInternals.Passkeys module.
- https://docs.onespan.com/sec/docs/hwrd-fx7-microsoft-entraid-registering-a-passkey-in-entraid-using-powershell
- https://docs.onespan.com/sec/docs/hwrd-fx7-microsoft-entraid-registering-multiple-passkeys-in-entraid-using-powershell-and-csv
- 💠 Supports OneSpan FX7 FIDO2 security keys
- 👤 Register a single user's passkey by UPN and device serial
- 📂 Register multiple users using a CSV file
- 🔐 Verifies key registration via Microsoft Graph Beta endpoint
- 🧩 Uses
DSInternals.PasskeysandMicrosoft.Graph.Beta.Identity.SignInsmodules
- PowerShell 7.x (recommended)
- Microsoft Graph PowerShell SDK
- DSInternals.Passkeys PowerShell module
The script installs missing modules automatically.
The CSV must include a header row:
UPN,SerialID
[email protected],FX7-12345678
[email protected],FX7-87654321
.\entra-id-pre-provision-onespan-fx7.ps1 -TenantId "yourtenant.onmicrosoft.com" -UPN "[email protected]" -SerialID "FX7-12345678".\entra-id-pre-provision-onespan-fx7.ps1 -TenantId "yourtenant.onmicrosoft.com" -CsvFilePath ".\users.csv"You can also run the script interactively and it will prompt for missing values.
- Connects to Microsoft Graph using the provided tenant.
- For each user, checks if a passkey with the given display name already exists.
- If not present, it calls:
Get-PasskeyRegistrationOptionsNew-PasskeyRegister-Passkey
- Verifies registration by querying
Get-MgBetaUserAuthenticationFido2Method.
Processing user [email protected] with OneSpan FX7 serial number FX7-12345678 (1 of 2)...
Passkey registered successfully for user [email protected].
- Display name for each passkey is automatically set to
OneSpan FX7 {SerialID}. - Assumes the administrator running the script has access to a OneSpan FX7 device for signing the passkey.
This script is provided under the MIT License. See LICENSE for details.
Contributions, issues, and feature requests are welcome! Please open an issue or submit a PR.
For enterprise support or integration questions, contact OneSpan.