← All XDRInternals commands

POWERSHELL COMMAND

Set-XdrConnectionSettings

Creates XDR connection settings using authentication cookies.

View source ↗

Creates global session and headers variables for XDR API calls using the provided sccauth value and optionally an XSRF token value. If xsrf is not provided, the function will bootstrap the session against security.microsoft.com to obtain XSRF-TOKEN automatically.

Syntax

Set-XdrConnectionSettings -SccAuth <Object> [-Xsrf <Object>] [-TenantId <Object>] [<CommonParameters>]

Set-XdrConnectionSettings -WebSession <Object> [-TenantId <Object>] [<CommonParameters>]

Set-XdrConnectionSettings -ResetWebSession [-TenantId <Object>] [<CommonParameters>]

Parameters

-SccAuth

Property Value
Type Object
Required Yes
Position named
Pipeline input No
Default Not documented

The sccauth cookie value from an authenticated session to security.microsoft.com.

-Xsrf

Property Value
Type Object
Required No
Position named
Pipeline input No
Default Not documented

The XSRF-TOKEN cookie value from an authenticated session to security.microsoft.com. If not provided, XSRF-TOKEN is obtained automatically using the provided sccauth and an initial request to security.microsoft.com.

-TenantId

Property Value
Type Object
Required No
Position named
Pipeline input No
Default Not documented

The Tenant ID to use for XDR API requests. If not provided, the Tenant ID will be determined automatically from the XDR portal.

-WebSession

Property Value
Type Object
Required Yes
Position named
Pipeline input No
Default Not documented

An optional WebRequestSession object to use for the requests. If not provided, a new session will be created.

-ResetWebSession

Property Value
Type SwitchParameter
Required Yes
Position named
Pipeline input No
Default False

If specified, resets the existing WebSession by creating a new one while retaining the existing authentication cookies.

Examples

Set-XdrConnectionSettings -sccauth "your_sccauth_value" -xsrf "your_xsrf_value"
Creates XDR connection settings using the provided authentication cookies.
Set-XdrConnectionSettings -sccauth "your_sccauth_value" -TenantId "your_tenant_id"
Creates XDR connection settings and automatically obtains XSRF-TOKEN.

Output

Type: String

Returns a confirmation message when connection settings are created.

View source