To list security recommendations in Microsoft Defender, query the DeviceTvmSecureConfigurationAssessment table in advanced hunting for the configurations devices fail, joined to its knowledge base for each one's name and risk. That gives the configuration recommendations; the software update recommendations come from the vulnerable software on each device. Both are part of Defender Vulnerability Management's core capabilities, which come with Defender for Endpoint Plan 2.
| Method | Best fit |
|---|---|
| PowerShell | A CSV of failed security configurations, with how many devices each one exposes. |
| Admin centre | Working through recommendations in the Defender portal, ranked by their impact. |
| Altivane | Recommended for recurring reviews, with every recommendation, software and configuration, in a workbook. |
Before you start
Use an account that can run advanced hunting in the Microsoft Defender portal. The PowerShell example requests ThreatHunting., the permission the hunting API needs; your organisation may require administrator consent. The tables are filled by Defender for Endpoint, so only onboarded devices appear, and Microsoft says advanced hunting isn't part of Defender for Business.
Microsoft says a configuration change can take 4 to 24 hours to show, and a software change about 2 hours. The examples read and export and change nothing.
Option 1
List security recommendations with PowerShell
Install the module once, then connect, run the query through Microsoft Graph and export the rows.
# Install once, if the module is not already installed.
Install-Module Microsoft.Graph.Authentication -Scope CurrentUser$ErrorActionPreference = 'Stop'
Connect-MgGraph -Scopes 'ThreatHunting.Read.All' -NoWelcome
try {
# Each failed, applicable configuration, with its name and risk from the knowledge base
$query = 'DeviceTvmSecureConfigurationAssessment' +
' | where IsApplicable == 1 and IsCompliant == 0' +
' | summarize ExposedDevices = dcount(DeviceId)' +
' by ConfigurationId, ConfigurationCategory' +
' | join kind=leftouter (DeviceTvmSecureConfigurationAssessmentKB' +
' | project ConfigurationId, ConfigurationName,' +
' RiskDescription, ConfigurationImpact)' +
' on ConfigurationId' +
' | order by ConfigurationImpact desc, ExposedDevices desc'
$columns = 'ConfigurationName', 'ConfigurationCategory', 'ConfigurationImpact',
'ExposedDevices', 'RiskDescription', 'ConfigurationId'
$body = @{ Query = $query } | ConvertTo-Json
$uri = 'https://graph.microsoft.com/v1.0/security/runHuntingQuery'
$request = @{ Method = 'POST'; Uri = $uri; Body = $body; ContentType = 'application/json' }
$response = Invoke-MgGraphRequest @request
$rows = @($response.results | ForEach-Object { [pscustomobject]$_ } |
Select-Object $columns)
if ($rows.Count -eq 0) {
Write-Output 'Advanced hunting returned no failed security configurations.'
} else {
$file = './security-recommendations.csv'
$rows | Export-Csv -Path $file -NoTypeInformation -Encoding utf8
Write-Output "$($rows.Count) configuration recommendations written."
}
} finally {
Disconnect-MgGraph | Out-Null
}The CSV has 1 row for each configuration that at least 1 device fails, the highest impact first, then the most devices exposed. ConfigurationImpact is Microsoft's rating of its effect on the configuration score, from 1 to 10. To narrow it to an area, add a line after the first, such as ' | where ConfigurationSubcategory == "Antivirus"' +, with the value in double quotes because the query is in single quotes. For the software update recommendations, query the vulnerable software instead.
Option 2
Review recommendations in the Defender portal
- Sign in to the Microsoft Defender portal for the correct tenant.
- Go to Endpoints > Vulnerability management > Recommendations. In the newer layout it's Exposure management > Recommendations.
- Read each recommendation's exposed devices, impact, remediation type and status, and add the Category filter to narrow the list.
- Select a recommendation for its details. Leave Remediation options and Exception options alone: they create a remediation request in Intune or an exception.
This suits working through the recommendations in Microsoft's order, with the effect each would have on your exposure score. For a list to keep and compare from one month to the next, use PowerShell or Altivane.
Option 3 ยท Recommended for recurring reviews
Report on security recommendations with Altivane
- Open Altivane and choose the tenant.
- Run the Security Recommendations report.
- Open the tenant's Excel workbook and find the Security recommendations table: each recommendation, active first, then the most severe and most exposed, with its product, category, severity score, exposed devices, exposure and configuration impact, public exploit, active alert, fix and status.
- For the most severe active recommendations beside device health and antivirus, run the Defender for Endpoint report and read Top Security Recommendations.
Altivane reads Defender for Endpoint's own list of recommendations, so software updates and configuration changes come in 1 table, as the portal shows them. The report needs a tenant signed in with a certificate and licensed for Defender Vulnerability Management.
Contact usCommon questions
Why is a recommendation I fixed still listed?
Microsoft says configuration changes can take 4 to 24 hours to show, and software changes typically 2 hours. Check again the next day before you follow it up with the device's owner.
Why is a recommendation marked as an exception?
Someone created an exception for it. Microsoft says a recommendation with an exception is no longer active, and its state changes to Full exception or Partial exception for some device groups.
Why is a vulnerable program missing from the recommendations?
Microsoft leaves out software that has no security update available, so a CVE tagged No security update has no recommendation. It still shows in the list of vulnerabilities your devices are exposed to; see how to list vulnerable software in Microsoft Defender.
Microsoft references
Technical references checked on 7 November 2026. The example scripts have been reviewed and syntax checked; they have not been run against a live tenant.