Skip to content

Commit fcd243c

Browse files
authored
Add files via upload
1 parent 9ddcf6a commit fcd243c

11 files changed

+83
-48
lines changed

Build Scripts/FBConfigBuild.vbs

6.21 KB
Binary file not shown.

Build Scripts/FBConfigVar.vbs

300 Bytes
Binary file not shown.

Build Scripts/FBManageBoot.vbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Sub SetupReboot(strLabel, strDescription)
112112
End If
113113

114114
strCmd = objShell.ExpandEnvironmentStrings("%COMSPEC%") & " /d /k "
115-
strCmd = strCmd & "TIMEOUT 2 & " ' Add 2 second delay
115+
strCmd = strCmd & "TIMEOUT 5 & " ' Add 5 second delay
116116
strCmd = strCmd & strFBPath & """" & strFBCmd & """"
117117
strCmd = strCmd & " /Type:" & GetBuildfileValue("Type") & " /SQLVersion:" & GetBuildfileValue("AuditVersion") & " /Instance:" & GetBuildfileValue("Instance") & " /Restart:Yes "
118118
strStopAt = GetBuildFileValue("StopAt")

Build Scripts/FBManageCluster.vbs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Class FBManageClusterClass
2121
Dim colNodes, colResources
2222
Dim objCluster, objNode, objShell, objRE, objResource, objWMI, objWMIClus, objWMIDNS, objWMIReg
2323
Dim strClusIPV4Address, strClusIPV4Mask, strClusIPV4Network, strClusIPV6Address, strClusIPV6Mask, strClusIPV6Network
24-
Dim strClusterNetworkAO, strClusStorage, strClusterHost, strClusterName, strCmd, strCSVRoot
24+
Dim strClusterNetworkAO, strClusStorage, strClusterHost, strClusterName, strCmd, strCmdPS, strCSVRoot
2525
Dim strFailoverClusterDisks, strHKLM, strOSVersion, strPath, strPathNew, strPreferredOwner
2626
Dim strServer, strSQLVersion, strUserDNSDomain, strUserDNSServer, strWaitLong, strWaitShort
2727
Dim intIndex
@@ -49,6 +49,7 @@ Private Sub Class_Initialize
4949
strClusStorage = GetBuildfileValue("ClusStorage")
5050
strClusterHost = GetBuildfileValue("ClusterHost")
5151
strClusterName = GetBuildfileValue("ClusterName")
52+
strCmdPS = GetBuildfileValue("CmdPS")
5253
strCSVRoot = GetBuildfileValue("CSVRoot")
5354
strOSVersion = GetBuildfileValue("OSVersion")
5455
strPreferredOwner = GetBuildfileValue("PreferredOwner")
@@ -176,9 +177,12 @@ Sub ConnectCluster()
176177
strClusterHost = "YES"
177178
strClusterName = UCase(objCluster.Name)
178179
End Select
180+
181+
strOSVersion = GetBuildfileValue("OSVersion")
182+
strSQLVersion = GetBuildfileValue("SQLVersion")
183+
Set objWMIClus = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\mscluster")
179184
Call SetBuildfileValue("ClusterHost", strClusterHost)
180185
Call SetBuildfileValue("ClusterName", strClusterName)
181-
Set objWMIClus = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\mscluster")
182186

183187
End Sub
184188

