Skip to content

Instantly share code, notes, and snippets.

@Stuart-Moore
Last active March 29, 2020 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stuart-Moore/2f37f4ac000139be42461611ee95deb6 to your computer and use it in GitHub Desktop.
Save Stuart-Moore/2f37f4ac000139be42461611ee95deb6 to your computer and use it in GitHub Desktop.
dbaSecurityScanBasics - blog post 29/03/2020
Import-module DssSecurityScan
--Create config and test against a new database
$config = New-DssConfig -SqlInstance server1\sql2017 -Database oldProd
Invoke-DssTest -SqlInstance server2\sql2019 -Database newProd -Config $config
--Save a config, and then use it audit after a change
New-DssConfig -SqlInstance server1\sql2017 -Database oldProd -ConfigPath ~/git/dbSourceControl/permissions.json
Start-Sleep -Seconds 10080
$config = ConvertFrom-Json -InputObject (Get-Content ~/git/dbSourceControl/permissions.json -raw)
Invoke-DssTest -SqlInstance server2\sql2019 -Database newProd -Config $config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment