Skip to main content

Connect-XdrBySSO

SYNOPSIS​

Authenticates to Microsoft Defender XDR using browser-based single sign-on.

SYNTAX​

Connect-XdrBySSO [[-TenantId] <String>] [-Visible] [-SkipTenantSelection] [[-TimeoutSeconds] <Int32>]
[[-BrowserPath] <String>] [[-ProfilePath] <String>] [[-UserAgent] <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION​

Starts a dedicated browser profile, attempts silent sign-in using the local browser and operating-system account state, captures Defender portal cookies, and configures the XDR session. This cmdlet is intended for Windows-first SSO scenarios, but it can also reuse existing Chromium browser session state on macOS and Linux when that browser state is already available.

Use -Visible when validating or troubleshooting the flow so you can confirm the browser reaches the Defender portal before the cmdlet captures the resulting session cookies.

EXAMPLES​

EXAMPLE 1​

Connect-XdrBySSO

Attempts browser-based SSO using the default dedicated profile.

EXAMPLE 2​

Connect-XdrBySSO -Visible

Shows the browser window while the SSO flow completes.

PARAMETERS​

-TenantId​

Optional tenant ID (GUID) to select from the authenticated SSO session. If only an ESTS cookie is captured, the requested tenant ID is passed to the ESTS bootstrap step.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Visible​

Shows the browser window instead of using the default headless launch.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-SkipTenantSelection​

Automatically uses the selected tenant or the first available tenant when multiple tenants are available.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-TimeoutSeconds​

Maximum time to wait for SSO authentication to complete.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: 180
Accept pipeline input: False
Accept wildcard characters: False

-BrowserPath​

Optional browser executable path or command name.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProfilePath​

Optional persistent browser profile path used for SSO.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
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: 5
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.

INPUTS​

OUTPUTS​

NOTES​