POWERSHELL COMMAND
Get-XdrIdentityOnboardingStatus
Retrieves the onboarding status of Microsoft Defender for Identity.
Gets the onboarding status of Microsoft Defender for Identity (MDI) for the current tenant. Returns a boolean value indicating whether MDI is onboarded or not. This function includes caching support with a 30-minute TTL to reduce API calls.
Syntax
Get-XdrIdentityOnboardingStatus [-Force] [<CommonParameters>]
Parameters
-Force
| Property | Value |
|---|---|
| Type | SwitchParameter |
| Required | No |
| Position | named |
| Pipeline input | No |
| Default | False |
Bypasses the cache and forces a fresh retrieval from the API.
Examples
Get-XdrIdentityOnboardingStatus
Retrieves the MDI onboarding status using cached data if available.
Get-XdrIdentityOnboardingStatus -Force
Forces a fresh retrieval of the MDI onboarding status, bypassing the cache.
if (Get-XdrIdentityOnboardingStatus) {
Write-Host "Microsoft Defender for Identity is onboarded"
}
Checks if MDI is onboarded and displays a message.
Output
Type: Boolean
Returns $true if Microsoft Defender for Identity is onboarded, $false otherwise.