Forum Discussion
eitan1000
Feb 13, 2022Copper Contributor
Findings all Azure SQL Servers with "Deny public network access" disabled
Hello, I didn't find a way to find all the Azure "SQL Server" objects that has their check box of "Deny public network access" in the Firewall section - disabled. I also tried the "Azure Reso...
eitan1000
Feb 14, 2022Copper Contributor
Thank you very much Luke, your links looks really helpful.
Still, I need a way to inventory the current status of this check box across our tenant - is there a way to do it?
Still, I need a way to inventory the current status of this check box across our tenant - is there a way to do it?
lukemurraynz
Feb 15, 2022Learn Expert
eitan1000Try this:
$AzureSQLServers = Get-AzSqlServer
$results = @()
ForEach ($server in $AzureSQLServers)
{
$SQLServer = Get-AzSqlServer -ServerName $server.ServerName -ResourceGroupName $server.ResourceGroupName
$results += [pscustomobject]@{
ServerName = $SQLServer.ServerName
ResourceGroup = $SQLServer.ResourceGroupName
PublicNetworkAccess = $SQLServer.PublicNetworkAccess
}
}
$results- eitan1000Feb 15, 2022Copper ContributorThank very very much!!!