I'm using on-prem SQL 2022 enterprise edition.

SQL vulnerability assessment option is taken out from SSMS 19.1 onwards.

I'm reading that this feature is now part of defender for cloud.

If anyone has tried this then is this free? And do I need to ask by Azure admin to setup defender for cloud now just to be able to do SQL vulkerabity assessment?

1 Answer 1


it's gone from SSMS, but you can still do it thru PowerShell fortunately, at least so far.

Step by step:

1. Install-Module -Name SqlServer
2. Invoke-SqlVulnerabilityAssessmentScan      `
        -ServerInstance "yourServer\Instance" `
        -Database "yourDB"                    `
        -ScanId "MyScanID"                    `
   | Export-SqlVulnerabilityAssessmentScan    `
        -FolderPath "C:\path\ScanResult.xlsx"

You can find the other commands (to create a baseline and use it,etc) here: https://learn.microsoft.com/en-us/archive/blogs/sqlsecurity/powershell-cmdlets-for-managing-sql-vulnerability-assessments)

  • 1
    Thanks for this. I was hoping they'd put it into the Azure data studio but couldn't find it there.
    – variable
    Oct 13, 2023 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.