Blog Post

Microsoft Defender for Cloud Blog
1 MIN READ

Find disabled Security Center Recommendations using PowerShell

Tiander Turpijn's avatar
Nov 22, 2019

If you are using Security Center’s Secure Score today (and you should!), you are able to disable specific recommendations which may not be relevant to you. By navigating to the ASC’s default initiative in the Azure Policy blade, you can disable a recommendation:

This would exclude the recommendation from your Secure Score.

 

But what if you want to quickly find which recommendations have been disabled?

 

Since Azure Policy is the technology behind ASC's recommendations, you can leverage the Az PowerShell module and specifically the AzPolicy* Cmdlets:

 

Using Get-AzPolicyAssignment I can query the ASC Default Initiative:

 

$PolicyAssignment = Get-AzPolicyAssignment | Where-Object {$_.name -eq "SecurityCenterBuiltIn"}

 

 

This captures the information in a variable which we can use to reveal disabled recommendations:

 

$PolicyAssignment.Properties.parameters

 

 

That gives us the following output:

I could then interact further with this assignment using additional PowerShell cmdlets.

Updated Nov 22, 2019
Version 2.0
  • adadsferrg_212's avatar
    adadsferrg_212
    Copper Contributor

    Hi,

    did the commands change, due there is no value now present 

     

     

    Name               : SecurityCenterBuiltIn
    ResourceId         : /subscriptions/45dc14b0-b4dd-4750-b227-7417c175928d/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn
    ResourceName       : SecurityCenterBuiltIn
    ResourceType       : Microsoft.Authorization/policyAssignments
    SubscriptionId     : 45dc14b0-b4dd-4750-b227-7417c175928d
    Properties         : @{displayName=ASC Default (subscription: 45dc14b0-b4dd-4750-b227-7417c175928d); policyDefinitionId=/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-
                         d0c9-4c3d-847f-89da613e70a8; scope=/subscriptions/45dc14b0-b4dd-4750-b227-7417c175928d; parameters=; description=This is the default set of policies monitored by Az
                         ure Security Center. It was automatically assigned as part of onboarding to Security Center. The default assignment contains only audit policies. For more informati
                         on please visit https://aka.ms/ascpolicies; metadata=; enforcementMode=Default}
    Sku                : @{name=A1; tier=Standard}
    PolicyAssignmentId : /subscriptions/45dc14b0-b4dd-4750-b227-7417c175928d/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn