Skip to content

Get-IntuneRemediationDeviceStatus

SYNOPSIS

Retrieves per-device run state and pre/post remediation output for a specific Intune proactive remediation.

SYNTAX

ByName (Default)

Get-IntuneRemediationDeviceStatus -Name <string> [<CommonParameters>]

ById

Get-IntuneRemediationDeviceStatus -Id <string> [<CommonParameters>]

ALIASES

This cmdlet has the following aliases, {{Insert list of aliases}}

DESCRIPTION

Queries Microsoft Graph (beta) for the device run states of a proactive remediation script (device health script). Returns one row per device, including the detection and remediation states and the captured pre/post-remediation detection script output.

Requires an authenticated Graph session with appropriate scopes.

Scopes (minimum): - DeviceManagementConfiguration.Read.All

EXAMPLES

EXAMPLE 1

Connect-MgGraph -Scopes "DeviceManagementConfiguration.Read.All" Get-IntuneRemediationDeviceStatus -Name "BitLocker*"

Returns per-device run states for all remediations whose name starts with "BitLocker".

EXAMPLE 2

Get-IntuneRemediationDeviceStatus -Id "f1f5d1d7-2d2b-4d8c-9f0a-0d2a3d1e2f3a"

Returns per-device run states for the remediation with the specified ID.

EXAMPLE 3

Get-IntuneRemediationSummary | Where-Object WithIssues -gt 0 | Get-IntuneRemediationDeviceStatus

Pipes remediations that have devices with issues into this cmdlet to get device-level detail.

PARAMETERS

-Id

The ID (GUID) of the device health script (remediation) to query. Parameter set: ById.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- RemediationId
ParameterSets:
- Name: ById
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name

The display name of the remediation script. Supports wildcards (*). When multiple scripts match, all are processed. Parameter set: ByName.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- RemediationName
ParameterSets:
- Name: ByName
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String (Name or Id via pipeline by property name)

{{ Fill in the Description }}

System.String

{{ Fill in the Description }}

OUTPUTS

PSCustomObject with the following properties

  • RemediationName (string) : Display name of the remediation script
  • RemediationId (string) : GUID of the device health script
  • DeviceId (string) : Managed device ID
  • DeviceName (string) : Managed device display name
  • UserPrincipalName (string) : Primary user UPN of the device
  • LastStateUpdate (datetime / null): When the run state was last updated
  • DetectionState (string) : Outcome of the last detection script run
  • RemediationState (string) : Outcome of the last remediation script run
  • PreRemediationOutput (string) : stdout captured before remediation ran
  • PostRemediationOutput (string) : stdout captured after remediation ran
  • DetectionOutput (string) : Detection-only script stdout
  • PreRemediationError (string) : stderr captured before remediation ran
  • RemediationError (string) : stderr from the remediation script
  • DetectionError (string) : stderr from the detection script

{{ Fill in the Description }}

System.Management.Automation.PSObject

{{ Fill in the Description }}

NOTES

Author: FHN & GitHub Copilot - Uses /beta Graph endpoints. - Expands managedDevice to include DeviceName and UserPrincipalName inline.

{{ Fill in the related links here }}