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

49885604 190 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.
41,871 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,150 Reputation points MVP
    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"
        }
       
    }
    
    
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.