Skip to content

Commit befc1c5

Browse files
authored
Add files via upload
1 parent d2cecac commit befc1c5

File tree

7 files changed

+41
-8
lines changed

7 files changed

+41
-8
lines changed

Build Scripts/FBConfigBuild.vbs

1.25 KB
Binary file not shown.

Build Scripts/FBManageLog.vbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Sub LogClose()
108108
Call HideBuildPassword("AgtPassword")
109109
Call HideBuildPassword("AsPassword")
110110
Call HideBuildPassword("CmdShellPassword")
111+
Call HideBuildPassword("CredPassword")
111112
Call HideBuildPassword("DistPassword")
112113
Call HideBuildPassword("DQPassword")
113114
Call HideBuildPassword("DRUCtlrPassword")
@@ -362,7 +363,7 @@ Sub ProcessEnd(strStatus)
362363
End If
363364

364365
Select Case True
365-
Case strRestart > strProcessIdLabel
366+
Case (strRestart > strProcessIdLabel) And (strRestart <> "YES")
366367
' Nothing
367368
Case strStopAt = ""
368369
' Nothing

Build Scripts/FBManageSecurity.vbs

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Option Explicit
1818
Dim FBManageSecurity: Set FBManageSecurity = New FBManageSecurityClass
1919

2020
Class FBManageSecurityClass
21-
Dim objADOCmd, objADOConn, objExec, objFolder, objFSO, objFW, objFWRules, objRecordSet, objSDUtil, objShell, objWMIReg
21+
Dim objADOCmd, objADOConn, objLookup, objLookupFile, objExec, objFolder, objFSO, objFW, objFWRules, objRecordSet, objSDUtil, objShell, objWMIReg
2222
Dim arrProfFolders, arrProfUsers
2323
Dim intIdx, intBuiltinDomLen, intNTAuthLen, intServerLen
24-
Dim strBuiltinDom, strClusterName, strCmd, strCmdSQL, strDirSystemDataBackup
24+
Dim strBuiltinDom, strClusterName, strCmd, strCmdSQL, strLookupFile, strLookupPassword, strLookupXML, strDirSystemDataBackup
2525
Dim strGroupDBA, strGroupDBANonSA, strGroupMSA, strHKLM, strHKU, strIsInstallDBA, strKeyPassword, strLocalAdmin
2626
Dim strNTAuth, strOSVersion, strPath, strProfDir, strProgCacls, strProgReg
2727
Dim strServer, strSIDDistComUsers, strSSLCert, strSSLCertFile, strSSLCertThumb, strSystemDataSharedPrimary
@@ -33,6 +33,7 @@ Private Sub Class_Initialize
3333

3434
Set objADOConn = CreateObject("ADODB.Connection")
3535
Set objADOCmd = CreateObject("ADODB.Command")
36+
Set objLookup = CreateObject("MSXML2.DomDocument")
3637
Set objFSO = CreateObject("Scripting.FileSystemObject")
3738
Set objFW = CreateObject("HNetCfg.FwPolicy2")
3839
Set objFWRules = objFW.Rules
@@ -45,12 +46,15 @@ Private Sub Class_Initialize
4546
strBuiltinDom = GetBuildfileValue("BuiltinDom")
4647
strClusterName = GetBuildfileValue("ClusterName")
4748
strCmdSQL = GetBuildfileValue("CmdSQL")
49+
4850
strDirSystemDataBackup = GetBuildfileValue("DirSystemDataBackup")
4951
strGroupDBA = GetBuildfileValue("GroupDBA")
5052
strGroupDBANonSA = GetBuildfileValue("GroupDBANonSA")
5153
strGroupMSA = GetBuildfileValue("GroupMSA")
5254
strIsInstallDBA = GetBuildfileValue("IsInstallDBA")
5355
strKeyPassword = GetBuildfileValue("KeyPassword")
56+
strLookupFile = GetBuildfileValue("LookupFile")
57+
strLookupPassword = GetBuildfileValue("LookupPassword")
5458
strLocalAdmin = GetBuildfileValue("LocalAdmin")
5559
strNTAuth = GetBuildfileValue("NTAuth")
5660
strOSVersion = GetBuildfileValue("OSVersion")
@@ -76,6 +80,26 @@ Private Sub Class_Initialize
7680
objADOConn.Open "ADs Provider"
7781
Set objADOCmd.ActiveConnection = objADOConn
7882

83+
' Code based on https://stackoverflow.com/questions/28352141/convert-a-secure-string-to-plain-text
84+
strLookupXML = "<ROOT/>"
85+
Select Case True
86+
Case strLookupFile = ""
87+
' Nothing
88+
Case CheckFile(strLookupFile) = False
89+
' Nothing
90+
Case Else
91+
Set objLookupFile = objFSO.OpenTextFile(strLookupFile, 1)
92+
strLookupXML = objLookupFile.ReadAll
93+
If strLookupPassword <> "" Then
94+
' TO DO: Convert encrypted secure string version of strLookupXML to plaintext xml using Powershell. Some possible code shown below:
95+
' strCmd = "$LookupXML = Convert-To-SecureString '" & strLookupXML & "' ;"
96+
' strCmd = strCmd & "$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($LookupXML) ;"
97+
' strCmd = strCmd & "[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)"
98+
' strLookupXML = GetPSData(strCmd)
99+
End If
100+
End Select
101+
objLookup.LoadXml(strLookupXML)
102+
79103
intBuiltinDomLen = Len(strBuiltinDom) + 1
80104
intNTAuthLen = Len(strNTAuth) + 1
81105
intServerLen = Len(strServer) + 1
@@ -453,19 +477,27 @@ End Function
453477

454478
Function GetCredential(strPassword, strAccount)
455479
Call DebugLog("GetCredential: " & strPassword)
456-
Dim strAcctName
480+
Dim strAcctName, strCredential
457481

458-
GetCredential = GetBuildfileValue(strPassword)
482+
strCredential = GetBuildfileValue(strPassword)
459483
Select Case True
460-
Case LCase(GetCredential) <> "encrypted"
484+
Case LCase(strCredential) <> "lookup"
461485
' Nothing
462486
Case strAccount = ""
463-
' Get credential from Password file
487+
strCredential = GetXMLParm(objLookup, UCase(strPassword), "lookup")
464488
Case Else
465489
strAcctName = GetBuildfileValue(strAccount)
466-
' Get credential from Password file
490+
If Instr(strAcctName, "\") > 0 Then
491+
strAcctName = Mid(strAcctName, Instr(strAcctName, "\") + 1)
492+
End If
493+
If Instr(strAcctName, "@") > 0 Then
494+
strAcctName = Left(strAcctName, Instr(strAcctName, "@") - 1)
495+
End If
496+
strCredential = GetXMLParm(objLookup, UCase(strAcctName), "lookup")
467497
End Select
468498

499+
GetCredential = strCredential
500+
469501
End Function
470502

471503

12 Bytes
Binary file not shown.
68 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)