Skip to content

Commit 02a258e

Browse files
SQLCheck Force Strict detection
Force Strict SQL 2022 detection. Display Not Supported for lower SQL versions.
1 parent 3f4020c commit 02a258e

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed
0 Bytes
Binary file not shown.

SQLCheck/SQLCheck/Collectors.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,6 +2896,7 @@ public static void ProcessMSSQLServer(DataSet ds, DataRow SQLInstance, DataRow S
28962896
SQLServer["Certificate"] = line + msg + ")"; // thumbprint + problems, if any
28972897
}
28982898
SQLServer["ForceEncryption"] = (SSNetLib.GetValue("Encrypt", 0).ToInt() != 0 || SSNetLib.GetValue("ForceEncryption", 0).ToInt() != 0);
2899+
SQLServer["ForceStrict"] = SSNetLib.GetValue("ForceStrict", 0).ToInt() != 0;
28992900
bool hidden = SSNetLib.GetValue("HideInstance", 0).ToInt() != 0;
29002901
SQLServer["Hidden"] = hidden;
29012902
if (hidden == true) SQLServer.LogWarning("This instance is hidden from showing in the SQL Browser.");

SQLCheck/SQLCheck/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.1285.0")]
36-
[assembly: AssemblyFileVersion("1.0.1285.0")]
35+
[assembly: AssemblyVersion("1.0.1286.0")]
36+
[assembly: AssemblyFileVersion("1.0.1286.0")]

SQLCheck/SQLCheck/Storage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ public static DataSet CreateDataSet(String ComputerName)
532532
dt.AddColumn("ExtendedProtection", "String");
533533
dt.AddColumn("ExtProtSPNs", "String");
534534
dt.AddColumn("ForceEncryption", "Boolean");
535+
dt.AddColumn("ForceStrict", "Boolean");
535536
dt.AddColumn("SharedMemoryEnabled", "Boolean");
536537
dt.AddColumn("PipesEnabled", "Boolean");
537538
dt.AddColumn("PipeName", "String");

SQLCheck/SQLCheck/TextReport.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,13 @@ static void ReportSQLServer(DataSet ds, TextWriter s) // outputs computer and d
972972
s.WriteLine($"Authentication Mode: {SQLServer.GetString("AuthenticationMode")}");
973973
s.WriteLine($"Certificate: {SQLServer.GetString("Certificate")}");
974974
s.WriteLine($"ForceEncryption: {SQLServer.GetBoolean("ForceEncryption")}");
975-
s.WriteLine($"Hidden Instance: {SQLServer.GetBoolean("Hidden")}");
976975

976+
// Force Strict is not supported if SQL Version is 2019 (15.xxx) or less
977+
string ForceStrict = Utility.CompareVersion(SQLServer.GetString("Version"), "15") == ">" ? $"{SQLServer.GetBoolean("ForceStrict")}" : "Not supported";
978+
s.WriteLine($"ForceStrict: {ForceStrict}");
979+
980+
s.WriteLine($"Hidden Instance: {SQLServer.GetBoolean("Hidden")}");
981+
977982
string exp = SQLServer.GetString("ExtendedProtection");
978983
string extProt = exp == "Off" ? "Off" : $"On ({SQLServer.GetString("ExtProtSPNs")})";
979984
s.WriteLine($"Extended Protection: {extProt}");

0 commit comments

Comments
 (0)