Connect-XdrByBrowser
SYNOPSIS
Authenticates to Microsoft Defender XDR using an interactive browser sign-in.
SYNTAX
Connect-XdrByBrowser [[-Username] <String>] [[-TenantId] <String>] [[-TimeoutSeconds] <Int32>]
[[-BrowserPath] <String>] [[-ProfilePath] <String>] [-ResetProfile] [-PrivateSession] [[-UserAgent] <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Launches a dedicated Chromium-based browser profile, waits for you to complete the browser sign-in flow, captures the resulting authentication cookies, and establishes the Defender XDR session.
This browser-driven flow is intended for interactive authentication branches such as FIDO2/passkeys and Temporary Access Pass.
By default the cmdlet uses a dedicated secondary Chromium profile named XDRInternals so browser and device state can participate in authentication without reusing the user's primary profile. That dedicated profile is configured to open cleanly instead of restoring tabs from previous runs.
On macOS and Linux, this cmdlet remains interactive. Complete any browser prompts until Microsoft Defender XDR finishes loading so the cmdlet can capture the final session cookies.
EXAMPLES
EXAMPLE 1
Connect-XdrByBrowser -Username 'admin@contoso.com'
Launches the browser sign-in flow and connects to Defender XDR.
PARAMETERS
-Username
Optional username to display while completing the browser sign-in. If omitted, the browser sign-in flow lets you choose an account interactively.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-TenantId
Optional tenant ID to use when bootstrapping the Defender XDR session.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-TimeoutSeconds
Maximum time to wait for the browser sign-in to complete.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 300
Accept pipeline input: False
Accept wildcard characters: False
-BrowserPath
Optional browser executable path or command name. When omitted, a supported Chromium-based browser is auto-discovered.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProfilePath
Optional dedicated browser user data directory. When omitted, a default secondary profile location is used for the XDRInternals profile.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ResetProfile
Clears the dedicated browser profile before launching the sign-in flow.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-PrivateSession
Uses a temporary private/incognito browser session instead of the default dedicated profile.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-UserAgent
Optional User-Agent override for the launched browser.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
The ProgressAction parameter is a common parameter, not a cmdlet parameter. For more information, see about_CommonParameters.
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.