Skip to main content

Invoke-XdrEndpointDevicePolicySync

SYNOPSIS

Forces a policy sync on an endpoint device in Microsoft Defender XDR.

SYNTAX

Invoke-XdrEndpointDevicePolicySync [-DeviceId] <String> [[-Comment] <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Triggers a forced policy synchronization for a managed endpoint device. This is useful when policy changes need to be applied immediately.

EXAMPLES

EXAMPLE 1

Invoke-XdrEndpointDevicePolicySync -DeviceId "abc123"
Forces a policy sync on the specified device.

EXAMPLE 2

Invoke-XdrEndpointDevicePolicySync -DeviceId "abc123" -Comment "Apply new AV exclusions"
Forces a policy sync with a descriptive comment.

PARAMETERS

-DeviceId

The device ID (SenseMachineId) of the target device.

Type: String
Parameter Sets: (All)
Aliases: MachineId, SenseMachineId

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Comment

A comment describing the reason for the policy sync.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: "Force policy sync - Performed by $env:USERNAME via XDRInternals"
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the command runs. The command is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

-Confirm

Prompts for confirmation before making changes.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
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

Object

Returns the API response.

NOTES