1313
1414 . NOTES
1515
16+ ODBC 17.3 : https://docs.microsoft.com/sql/connect/odbc/windows/release-notes-odbc-sql-server-windows?view=sql-server-ver15#173&preserve-view=true
17+ OLEDB 18.2 : https://docs.microsoft.com/sql/connect/oledb/release-notes-for-oledb-driver-for-sql-server?view=sql-server-ver15#1821&preserve-view=true
18+ .NET 4.6 - https://support.microsoft.com/help/3151800/the-net-framework-4-6-2-offline-installer-for-windows
19+
20+
1621 Original Author: Mike Kallhoff
1722 Author: Blake Drumm (blakedrumm@microsoft.com)
1823
19- Modified: March 17th , 2022
24+ Modified: March 18th , 2022
2025
2126 Hosted here: https://github.com/blakedrumm/SCOM-Scripts-and-SQL/blob/master/Powershell/Get-TLSRegistryKeys.ps1
2227#>
@@ -53,6 +58,8 @@ Function Get-TLSRegistryKeys
5358 $Enabled = " Enabled"
5459 $registryPath = " HKLM:\\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\"
5560
61+ [string []]$data = (Get-WmiObject - Class Win32_Product | Where-Object { $_.Name -like " *sql*" }).name
62+
5663 foreach ($Protocol in $ProtocolList )
5764 {
5865
@@ -141,15 +148,12 @@ Function Get-TLSRegistryKeys
141148 $DefaultTLSVersions64 = $False
142149 }
143150
144- # # ODBC : https://www.microsoft.com/en-us/download/details.aspx?id=50420
145- # # OLEDB : https://docs.microsoft.com/en-us/sql/connect/oledb/download-oledb-driver-for-sql-server?view=sql-server-ver15
146- [string []]$data = (Get-WmiObject - Class Win32_Product | Where-Object { $_.Name -like " *sql*" }).name
147151 $odbcOutput = $data | where { $_ -like " Microsoft ODBC Driver *" } # Need to validate version
148152 $odbc = @ ()
149153 foreach ($driver in $odbcOutput )
150154 {
151155 Write-Host ' -' - NoNewline - ForegroundColor Green
152- if ($driver -match " 11|13" )
156+ if ($driver -match " 11|13|17 " )
153157 {
154158 Write-Verbose " FOUND $driver "
155159 $odbc += " $driver (Good)"
@@ -169,7 +173,7 @@ Function Get-TLSRegistryKeys
169173 if ($oledb )
170174 {
171175 Write-Verbose " Found: $oledb "
172- $OLEDB = " $OLEDB (Good)"
176+ $OLEDB = " $OLEDB - $ ( ( Get-ItemProperty HKLM:\SOFTWARE\Microsoft\MSOLEDBSQL).InstalledVersion ) (Good)"
173177 }
174178 else
175179 {
@@ -228,15 +232,16 @@ Function Get-TLSRegistryKeys
228232 }
229233 [version ]$MinSQLClient11Version = [version ]" 11.4.7001.0"
230234 Write-Host ' -' - NoNewline - ForegroundColor Green
235+ $SQLClientProgramVersion = $data | where { $_ -eq " Microsoft SQL Server 2012 Native Client" } # Need to validate version
231236 IF ($SQLClient11Version -ge $MinSQLClient11Version )
232237 {
233238 Write-Verbose " SQL Client - is installed and version: ($SQLClient11VersionString ) and greater or equal to the minimum version required: (11.4.7001.0)"
234- $SQLClient = " $SQLClient11Version (Good)"
239+ $SQLClient = " $SQLClientProgramVersion $ SQLClient11Version (Good)"
235240 }
236241 ELSEIF ($SQLClient11VersionString )
237242 {
238243 Write-Verbose " SQL Client - is installed and version: ($SQLClient11VersionString ) but below the minimum version of (11.4.7001.0)."
239- $SQLClient = " $SQLClient11VersionString (Below minimum)"
244+ $SQLClient = " $SQLClientProgramVersion $ SQLClient11VersionString (Below minimum)"
240245 }
241246 ELSE
242247 {
0 commit comments