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

49885604 145 Reputation points
2023-11-16T21:11:09.76+00:00

Hello,

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
    2023-11-16T22:29:24.51+00:00

    please review the following script hope it helps

    
    Connect-AzAccount
    
    
    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"
        }
       
    }