@@ -291,6 +295,8 @@ Sub MoveToNode(strClusterGroup, strNode)
291295
Select Case True
292296
Case strNode = ""
293297
strNewNode = strServer
298+
Case Instr("\", strNode) > 0
299+
strNewNode = Left(strNode, Instr("\", strNode) - 1)
294300
Case Else
295301
strNewNode = strNode
296302
End Select
@@ -991,6 +997,7 @@ Sub SetClusterCmd()
991997
Call DebugLog("SetClusterCmd:")
992998
Dim strStatusComplete
993999

1000+
strCmdPS = GetBuildfileValue("CmdPS")
9941001
strStatusComplete = GetBuildfileValue("StatusComplete")
9951002
Select Case True
9961003
Case GetBuildfileValue("SetupClusterCmdStatus") = strStatusComplete

Build Scripts/FBManageLog.vbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ Sub LogClose()
150150
Call SetBuildfileValue("FBParm", strCmd)
151151
Call SetBuildfileValue("FBParmOld", "")
152152

153-
Call SetBuildfileValue("AuditEndDate", Cstr(Date()))
154-
Call SetBuildfileValue("AuditEndTime", Cstr(Time()))
153+
Call SetBuildfileValue("AuditEndDate", GetStdDate(""))
154+
Call SetBuildfileValue("AuditEndTime", GetStdTime(""))
155155

156156
End Sub
157157

Build Scripts/FBManageSecurity.vbs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Dim intIdx, intBuiltinDomLen, intNTAuthLen, intServerLen
2424
Dim strBuiltinDom, strClusterName, strCmd, strCmdSQL, strDirSystemDataBackup
2525
Dim strGroupDBA, strGroupDBANonSA, strGroupMSA, strHKLM, strHKU, strIsInstallDBA, strKeyPassword, strLocalAdmin
2626
Dim strNTAuth, strOSVersion, strPath, strProfDir, strProgCacls, strProgReg
27-
Dim strServer, strSIDDistComUsers, strSSLCert, strSSLCertThumb, strSystemDataSharedPrimary
27+
Dim strServer, strSIDDistComUsers, strSSLCert, strSSLCertFile, strSSLCertThumb, strSystemDataSharedPrimary
2828
Dim strTDECert, strUser, strUserAccount, strUserDNSDomain, strWaitShort
2929

3030

@@ -60,6 +60,7 @@ Private Sub Class_Initialize
6060
strServer = GetBuildfileValue("AuditServer")
6161
strSIDDistComUsers = GetBuildfileValue("SIDDistComUsers")
6262
strSSLCert = GetBuildfileValue("SSLCert")
63+
strSSLCertFile = GetBuildfileValue("SSLCertFile")
6364
strSSLCertThumb = GetBuildfileValue("SSLCertThumb")
6465
strSystemDataSharedPrimary = GetBuildfileValue("SystemDataSharedPrimary")
6566
strTDECert = GetBuildfileValue("TDECert")
@@ -946,7 +947,7 @@ End Sub
946947

947948

948949
Sub SetSQLDBSSL(strSQLDBPath, strSQLDBAccount)
949-
Call DebugLog("SetSQLDBSSL: " & strSQLDBPath & " for " & strSQLDBAccount)
950+
Call DebugLog("SetSQLDBSSL: " & strSQLDBAccount)
950951

951952
Call SetCertAuth(strSSLCertThumb, strSQLDBAccount)
952953

@@ -959,6 +960,27 @@ Sub SetSQLDBSSL(strSQLDBPath, strSQLDBAccount)
959960
End Sub
960961

961962

963+
Sub SetSSLCert()
964+
Call DebugLog("SetSSLCert: " & strAction)
965+
966+
Select Case True
967+
Case GetBuildfileValue("SetSSLSelfCert") = "YES"
968+
strCmd = "POWERSHELL New-SelfSignedCertificate -DNSName ""*." & strUserDNSDomain & """ -FriendlyName """ & strSSLCert & """ -CertStoreLocation ""cert:\LocalMachine\My"" -NotBefore GetDate(-Date ""2001-01-01T00:00:00"") -NotAfter GetDate(-Date ""2999-12-31T23:59:59"") "
969+
Call Util_RunExec(strCmd, "", "", -1) ' Attributes: RSA, 2048 bit; Defaults: Client Authentication, Server Authentication; Usable for: Digital Signature, Key Encipherment
970+
Call SetBuildMessage(strMsgErrorConfig, "/SetSSLSelfCert: is not yet supported in SQL FineBuild")
971+
Case CheckFile(strSSLCertFile) = True
972+
strSSLCertThumb = GetPSData("$Cert = Import-Certificate -FilePath """ & "path" & """ -CertStoreLocation ""cert:\LocalMachine\My"" | $Cert.FriendlyName = """ & strSSLCert & """ | $Cert.ThumbPrint")
973+
Call SetBuildMessage(strMsgErrorConfig, "/SSLCertFile: is not yet supported in SQL FineBuild")
974+
Case Else
975+
Call SetBuildMessage(strMsgErrorConfig, "Unable to find /SSLCertFile:" & strSSLCertFile)
976+
End Select
977+
978+
strSSLCertThumb = GetCertAttr(strSSLCert, "Thumbprint")
979+
Call SetBuildfileValue("SSLCertThumb", strSSLCertThumb)
980+
981+
End Sub
982+
983+
962984
Sub SetTDECert(strAction)
963985
Call DebugLog("SetTDECert: " & strAction)
964986

@@ -970,7 +992,7 @@ Sub SetTDECert(strAction)
970992
Call DeleteFile(strPath & ".pvk")
971993
Call Util_ExecSQL(strCmdSQL & "-Q", """BACKUP CERTIFICATE " & strTDECert & " TO FILE='" & strPath & ".snk' WITH PRIVATE KEY (FILE='" & strPath & ".pvk', ENCRYPTION BY PASSWORD='" & strKeyPassword & "');""", 0)
972994
Case Else
973-
Call Util_ExecSQL(strCmdSQL & "-Q", """CREATE CERTIFICATE " & strTDECert & " FROM FILE='" & strPath & ".snk' WITH PRIVATE KEY (FILE='" & strPath & ".pvk', ENCRYPTION BY PASSWORD='" & strKeyPassword & "');""", -1)
995+
Call Util_ExecSQL(strCmdSQL & "-Q", """IF NOT EXISTS (SELECT 1 FROM sys.certificates WHERE name = '" & strTDECert & "') CREATE CERTIFICATE " & strTDECert & " FROM FILE='" & strPath & ".snk' WITH PRIVATE KEY (FILE='" & strPath & ".pvk', DECRYPTION BY PASSWORD='" & strKeyPassword & "');""", -1)
974996
End Select
975997

976998
End Sub
@@ -1066,6 +1088,10 @@ Sub SetSQLDBSSL(strSQLDBPath, strSQLDBAccount)
10661088
Call FBManageSecurity.SetSQLDBSSL(strSQLDBPath, strSQLDBAccount)
10671089
End Sub
10681090

1091+
Sub SetSSLCert()
1092+
' Call FBManageSecurity.SetSSLCert()
1093+
End Sub
1094+
10691095
Sub SetTDECert(strAction)
10701096
Call FBManageSecurity.SetTDECert(strAction)
10711097
End Sub

Build Scripts/FBManageService.vbs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Dim FBManageService: Set FBManageService = New FBManageServiceClass
2020

2121
Class FBManageServiceClass
2222
Dim objFile, objFolder, objFSO, objShell, objWMIReg
23-
Dim strActionSQLAS, strActionSQLDB, strActionSQLRS, strCmd, strClusterName, strInstance, strPath, strResSuffixAS, strResSuffixDB
23+
Dim strActionSQLAS, strActionSQLDB, strActionSQLRS, strCmd, strClusterName, strComSpec, strInstance, strPath, strResSuffixAS, strResSuffixDB
2424
Dim strSetupSQLAS, strSetupSQLDB, strSetupSQLDBCluster, strSetupSQLRS, strSetupSQLRSCluster, strWaitLong, strWaitShort
2525

2626

@@ -35,6 +35,7 @@ Private Sub Class_Initialize
3535
strActionSQLDB = GetBuildfileValue("ActionSQLDB")
3636
strActionSQLRS = GetBuildfileValue("ActionSQLRS")
3737
strClusterName = GetBuildfileValue("ClusterName")
38+
strComSpec = GetBuildfileValue("ComSpec")
3839
strInstance = GetBuildfileValue("Instance")
3940
strResSuffixAS = GetBuildfileValue("ResSuffixAS")
4041
strResSuffixDB = GetBuildfileValue("ResSuffixDB")
@@ -169,7 +170,7 @@ Sub StopSQLServer()
169170
Case strSetupSQLDB <> "YES"
170171
' Nothing
171172
Case strSetupSQLDBCluster <> "YES"
172-
Call Util_RunExec("%COMSPEC% /D /C NET STOP " & GetBuildfileValue("InstSQL") & " /Y", "", "", 2)
173+
Call Util_RunExec(strComSpec & " /D /C NET STOP " & GetBuildfileValue("InstSQL") & " /Y", "", "", 2)
173174
Case Else
174175
strCmd = "CLUSTER """ & strClusterName & """ RESOURCE ""SQL Server" & strResSuffixDB & """ /OFF"
175176
Call Util_RunExec(strCmd, "", "", -1)
@@ -223,12 +224,12 @@ Private Sub CheckSQLReady()
223224

224225
intFound = 0
225226
strDebugMsg1 = "SQL Log File Path: " & strErrorLog
226-
strCmd = "%COMSPEC% /D /C FIND /C """ & strSQLLogReinit & """ """ & strErrorLog & """"
227+
strCmd = strComSpec & " /D /C FIND /C """ & strSQLLogReinit & """ """ & strErrorLog & """"
227228
Call Util_RunExec(strCmd, "", "", 1)
228229
If intErrSave = 0 Then
229230
intFound = 1
230231
End If
231-
strCmd = "%COMSPEC% /D /C FIND /C """ & strRestartComplete & """ """ & strErrorLog & """"
232+
strCmd = strComSpec & " /D /C FIND /C """ & strRestartComplete & """ """ & strErrorLog & """"
232233
While intFound = 0
233234
Wscript.Sleep strWaitLong
234235
Call Util_RunExec(strCmd, "", "", 1)
@@ -279,7 +280,7 @@ Private Sub CheckSQLAgentReady()
279280

280281
intFound = 0
281282
strDebugMsg1 = "SQL Log File Path: " & strErrorLog
282-
strCmd = "%COMSPEC% /D /C FIND /C """ & strRestartComplete & """ """ & strErrorLog & """"
283+
strCmd = strComSpec & " /D /C FIND /C """ & strRestartComplete & """ """ & strErrorLog & """"
283284
While intFound = 0
284285
Wscript.Sleep strWaitLong
285286
Call Util_RunExec(strCmd, "", "", 1)
@@ -425,7 +426,7 @@ Private Sub CheckRSReady()
425426

426427
intFound = 0
427428
strDebugMsg1 = "SSRS Log File: " & strErrorLog
428-
strCmd = "%COMSPEC% /D /C FIND /C """ & strRestartComplete & """ """ & strPath & "\" & strErrorLog & """"
429+
strCmd = strComSpec & " /D /C FIND /C """ & strRestartComplete & """ """ & strPath & "\" & strErrorLog & """"
429430
While (intFound = 0) And (strErrorLog > "")
430431
Call Util_RunExec(strCmd, "", "", 1)
431432
If intErrSave = 0 Then

Build Scripts/FBUtils.vbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ End Function
227227
Function GetCmdSQL()
228228
Call DebugLog("GetCmdSQL:")
229229

230+
strServInst = GetBuildfileValue("ServInst")
230231
strSQLVersion = GetBuildfileValue("SQLVersion")
231232
strSQLVersionNum = GetBuildfileValue("SQLVersionNum")
232233
strRegTools = strHKLMSQL & strSQLVersionNum & "\Tools\ClientSetup\"
952 Bytes
Binary file not shown.
170 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)