PowerShell\Bash script to scan Subscription's resources' TLS version

49885604 145 Reputation points


I'm looking for a PowerShell\Bash script that can scan an entire Azure subscription's resources to analyze the TLS version for each resource. Does anyone have any resources or can provide examples of how to complete this task?

I require this functionality to complete an assessment for one of my clients, and I need to do it for many subscriptions.

Thank you in advance.

Best regards, Alessio.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,174 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 13,265 Reputation points

    please review the following script hope it helps

    Select-AzSubscription -SubscriptionId "your-subscription-id"
    $resources = Get-AzResource
    foreach ($resource in $resources) {
        if ($resource.ResourceType -eq "Microsoft.Storage/storageAccounts") {
            $tlsVersion = (Get-AzStorageAccount -ResourceGroupName $resource.ResourceGroupName -Name $resource.Name).MinimumTlsVersion
            Write-Host "$($resource.Name) TLS Version: $tlsVersion"