'*********************************************************************************** ' Script Name: AA.DiagnosticPrep.vbs ' Version: 3.2.2 ' Author: Brent Hunter, Maxwell Mooney - Scorpion Software 'Last Updated: February 27, 2014 ' Purpose: Dumps system information and AuthAnvil Log Data to an XML File. ' Intended for diagnosing and troubleshooting issues with AuthAnvil ' installations. ' Notes: Requires access to the Windows Management Instrumention (WMI) ' service at the target Windows Server 2003 or later machine. '*********************************************************************************** ' Define Variables Dim bool2FAInstalled Dim bool64BitOS Dim boolAARadiusServerInstalled Dim boolADUSInstalled Dim boolPasswordServerInstalled Dim boolPasswordSyncAgentInstalled Dim boolPasswordVaultInstalled Dim boolSilent Dim boolSSOInstalled Dim boolSSO_2_Installed Dim boolSSO_3_Installed Dim boolRWWGuard2003Installed Dim boolRWWGuard2008Installed Dim boolRWWGuard2011Installed Dim boolRWWProtectInstalled Dim boolRWWGuardSentryInstalled Dim boolRWWGuardSentry2011Installed Dim boolVerbose Dim boolWebLogonAgentInstalled Dim boolWinLogonAgentInstalled Dim boolWinLogonCPAgentInstalled Dim colDrives Dim colRunningServices Dim errReturn Dim IPConfigSet Dim objFSO Dim objLog Dim objSystemVariables Dim objXMLOutputFile Dim objXMLParser Dim objWshShell Dim objWMIService Dim strBasePath Dim strEmailFromAddress Dim strEmailInfo Dim strEmailServer Dim strOutputDir Dim strOutputPath Dim strScriptPath Dim strSQLConnectionString Dim strWindowsServicePack ' Set Variables strSQLConnectionString = " " strBasePath = " " strEmailInfo = " " strScriptPath = CreateObject("Scripting.FileSystemObject").GetFile(WScript.ScriptFullName).ParentFolder boolSilent = False strOutputDir = "AA.DiagnosticOutput" strOutputPath = strScriptPath & "\" & strOutputDir Set objWshShell = WScript.CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objSystemVariables = objWshShell.Environment("SYSTEM") Set objXMLParser = CreateObject( "Microsoft.XMLDOM" ) Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colDrives = objFSO.Drives boolVerbose = True ' Check to see if the script is being called using cscript If IsUsingCscript = False Then scriptPath = Chr(34) & strScriptPath & "\AA.DiagnosticPrep.vbs" & Chr(34) objWshShell.Run "cmd.exe /k ""cscript //nologo " & scriptPath & """",1,boolSilent WScript.Quit End If ' Check to see if we are using a 32 bit or a 64 bit OS If (objSystemVariables("PROCESSOR_ARCHITECTURE") = "AMD64") Or (objSystemVariables("PROCESSOR_ARCHITECTURE") = "IA64") Then bool64bitOS = True Else bool64bitOS = False End If ' Set products to false bool2FAInstalled = False boolPasswordVaultInstalled = False boolPasswordServerInstalled = False boolPasswordSyncAgentInstalled = False boolSSOInstalled = False boolSSO_2_Installed = False boolSSO_3_Installed = False boolAARadiusServerInstalled = False boolADUSInstalled = False boolRWWGuard2003Installed = False boolRWWGuard2008Installed = False boolRWWGuard2011Installed = False boolRWWGuardSentryInstalled = False boolRWWGuardSentry2011Installed = False boolRWWProtectInstalled = False boolWebLogonAgentInstalled = False boolWinLogonAgentInstalled = False boolWinLogonCPAgentInstalled = False If RegKeyExists("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion") Then strWindowsServicePack = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion") Else strWindowsServicePack = "RTM" End If ' Display Script Information WScript.echo "AuthAnvil Diagnostic Info Prep Script" WScript.echo "Version 3.2.2" WScript.echo "Copyright 2014 Scorpion Software Corp. All Rights Reserved." WScript.echo "" WScript.echo "Welcome to the AuthAnvil Diagnostic Script" WScript.echo "This script will gather information on all installed AuthAnvil components." WScript.echo "This information includes:" WScript.echo " - General System Information" WScript.echo " - AuthAnvil File Versions" WScript.echo " - AuthAnvil Settings" WScript.echo " - AuthAnvil Event Log Entries" WScript.echo " - AuthAnvil SQL Log Entries" WScript.echo " " WScript.echo "This script will remove any previous AuthAnvil diagnostic output files." WScript.echo " " If (boolSilent = False) Then WScript.StdOut.Write "Press the ENTER key to continue... " WScript.StdIn.ReadLine End If ' Delete old data and create new diagnostic info files If objFSO.FolderExists(strOutputPath) Then objFSO.DeleteFolder strOutputPath, Force End If objFSO.CreateFolder(strOutputPath) Set objLog = objFSO.CreateTextFile(strOutputPath & "\AA.DiagnosticPrepLog.txt") Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\AA.DiagnosticInfo.xml") ' Begin Logging objLog.WriteLine FormatDateTime(Date(),2) & " " & FormatDateTime(Time(),3) & " Beginning Script Run" objXMLOutputFile.WriteLine "" objXMLOutputFile.WriteLine vbTab & "3.2.2" ' Determine System Information objXMLOutputFile.WriteLine vbTab & "" AALog " " AALog "Determining System Information" boolVerbose = False AALog " " AALog "Windows Version: " & objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") objXMLOutputFile.WriteLine vbTab & vbTab & "" & objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") & "" AALog "Service Pack Level: " & strWindowsServicePack objXMLOutputFile.WriteLine vbTab & vbTab & "" & strWindowsServicePack & "" AALog "OS Architecture: " & objSystemVariables("PROCESSOR_ARCHITECTURE") objXMLOutputFile.WriteLine vbTab & vbTab & "" & objSystemVariables("PROCESSOR_ARCHITECTURE") & "" AALog "Computer Name: " & objWshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") objXMLOutputFile.WriteLine vbTab & vbTab & "" & objWshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "" If (DomainRole() = "Member Workstation") Or (DomainRole() = "Member Server") Or (DomainRole() = "Backup Domain Controller") Or (DomainRole() = "Primary Domain Controller") Then AAlog "Domain Joined?: Yes" objXMLOutputFile.WriteLine vbTab & vbTab & "Yes" AALog "Domain Name: " & objWshShell.ExpandEnvironmentStrings("%USERDOMAIN%") objXMLOutputFile.WriteLine vbTab & vbTab & "" & objWshShell.ExpandEnvironmentStrings("%USERDOMAIN%") & "" AALog "DNS Domain Name: " & objWshShell.ExpandEnvironmentStrings("%USERDNSDOMAIN%") objXMLOutputFile.WriteLine vbTab & vbTab & "" & objWshShell.ExpandEnvironmentStrings("%USERDNSDOMAIN%") & "" Else AAlog "Domain Joined?: No" objXMLOutputFile.WriteLine vbTab & vbTab & "No" End If AALog "Computer Role: " & DomainRole() objXMLOutputFile.WriteLine vbTab & vbTab & "" & DomainRole() & "" Set IPConfigSet = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration ") For Each IPConfig In IPConfigSet If Not IsNull(IPConfig.IPAddress) Then For i=LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress) objXMLOutputFile.WriteLine vbTab & vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & vbTab & "" & IPConfig.Description & "" objXMLOutputFile.WriteLine vbTab & vbTab & vbTab & "" & IPConfig.IPAddress(i) & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" Next End If Next boolVerbose = True AALog " (+) System Information Determined" objXMLOutputFile.WriteLine vbTab & "" ' Detect Scorpion Software Folder AALog " " AALog "Detecting Scorpion Software Folder" strBasePath = objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\" strBasePath32 = objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\Scorpion Software\" If (objFSO.FolderExists(strBasePath)) Or (objFSO.FolderExists(strBasePath32)) Then AALog " (+) Scorpion Software folder detected" Else AALog " (!) Scorpion Software folder not detected on this computer" End If objXMLOutputFile.WriteLine vbTab & "" AALog " " AALog "Detecting AuthAnvil Folder" If AAFolderExists("AuthAnvil", "AuthAnvil") Then bool2FAInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else bool2FAInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting AuthAnvil RADIUS Server Folder" If AAFolderExists("AuthAnvil Radius Server", "AuthAnvil RADIUS Server") Then boolAARadiusServerInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolAARadiusServerInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting AuthAnvil WinLogon Agent" If objFSO.fileExists(ObjFSO.GetSpecialFolder(1) & "\AALogon.dll") Then boolWinLogonAgentInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" AALog " (+) WinLogon Agent detected" Else boolWinLogonAgentInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" AALog " (!) WinLogon Agent not detected on this computer" End If AALog " " AALog "Detecting AuthAnvil WinLogonCP Agent" If objFSO.fileExists(ObjFSO.GetSpecialFolder(1) & "\AAWinLogonCP.dll") Then boolWinLogonCPAgentInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" AALog " (+) WinLogonCP Agent detected" Else boolWinLogonCPAgentInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" AALog " (!) WinLogonCP Agent not detected on this computer" End If AALog " " AALog "Detecting AuthAnvil Web Logon Agent Folder" If AAFolderExists("AuthAnvil Web Logon Agent", "AuthAnvil Web Logon Agent") Then boolWebLogonAgentInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolWebLogonAgentInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting RWWGuard 2003 Folder" If AAFolderExists("RWW-Guard", "RWW-Guard") Then boolRWWGuard2003Installed = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolRWWGuard2003Installed = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting RWWGuard 2008" If objFSO.fileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\RWWGuard\RWWGuard2008Config.exe") Then boolRWWGuard2008Installed = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" AALog " (+) RWWGuard 2008 detected" Else boolRWWGuard2008Installed = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" AALog " (!) RWWGuard 2008 not detected on this computer" End If AALog " " AALog "Detecting RWWGuard 2011" If objFSO.fileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\RWWGuard\RWWGuard2011Config.exe") Then boolRWWGuard2011Installed = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" AALog " (+) RWWGuard 2011 detected" Else boolRWWGuard2011Installed = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" AALog " (!) RWWGuard 2011 not detected on this computer" End If AALog " " AALog "Detecting RWWProtect Folder" If AAFolderExists("AuthAnvil RWWProtect", "AuthAnvil RWWProtect") Then boolRWWProtectInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolRWWProtectInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting RWWGuardSentry" If objFSO.fileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\ClientAccess\Owa\Bin\RWWGuardSentry.dll") Then boolRWWGuardSentryInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" AALog " (+) RWWGuardSentry detected" Else boolRWWGuardSentryInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" AALog " (!) RWWGuardSentry not detected on this computer" End If AALog " " AALog "Detecting RWWGuardSentry 2011" If objFSO.fileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\V14\ClientAccess\Owa\Bin\RWWGuardSentry.dll") Then boolRWWGuardSentry2011Installed = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" AALog " (+) RWWGuardSentry 2011 detected" Else boolRWWGuardSentry2011Installed = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" AALog " (!) RWWGuardSentry 2011 not detected on this computer" End If AALog " " AALog "Detecting ADUS" If AAFolderExists("ADUS", "ADUS") Then boolADUSInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolADUSInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting Legacy AuthAnvil Password Server" If AAFolderExists("AuthAnvil Password Vault", "Legacy AuthAnvil Password Server") Then boolPasswordVaultInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolPasswordVaultInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting AuthAnvil Password Server" If AAFolderExists("AuthAnvil Password Server", "AuthAnvil Password Server") Then boolPasswordServerInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolPasswordServerInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If AALog " " AALog "Detecting AuthAnvil Password Sync Agent" If bool64BitOS = True Then If AAFolderExists32("AuthAnvil Password Sync Agent", "AuthAnvil Password Sync Agent") And objFSO.fileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\Scorpion Software\AuthAnvil Password Sync Agent\AuthAnvilPasswordSyncAgent.exe") Then boolPasswordSyncAgentInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" ElseIf AAFolderExists("AuthAnvil Password Sync Agent", "AuthAnvil Password Sync Agent") And objFSO.fileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Password Sync Agent\AuthAnvilPasswordSyncAgent.exe") Then boolPasswordSyncAgentInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolPasswordSyncAgentInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If Else If AAFolderExists("AuthAnvil Password Sync Agent", "AuthAnvil Password Sync Agent") And objFSO.fileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Password Sync Agent\AuthAnvilPasswordSyncAgent.exe") Then boolPasswordSyncAgentInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolPasswordSyncAgentInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If End If AALog " " AALog "Detecting SSO Module" If AAFolderExists("AuthAnvil\AuthAnvilSAS\SSO", "SSO") Then If objFSO.fileExists(strBasePath & "AuthAnvil\AuthAnvilSAS\SSO\bin\FederatedSSO.dll") Then boolSSO_2_Installed = True Else boolSSO_3_Installed = True End If boolSSOInstalled = True objXMLOutputFile.WriteLine vbTab & vbTab & "True" Else boolSSOInstalled = False objXMLOutputFile.WriteLine vbTab & vbTab & "False" End If objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine "" AALog " " AALog "Collecting AuthAnvil Setup Logs" If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup\AuthAnvilSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup\AuthAnvilSetupLog.log", strOutputPath & "\2FA.SetupLog.log" AALog " (+) AuthAnvil 3.5 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V4\AuthAnvilSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V4\AuthAnvilSetupLog.log", strOutputPath & "\2FA.SetupLogV4.log" AALog " (+) AuthAnvil 4.0 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V4.5\AuthAnvilSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V4.5\AuthAnvilSetupLog.log", strOutputPath & "\2FA.SetupLogV4.5.log" AALog " (+) AuthAnvil 4.5 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V4.6\AuthAnvilSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V4.6\AuthAnvilSetupLog.log", strOutputPath & "\2FA.SetupLogV4.6.log" AALog " (+) AuthAnvil 4.6 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.0\AuthAnvilSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.0\AuthAnvilSetupLog.log", strOutputPath & "\2FA.SetupLogV5.0.log" AALog " (+) AuthAnvil 5.0 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.5\AuthAnvilSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.5\AuthAnvilSetupLog.log", strOutputPath & "\2FA.SetupLogV5.5.log" AALog " (+) AuthAnvil 5.5 Setup Log collected" End If AALog " (+) AuthAnvil Setup Logs collected" AALog " " AALog "Collecting AuthAnvil Password Server Setup Logs" If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPV_Setup\AuthAnvilSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPV_Setup\AuthAnvilSetupLog.log", strOutputPath & "\AAPS.SetupLog.log" AALog " (+) Legacy AuthAnvil Password Server Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V15\AAPSSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V15\AAPSSetupLog.log", strOutputPath & "\AAPS.SetupLogV1.5.log" AALog " (+) AuthAnvil Password Server 1.5 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V16\AAPSSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V16\AAPSSetupLog.log", strOutputPath & "\AAPS.SetupLogV1.6.log" AALog " (+) AuthAnvil Password Server 1.6 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V17\AAPSSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V17\AAPSSetupLog.log", strOutputPath & "\AAPS.SetupLogV1.7.log" AALog " (+) AuthAnvil Password Server 1.7 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V2\AAPSSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V2\AAPSSetupLog.log", strOutputPath & "\AAPS.SetupLogV2.0.log" AALog " (+) AuthAnvil Password Server 2.0 Setup Log collected" End If If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V25\AAPSSetupLog.log") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AAPS_Setup_V25\AAPSSetupLog.log", strOutputPath & "\AAPS.SetupLogV2.5.log" AALog " (+) AuthAnvil Password Server 2.5 Setup Log collected" End If AALog " (+) AuthAnvil Password Server Setup Logs collected" AALog " " AALog "Collecting AuthAnvil Single Sign-On Setup Logs" If objFSO.FolderExists(objWshShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.0\SSOInstallHelper") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.0\SSOInstallHelper\SSOInstall*.log", strOutputPath AALog " (+) AuthAnvil 5.0 Single Sign-On Setup Log collected" End If If objFSO.FolderExists(objWshShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.5\SSOInstallHelper") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\AuthAnvil Setup V5.5\SSOInstallHelper\SSOInstall*.log", strOutputPath AALog " (+) AuthAnvil 5.5 Single Sign-On Setup Log collected" End If AALog " (+) AuthAnvil Single Sign-On Setup Logs collected" If bool2FAInstalled = True Then ' Detect AuthAnvil File Versions Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FA.bin.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Detecting AuthAnvil Licensing Manager Service Status" Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service where Name = 'LicensingManagerService'") For Each objService In colRunningServices objXMLOutputFile.WriteLine vbTab & "" & objService.State & "" Next AALog " (+) Service Detection Complete" AALog " " AALog "Detecting AuthAnvil Core Component Versions" AALog " " AALog " Detecting AnvilManager File Versions" If AAFolderExists("AuthAnvil\AnvilManager\Bin", "Legacy AnvilManager") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AnvilManager.dll","AuthAnvil\AnvilManager\Bin" AAFileVersion "AuthToken.dll","AuthAnvil\AnvilManager\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\AnvilManager\Bin" AAFileVersion "Validators.dll","AuthAnvil\AnvilManager\Bin" objXMLOutputFile.WriteLine vbTab & "" ElseIf AAFolderExists("AuthAnvil\AuthAnvilSAS\Manager\Bin", "AnvilManager") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "aaOBFHelper.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "AjaxControlToolkit.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "AntiXSSLibrary.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "AuthAnvil.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "ComponentSpace.SAML2.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" If boolSSO_2_Installed = True Then AAFileVersion "SSOConfig.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "BouncyCastle.Crypto.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" AAFileVersion "Ionic.Zip.dll","AuthAnvil\AuthAnvilSAS\Manager\Bin" End If If boolSSO_3_Installed = True Then AAFileVersion "ScorpionSoft.IdentityServer.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "BouncyCastle.Crypto.dll","AuthAnvil\AuthAnvilSAS\Manager\bin" End If objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" AALog " " AALog " Detecting AuthAnvilAdmin File Versions" If AAFolderExists("AuthAnvil\AuthAnvilAdmin\Bin", "Legacy AuthAnvil Admin") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilAdmin\Bin" AAFileVersion "AuthAnvilAdmin.dll","AuthAnvil\AuthAnvilAdmin\Bin" AAFileVersion "AuthToken.dll","AuthAnvil\AuthAnvilAdmin\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\AuthAnvilAdmin\Bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilAdmin\Bin" objXMLOutputFile.WriteLine vbTab & "" ElseIf AAFolderExists("AuthAnvil\AuthAnvilSAS\Admin\Bin", "AuthAnvil Admin") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" AAFileVersion "aaOBFHelper.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" AAFileVersion "AntiXSSLibrary.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" AAFileVersion "AuthAnvil.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" AAFileVersion "AuthToken.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" AAFileVersion "ComponentSpace.SAML2.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilSAS\Admin\Bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" AALog " " AALog " Detecting AuthAnvil SAS File Versions" If AAFolderExists("AuthAnvil\AuthAnvilSAS\Bin", "AuthAnvil SAS") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "aaOBFHelper.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "AntiXSSLibrary.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "AuthAnvilSAS.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "AuthAnvil.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "AuthToken.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "MSCHAP2Helper.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\AuthAnvilSAS\Bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilSAS\Bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" AALog " " AALog " Detecting Self Service Portal File Versions" If AAFolderExists("AuthAnvil\ManageToken\Bin", "Legacy Self Service Portal") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\ManageToken\Bin" AAFileVersion "SelfServicePortal.dll","AuthAnvil\ManageToken\Bin" AAFileVersion "AuthToken.dll","AuthAnvil\ManageToken\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\ManageToken\Bin" AAFileVersion "Validators.dll","AuthAnvil\ManageToken\Bin" objXMLOutputFile.WriteLine vbTab & "" ElseIf AAFolderExists("AuthAnvil\AuthAnvilSAS\SelfService\Bin", "Self Service Portal") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilSAS\SelfService\Bin" AAFileVersion "AuthAnvil.dll","AuthAnvil\AuthAnvilSAS\SelfService\Bin" AAFileVersion "AuthToken.dll","AuthAnvil\AuthAnvilSAS\SelfService\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\AuthAnvilSAS\SelfService\Bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilSAS\SelfService\Bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" AALog " " AALog " Detecting ADUS Web Service File Versions" If AAFolderExists("AuthAnvil\AuthAnvilSAS\ADUS\Bin", "ADUS Web Service") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilSAS\ADUS\Bin" AAFileVersion "aaOBFHelper.dll","AuthAnvil\AuthAnvilSAS\ADUS\Bin" AAFileVersion "AuthAnvil.dll","AuthAnvil\AuthAnvilSAS\ADUS\Bin" AAFileVersion "SoftTokenHelper.dll","AuthAnvil\AuthAnvilSAS\ADUS\Bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilSAS\ADUS\Bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" ' Get AuthAnvil Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FA.EventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'AuthAnvil'") AALog " (+) AuthAnvil Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Get AuthAnvil SQL Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FA.SQL.Log.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil SQL Log" ' Get AuthAnvil SQL Connection String Dim xDoc Set xDoc = CreateObject("Microsoft.XMLDOM") xDoc.async = False If xDoc.Load(strBasePath & "AuthAnvil\AuthAnvilSAS\web.config") Then Dim sqlInstance Set sqlInstance = xDoc.documentElement.selectSingleNode("//appSettings/*[@key='DBServer']/@value") If Not sqlInstance Is Nothing Then strSQLConnectionString = "Server=" & sqlInstance.value & ";Database=Anvil;Trusted_Connection=TRUE" Else Dim connStr Set connStr = xDoc.documentElement.selectSingleNode("//connectionStrings/*/@connectionString") If Not connStr Is Nothing Then strSQLConnectionString = connStr.value End If End If Else AALog " (!) Could not load " & strBasePath & "AuthAnvil\AuthAnvilSAS\web.config" End If Set xDoc = Nothing If Not strSQLConnectionString = " " Then objXMLOutputFile.WriteLine vbTab & "" & strSQLConnectionString & "" Call QueryAASQLLog(strSQLConnectionString) Else AALog " (!) SQL connection information could not be determined." AALog " Please enter your AuthAnvil SQL Connection info in the form of:" AALog " SQLSERVERNAME\SQLINSTANCENAME or SQLSERVERNAME if there is no instance." WScript.StdOut.Write " SQL Server Connection Info: " strSQLConnectionString = "Server=" & WScript.StdIn.ReadLine & ";Database=Anvil;Trusted_Connection=TRUE" objXMLOutputFile.WriteLine vbTab & "" & strSQLConnectionString & "" Call QueryAASQLLog(strSQLConnectionString) End If AALog " (+) SQL Log Query Complete" objXMLOutputFile.WriteLine "" AALog " " AALog "Collecting AuthAnvil Configuration Information" ' Get Site configs Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FA.SiteSettings.xml") objXMLOutputFile.WriteLine "" Call QueryAASiteSettings(strSQLConnectionString) objXMLOutputFile.WriteLine "" ' Get config files If objFSO.FileExists(strBasePath & "AuthAnvil\AnvilManager\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AnvilManager\web.config", strOutputPath & "\2FA.AnvilManager.web.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilAdmin\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilAdmin\web.config", strOutputPath & "\2FA.AuthAnvilAdmin.web.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilSAS\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilSAS\web.config", strOutputPath & "\2FA.AuthAnvilSAS.web.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilSAS\Manager\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilSAS\Manager\web.config", strOutputPath & "\2FA.Manager.web.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilRedirect\AuthAnvilSAS\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilRedirect\AuthAnvilSAS\web.config", strOutputPath & "\2FA.AuthAnvilRedirect.web.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\ManageToken\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\ManageToken\web.config", strOutputPath & "\2FA.ManageToken.web.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilConfigurationWizard\AuthAnvilConfigurationWizard.exe.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilConfigurationWizard\AuthAnvilConfigurationWizard.exe.config", strOutputPath & "\2FA.AuthAnvilConfigurationWizard.exe.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilConfigurationWizard\AuthAnvilLicensingManager.exe.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilConfigurationWizard\AuthAnvilLicensingManager.exe.config", strOutputPath & "\2FA.AuthAnvilLicensingManager.exe.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil\LicensingManager\AuthAnvilLicensingManager.exe.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\LicensingManager\AuthAnvilLicensingManager.exe.config", strOutputPath & "\2FA.AuthAnvilLicensingManager.exe.config" End If ' Export Registry Settings objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\Anvil" & Chr(34) & " " & strOutputPath & "\2FA.Anvil.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FA.Anvil.reg") Then objFSO.MoveFile strOutputPath & "\2FA.Anvil.reg", strOutputPath & "\2FA.Anvil.re_" End If objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Scorpion Software\Anvil" & Chr(34) & " " & strOutputPath & "\2FA.Anvil32.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FA.Anvil32.reg") Then objFSO.MoveFile strOutputPath & "\2FA.Anvil32.reg", strOutputPath & "\2FA.Anvil32.re_" End If objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\AuthAnvil" & Chr(34) & " " & strOutputPath & "\2FA.AuthAnvil.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FA.AuthAnvil.reg") Then objFSO.MoveFile strOutputPath & "\2FA.AuthAnvil.reg", strOutputPath & "\2FA.AuthAnvil.re_" End If AALog " (+) AuthAnvil Configuration collected" End If If boolPasswordVaultInstalled = True Then ' Detect Password Vault File Versions Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\AAPS.Legacy.bin.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Detecting Legacy AuthAnvil Password Server Core Component Versions" AALog " " AALog " Detecting Legacy Password Server File Versions" If AAFolderExists("AuthAnvil Password Vault\AAPV\bin", "Legacy Password Server") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AAPVCertificateAuthority.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "AAPVDebugging.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "AAPVEncryption.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "AAPVProtectedConfigurationProvider.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "AAPVServiceLibrary.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "AAPVServiceLibrary.ServiceModel.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "AntiXSSLibrary.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "AuthAnvilPasswordVault.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "BouncyCastle.Crypto.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "ComponentSpace.SAML2.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "HtmlSanitizationLibrary.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "PasswordHelper.dll","AuthAnvil Password Vault\AAPV\bin" AAFileVersion "Validators.dll","AuthAnvil Password Vault\AAPV\bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" AALog " " AALog "Collecting Legacy AuthAnvil Password Server Configuration Information" ' Get Password Vault config files If objFSO.FileExists(strBasePath & "AuthAnvil Password Vault\AAPV\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Vault\AAPV\web.config", strOutputPath & "\AAPS.Legacy.web.config" End If AALog " (+) Legacy AuthAnvil Password Server Configuration collected" AALog " " AALog "Collecting Legacy AuthAnvil Password Server Log Files" ' Get Password Vault log files If objFSO.FileExists(strBasePath & "AuthAnvil Password Vault\Logging\FailureReport.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Vault\Logging\FailureReport.log", strOutputPath & "\AAPS.Legacy.FailureReport.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Vault\Logging\Debug.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Vault\Logging\Debug.log", strOutputPath & "\AAPS.Legacy.Debug.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Vault\Logging\Scheduler\FailureReport.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Vault\Logging\Scheduler\FailureReport.log", strOutputPath & "\AAPS.Legacy.Scheduler.FailureReport.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Vault\Logging\Scheduler\Debug.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Vault\Logging\Scheduler\Debug.log", strOutputPath & "\AAPS.Legacy.Scheduler.Debug.log" End If AALog " (+) AuthAnvil Password Vault Log Files collected" End If If boolPasswordServerInstalled = True Then ' Detect Password Server File Versions Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\AAPS.bin.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Detecting AuthAnvil Password Server Core Component Versions" AALog " " AALog " Detecting Password Server File Versions" If AAFolderExists("AuthAnvil Password Server\AAPS\bin", "Password Server") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AAPSCertificateAuthority.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "AAPSDebugging.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "AAPSEncryption.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "AAPSProtectedConfigurationProvider.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "AAPSServiceLibrary.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "AAPSServiceLibrary.ServiceModel.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "AntiXSSLibrary.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "AuthAnvilPasswordServer.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "BouncyCastle.Crypto.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "ComponentSpace.SAML2.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "HtmlSanitizationLibrary.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "PasswordHelper.dll","AuthAnvil Password Server\AAPS\bin" AAFileVersion "Validators.dll","AuthAnvil Password Server\AAPS\bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" AALog " " AALog "Collecting AuthAnvil Password Server Configuration Information" ' Get Password Server config files If objFSO.FileExists(strBasePath & "AuthAnvil Password Server\AAPS\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Server\AAPS\web.config", strOutputPath & "\AAPS.web.config" End If AALog " (+) AuthAnvil Password Server Configuration collected" AALog " " AALog "Collecting AuthAnvil Password Server Log Files" ' Get Password Server log files If objFSO.FileExists(strBasePath & "AuthAnvil Password Server\Logging\FailureReport.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Server\Logging\FailureReport.log", strOutputPath & "\AAPS.FailureReport.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Server\Logging\Debug.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Server\Logging\Debug.log", strOutputPath & "\AAPS.Debug.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Server\Logging\Scheduler\FailureReport.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Server\Logging\Scheduler\FailureReport.log", strOutputPath & "\AAPS.Scheduler.FailureReport.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Server\Logging\Scheduler\Debug.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Server\Logging\Scheduler\Debug.log", strOutputPath & "\AAPS.Scheduler.Debug.log" End If AALog " (+) AuthAnvil Password Server Log Files collected" End If If boolPasswordSyncAgentInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\AAPSA.bin.xml") objXMLOutputFile.WriteLine "" ' Get Sync Agent Service Status AALog " " AALog " Detecting AuthAnvil Password Sync Agent Service Status" Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service where Name = 'SyncAgentService'") For Each objService In colRunningServices objXMLOutputFile.WriteLine vbTab & "" & objService.State & "" Next AALog " (+) Service Detection Complete" ' Detect Sync Agent File Versions AALog " " AALog " Detecting Password Sync Agent File Versions" If bool64bitOS = True Then If AAFolderExists32("AuthAnvil Password Sync Agent", "Legacy Password Sync Agent") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion32 "AAPSAuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion32 "AAPVAuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion32 "AAPVDebugging.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "AAPVEncryption.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "SyncAgentConstants.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "SyncAgentControlForm.exe.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "AuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion32 "SyncAgentControlForm.exe","AuthAnvil Password Sync Agent" AAFileVersion32 "AAPSDebugging.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "AAPSEncryption.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "PasswordHelper.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "PasswordSyncWindows.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "PasswordSyncWindowsServices.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "PasswordSyncWindowsTasks.dll","AuthAnvil Password Sync Agent" AAFileVersion32 "HtmlUnit.dll","AuthAnvil Password Sync Agent" objXMLOutputFile.WriteLine vbTab & "" ElseIf AAFolderExists("AuthAnvil Password Sync Agent", "Password Sync Agent") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion "SyncAgentConstants.dll","AuthAnvil Password Sync Agent" AAFileVersion "AuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion "SyncAgentControlForm.exe","AuthAnvil Password Sync Agent" AAFileVersion "AAPSDebugging.dll","AuthAnvil Password Sync Agent" AAFileVersion "AAPSEncryption.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordHelper.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordSyncWindows.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordSyncWindowsServices.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordSyncWindowsTasks.dll","AuthAnvil Password Sync Agent" AAFileVersion "HtmlUnit.dll","AuthAnvil Password Sync Agent" objXMLOutputFile.WriteLine vbTab & "" End If Else If AAFolderExists("AuthAnvil Password Sync Agent", "Password Sync Agent") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AAPSAuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion "AAPVAuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion "AAPVDebugging.dll","AuthAnvil Password Sync Agent" AAFileVersion "AAPVEncryption.dll","AuthAnvil Password Sync Agent" AAFileVersion "SyncAgentConstants.dll","AuthAnvil Password Sync Agent" AAFileVersion "SyncAgentControlForm.exe.dll","AuthAnvil Password Sync Agent" AAFileVersion "AuthAnvilPasswordSyncAgent.exe","AuthAnvil Password Sync Agent" AAFileVersion "SyncAgentControlForm.exe","AuthAnvil Password Sync Agent" AAFileVersion "AAPSDebugging.dll","AuthAnvil Password Sync Agent" AAFileVersion "AAPSEncryption.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordHelper.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordSyncWindows.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordSyncWindowsServices.dll","AuthAnvil Password Sync Agent" AAFileVersion "PasswordSyncWindowsTasks.dll","AuthAnvil Password Sync Agent" AAFileVersion "HtmlUnit.dll","AuthAnvil Password Sync Agent" objXMLOutputFile.WriteLine vbTab & "" End If End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" AALog " " AALog "Collecting AuthAnvil Password Sync Agent Configuration Information" ' Get Password Sync Agent config files If objFSO.FileExists(strBasePath & "AuthAnvil Password Sync Agent\AuthAnvilPasswordSyncAgent.exe.config") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Sync Agent\AuthAnvilPasswordSyncAgent.exe.config", strOutputPath & "\AAPSA.AuthAnvilPasswordSyncAgent.exe.config" End If If objFSO.FileExists(strBasePath32 & "AuthAnvil Password Sync Agent\AuthAnvilPasswordSyncAgent.exe.config") Then objFSO.CopyFile strBasePath32 & "AuthAnvil Password Sync Agent\AuthAnvilPasswordSyncAgent.exe.config", strOutputPath & "\AAPSA.AuthAnvilPasswordSyncAgent.exe.config" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Sync Agent\SyncAgentControlForm.exe.config") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Sync Agent\SyncAgentControlForm.exe.config", strOutputPath & "\AAPSA.SyncAgentControlForm.exe.config" End If If objFSO.FileExists(strBasePath32 & "AuthAnvil Password Sync Agent\SyncAgentControlForm.exe.config") Then objFSO.CopyFile strBasePath32 & "AuthAnvil Password Sync Agent\SyncAgentControlForm.exe.config", strOutputPath & "\AAPSA.SyncAgentControlForm.exe.config" End If AALog " (+) AuthAnvil Password Sync Agent Configuration collected" AALog " " AALog "Collecting AuthAnvil Password Sync Agent Log Files" ' Get Legacy Password Sync Agent log files If objFSO.FileExists(strBasePath & "AuthAnvil Password Sync Agent\FailureReport.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Sync Agent\FailureReport.log", strOutputPath & "\AAPSA.Legacy.FailureReport.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Sync Agent\Debug.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Sync Agent\Debug.log", strOutputPath & "\AAPSA.Legacy.Debug.log" End If If objFSO.FileExists(strBasePath32 & "AuthAnvil Password Sync Agent\FailureReport.log") Then objFSO.CopyFile strBasePath32 & "AuthAnvil Password Sync Agent\FailureReport.log", strOutputPath & "\AAPSA.Legacy.FailureReport.log" End If If objFSO.FileExists(strBasePath32 & "AuthAnvil Password Sync Agent\Debug.log") Then objFSO.CopyFile strBasePath32 & "AuthAnvil Password Sync Agent\Debug.log", strOutputPath & "\AAPSA.Legacy.Debug.log" End If ' Get Password Sync Agent log files If objFSO.FileExists(strBasePath & "AuthAnvil Password Sync Agent\Logging\FailureReport.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Sync Agent\Logging\FailureReport.log", strOutputPath & "\AAPSA.FailureReport.log" End If If objFSO.FileExists(strBasePath & "AuthAnvil Password Sync Agent\Logging\Debug.log") Then objFSO.CopyFile strBasePath & "AuthAnvil Password Sync Agent\Logging\Debug.log", strOutputPath & "\AAPSA.Debug.log" End If If objFSO.FileExists(strBasePath32 & "AuthAnvil Password Sync Agent\Logging\FailureReport.log") Then objFSO.CopyFile strBasePath32 & "AuthAnvil Password Sync Agent\Logging\FailureReport.log", strOutputPath & "\AAPSA.FailureReport.log" End If If objFSO.FileExists(strBasePath32 & "AuthAnvil Password Sync Agent\Logging\Debug.log") Then objFSO.CopyFile strBasePath32 & "AuthAnvil Password Sync Agent\Logging\Debug.log", strOutputPath & "\AAPSA.Debug.log" End If AALog " (+) AuthAnvil Password Sync Agent Log Files collected" End If If boolSSO_2_Installed = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.Legacy.bin.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Detecting Legacy AuthAnvil SSO Module Core Component Versions" AALog " " AALog " Detecting Legacy SSO Module File Versions" If AAFolderExists("AuthAnvil\AuthAnvilSAS\SSO\bin", "Legacy SSO Module") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "AntiXSSLibrary.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ComponentSpace.SAML2.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "FederatedSSO.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "FederatedSSO.XmlSerializers.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" AALog " " AALog "Collecting Legacy AuthAnvil SSO Module Application Information" ' Get SSO Module Application Configuration From SQL Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.Legacy.SQL.ApplicationConfig.xml") objXMLOutputFile.WriteLine "" Call QuerySSOApplicationConfigInfo(strSQLConnectionString) objXMLOutputFile.WriteLine "" ' Get SSO Module Application Info From SQL Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.Legacy.SQL.Applications.xml") objXMLOutputFile.WriteLine "" Call QuerySSOApplications(strSQLConnectionString) objXMLOutputFile.WriteLine "" ' Get SSO Module Application Info From SQL Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.Legacy.SQL.SiteSettings.xml") objXMLOutputFile.WriteLine "" Call QuerySSOSiteSettings(strSQLConnectionString) objXMLOutputFile.WriteLine "" AALog " (+) Legacy AuthAnvil SSO Module Application Information collected" AALog " " AALog "Collecting Legacy AuthAnvil SSO Module Configuration Information" ' Get SSO Module config files If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilSAS\SSO\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilSAS\SSO\web.config", strOutputPath & "\SSO.Legacy.web.config" End If AALog " (+) Legacy AuthAnvil SSO Module Configuration collected" End If If boolSSO_3_Installed = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.bin.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Detecting AuthAnvil SSO Module Core Component Versions" AALog " " AALog " Detecting SSO Module File Versions" If AAFolderExists("AuthAnvil\AuthAnvilSAS\SSO\bin", "SSO Module") Then objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "AADBHelper.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "AntiXSSLibrary.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ComponentSpace.SAML2.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "Validators.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ScorpionSoft.IdentityServer.Adl.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ScorpionSoft.IdentityServer.Common.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ScorpionSoft.IdentityServer.Data.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ScorpionSoft.IdentityServer.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ScorpionSoft.IdentityServer.Implementation.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" AAFileVersion "ScorpionSoft.IdentityServer.Web.dll","AuthAnvil\AuthAnvilSAS\SSO\bin" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" AALog " " AALog "Collecting AuthAnvil SSO Module Application Information" ' Get SSO Module Audit Info From SQL Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.SQL.Audit.xml") objXMLOutputFile.WriteLine "" Call QuerySSOAudit(strSQLConnectionString) objXMLOutputFile.WriteLine "" ' Get SSO Module Exception Info From SQL Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.SQL.Exception.xml") objXMLOutputFile.WriteLine "" Call QuerySSOException(strSQLConnectionString) objXMLOutputFile.WriteLine "" ' Get SSO Module Service Provider Info From SQL Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.SQL.ServiceProvider.xml") objXMLOutputFile.WriteLine "" Call QuerySSOServiceProvider(strSQLConnectionString) objXMLOutputFile.WriteLine "" ' Get SSO Module Scheduler Info From SQL Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\SSO.SQL.Scheduler.xml") objXMLOutputFile.WriteLine "" Call QuerySSOScheduler(strSQLConnectionString) objXMLOutputFile.WriteLine "" AALog " (+) AuthAnvil SSO Module Application Information collected" AALog " " AALog "Collecting AuthAnvil SSO Module Configuration Information" ' Get SSO Module config files If objFSO.FileExists(strBasePath & "AuthAnvil\AuthAnvilSAS\SSO\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil\AuthAnvilSAS\SSO\web.config", strOutputPath & "\SSO.web.config" End If AALog " (+) AuthAnvil SSO Module Configuration collected" End If If boolAARadiusServerInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RADIUSServer.xml") objXMLOutputFile.WriteLine "" ' Get RADIUS Server Service Status AALog " " AALog "Detecting AuthAnvil RADIUS Server Service Status" Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service where Name = 'AuthAnvilRadius'") For Each objService In colRunningServices objXMLOutputFile.WriteLine vbTab & "" & objService.State & "" Next AALog " (+) Service Detection Complete" ' Get RADIUS Server File Versions AALog " " AALog "Detecting AuthAnvil RADIUS Server Component Versions" If AAFolderExists("AuthAnvil Radius Server", "AuthAnvil Radius Server") Then AAFileVersion "AARadiusTest.exe","AuthAnvil Radius Server" AAFileVersion "AARadiusWizard.exe","AuthAnvil Radius Server" AAFileVersion "AuthAnvilRadius.exe","AuthAnvil Radius Server" AAFileVersion "InstallUtil.exe","AuthAnvil Radius Server" AAFileVersion "Interop.ActiveDs.dll","AuthAnvil Radius Server" AAFileVersion "MSCHAP2Helper.dll","AuthAnvil Radius Server" AAFileVersion "Wizard.dll","AuthAnvil Radius Server" End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" ' Get AuthAnvil RADIUS Server Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RADIUSEventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil RADIUS Server Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'Application' and (SourceName = 'AuthAnvil Radius Server')") AALog " (+) AuthAnvil RADIUS Server Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Get config file AALog " " AALog "Collecting AuthAnvil RADIUS Server Configuration Information" If objFSO.FileExists(strBasePath & "AuthAnvil Radius Server\AuthAnvilRadius.exe.config") Then objFSO.CopyFile strBasePath & "AuthAnvil Radius Server\AuthAnvilRadius.exe.config", strOutputPath & "\2FAA.AuthAnvilRadius.exe.config" End If AALog " (+) AuthAnvil RADIUS Server Configuration collected" End If If boolWinLogonAgentInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.WinLogon.xml") ' Get WinLogon File Versions AALog " " AALog "Detecting AuthAnvil WinLogon Agent Version" objXMLOutputFile.WriteLine "" objXMLOutputFile.WriteLine vbTab & "WinLogon.dll" objXMLOutputFile.WriteLine vbTab & vbTab & "" & objFSO.GetFileVersion(ObjFSO.GetSpecialFolder(1) & "\AALogon.dll") & "" objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "LogonConfig.exe","WinLogon" objXMLOutputFile.WriteLine "" AALog " (+) Version Detection Complete" ' Get AuthAnvil WinLogon Agent Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.WinLogonApplicationLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil WinLogon Agent Application Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'Application' and (SourceName = 'aalogon')") AALog " (+) AuthAnvil WinLogon Agent Event Application Log Query Complete" objXMLOutputFile.WriteLine "" ' Get AuthAnvil WinLogon Agent Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.WinLogonEventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil WinLogon Agent Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'AAWinLogon'") AALog " (+) AuthAnvil WinLogon Agent Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Export Registry Settings AALog " " AALog "Collecting WinLogon Agent Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\AuthAnvilLogon" & Chr(34) & " " & strOutputPath & "\2FAA.AAWinLogon.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.AAWinLogon.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.AAWinLogon.reg", strOutputPath & "\2FAA.AAWinLogon.re_" End If AALog " (+) WinLogon Agent Configuration collected" End If If boolWinLogonCPAgentInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.WinLogonCP.xml") ' Get WinLogonCP File Versions AALog " " AALog "Detecting AuthAnvil WinLogon CP Agent Version" objXMLOutputFile.WriteLine "" objXMLOutputFile.WriteLine vbTab & "WinLogonCP.dll" objXMLOutputFile.WriteLine vbTab & vbTab & "" & objFSO.GetFileVersion(ObjFSO.GetSpecialFolder(1) & "\AAWinLogonCP.dll") & "" objXMLOutputFile.WriteLine vbTab & "" AAFileVersion "LogonConfig.exe","WinLogon" objXMLOutputFile.WriteLine "" AALog " (+) Version Detection Complete" ' Get AuthAnvil WinLogon Agent Application Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.WinLogonCPApplicationLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil WinLogonCP Agent Application Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'Application' and (SourceName = 'aalogon' or SourceName = 'AAWinLogonCP')") AALog " (+) AuthAnvil WinLogonCP Agent Application Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Get AuthAnvil WinLogon Agent Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.WinLogonCPEventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil WinLogonCP Agent Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'AAWinLogonCP'") AALog " (+) AuthAnvil WinLogonCP Agent Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Export Registry Settings AALog " " AALog "Collecting WinLogonCP Agent Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\AuthAnvilLogon" & Chr(34) & " " & strOutputPath & "\2FAA.WinLogonCP.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.WinLogonCP.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.WinLogonCP.reg", strOutputPath & "\2FAA.WinLogonCP.re_" End If objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{ABAA8F45-5683-42b5-BC15-E44D6CBB8ED4}" & Chr(34) & " " & strOutputPath & "\2FAA.WinLogonCPSystem.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.WinLogonCPSystem.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.WinLogonCPSystem.reg", strOutputPath & "\2FAA.WinLogonCPSystem.re_" End If objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Provider Filters\{ABAA8F45-5683-42b5-BC15-E44D6CBB8ED4}" & Chr(34) & " " & strOutputPath & "\2FAA.WinLogonCPFilters.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.WinLogonCPFilters.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.WinLogonCPFilters.reg", strOutputPath & "\2FAA.WinLogonCPFilters.re_" End If AALog " (+) WinLogonCP Agent Configuration collected" End If If boolWebLogonAgentInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.WebLogon.xml") ' Get WebLogon File Versions AALog " " AALog "Detecting AuthAnvil WinLogon Agent Version" If AAFolderExists("AuthAnvil Web Logon Agent", "AuthAnvil Web Logon Agent") Then objXMLOutputFile.WriteLine "" AAFileVersion "AAWebLogon.dll","AuthAnvil Web Logon Agent" AAFileVersion "AAWebLogonUninstaller.exe","AuthAnvil Web Logon Agent" AAFileVersion "AuthAnvilConfigurationTool.exe","AuthAnvil Web Logon Agent" AAFileVersion "DcomPerm.exe","AuthAnvil Web Logon Agent" AAFileVersion "Interop.ActiveDs.dll","AuthAnvil Web Logon Agent" AAFileVersion "AAWebLogon.dll","AuthAnvil Web Logon Agent" AAFileVersion "Wizard.dll","AuthAnvil Web Logon Agent" AAFileVersion "AAWebLogon.dll","AuthAnvil Web Logon Agent\AuthAnvilWebLogonAgent\bin" AAFileVersion "Interop.ActiveDs.dll","AuthAnvil Web Logon Agent\AuthAnvilWebLogonAgent\bin" objXMLOutputFile.WriteLine "" End If AALog " (+) Version Detection Complete" ' Export Registry Settings AALog " " AALog "Collecting WebLogon Agent Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\AuthAnvilWebLogon" & Chr(34) & " " & strOutputPath & "\2FAA.WebLogon.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.WebLogon.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.WebLogon.reg", strOutputPath & "\2FAA.WebLogon.re_" End If If objFSO.FileExists(strBasePath & "AuthAnvil Web Logon Agent\AuthAnvilWebLogonAgent\web.config") Then objFSO.CopyFile strBasePath & "AuthAnvil Web Logon Agent\AuthAnvilWebLogonAgent\web.config", strOutputPath & "\2FAA.WebLogonAgent.web.config" End If AALog " (+) WebLogon Agent Configuration collected" End If If boolRWWGuard2003Installed = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuard2003.xml") ' Get RWWGuard 2003 File Versions AALog " " AALog "Detecting RWWGuard 2003 Component Versions" If AAFolderExists("RWW-Guard", "RWW-Guard") Then objXMLOutputFile.WriteLine "" AALog " " AAFileVersion "RWWGuardConfSD.exe","RWW-Guard" AAFileVersion "RWWWebConfigUpdater.exe","RWW-Guard" objXMLOutputFile.WriteLine "" End If AALog " (+) Version Detection Complete" ' Get RWWGuard 2003 Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuard2003EventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying RWWGuard 2003 Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'RWWGuard'") AALog " (+) RWWGuard 2003 Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Export Registry Settings AALog " " AALog "Collecting RWWGuard 2003 Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\RWW-OTP" & Chr(34) & " " & strOutputPath & "\2FAA.RWWGuard2003.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.RWWGuard2003.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.RWWGuard2003.reg", strOutputPath & "\2FAA.RWWGuard2003.re_" End If AALog " (+) RWWGuard 2003 Configuration collected" End If If boolRWWGuard2008Installed = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuard2008.xml") ' Get RWWGuard 2008 File Versions AALog " " AALog "Detecting RWWGuard 2008 Component Versions" If AAFolderExists("RWWGuard", "RWWGuard") Then objXMLOutputFile.WriteLine vbTab & "" AALog " " AAFileVersion "Interop.ActiveDs.dll","RWWGuard" AAFileVersion "RWWGuard2008Config.exe","RWWGuard" AAFileVersion "RWWGuard2008Config.XmlSerializers.dll","RWWGuard" AAFileVersion "RWWGuardEvtConfig.exe","RWWGuard" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" ' Get RWWGuard 2008 Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuard2008EventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying RWWGuard 2008 Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'RWWGuard'") AALog " (+) RWWGuard 2008 Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Export Registry Settings AALog " " AALog "Collecting RWWGuard 2008 Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\RWWGuard" & Chr(34) & " " & strOutputPath & "\2FAA.RWWGuard2008.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.RWWGuard2008.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.RWWGuard2008.reg", strOutputPath & "\2FAA.RWWGuard2008.re_" End If AALog " (+) RWWGuard 2008 Configuration collected" End If If boolRWWGuard2011Installed = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuard2011.xml") ' Get RWWGuard 2011 File Versions AALog " " AALog "Detecting RWWGuard 2011 Component Versions" If AAFolderExists("RWWGuard", "RWWGuard") Then objXMLOutputFile.WriteLine vbTab & "" AALog " " AAFileVersion "ChangeAuthURL.exe","RWWGuard" AAFileVersion "Interop.ActiveDs.dll","RWWGuard" AAFileVersion "RWWGuard2011Config.exe","RWWGuard" AAFileVersion "RWWGuard2011Config.XmlSerializers.dll","RWWGuard" AAFileVersion "RWWGuardEvtConfig.exe","RWWGuard" objXMLOutputFile.WriteLine vbTab & "" End If AALog " (+) Version Detection Complete" ' Get RWWGuard 2008 Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuard2011EventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying RWWGuard 2011 Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'RWWGuard'") AALog " (+) RWWGuard 2011 Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Export Registry Settings AALog " " AALog "Collecting RWWGuard 2011 Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\RWWGuard" & Chr(34) & " " & strOutputPath & "\2FAA.RWWGuard2011.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.RWWGuard2011.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.RWWGuard2011.reg", strOutputPath & "\2FAA.RWWGuard2011.re_" End If AALog " (+) RWWGuard 2011 Configuration collected" End If If boolRWWProtectInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWProtect.xml") ' Get RWWProtect File Versions AALog " " AALog "Detecting RWWProtect Component Versions" If AAFolderExists("AuthAnvil RWWProtect", "AuthAnvil RWWProtect") Then objXMLOutputFile.WriteLine "" AALog " " AAFileVersion "RWWProtectConfSD.exe","AuthAnvil RWWProtect\RWWProtectTools" AAFileVersion "RWWProtectWebConfigUpdater.exe","AuthAnvil RWWProtect\RWWProtectTools" AAFileVersion "ComponentFactory.Krypton.Navigator.DLL","AuthAnvil RWWProtect\RWWProtectManager" AAFileVersion "ComponentFactory.Krypton.Ribbon.DLL","AuthAnvil RWWProtect\RWWProtectManager" AAFileVersion "ComponentFactory.Krypton.Toolkit.DLL","AuthAnvil RWWProtect\RWWProtectManager" AAFileVersion "RWWEventLogItem.dll","AuthAnvil RWWProtect\RWWProtectManager" AAFileVersion "RWWProtectManager.exe","AuthAnvil RWWProtect\RWWProtectManager" objXMLOutputFile.WriteLine "" End If AALog " (+) Version Detection Complete" ' Get RWWProtect Event Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWProtectEventLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying RWWProtect Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'RWWProtect'") AALog " (+) RWWProtect Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Export Registry Settings AALog " " AALog "Collecting RWWProtect Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\RWWProtect" & Chr(34) & " " & strOutputPath & "\2FAA.RWWProtect.reg", 1, True If objFSO.FileExists(strOutputPath & "\2FAA.RWWProtect.reg") Then objFSO.MoveFile strOutputPath & "\2FAA.RWWProtect.reg", strOutputPath & "\2FAA.RWWProtect.re_" End If AALog " (+) RWWProtect Configuration collected" End If If boolRWWGuardSentryInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuardSentry.xml") ' Get RWWGuardSentry File Version AALog " " AALog "Detecting RWWGuardSentry Version" objXMLOutputFile.WriteLine "" AALog " " objXMLOutputFile.WriteLine vbTab & "RWWGuardSentry.dll" objXMLOutputFile.WriteLine vbTab & vbTab & "" & objFSO.GetFileVersion(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\ClientAccess\Owa\Bin\RWWGuardSentry.dll") & "" objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine "" AALog " (+) Version Detection Complete" ' Get config file AALog " " AALog "Collecting RWWGuardSentry Configuration Information" If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\ClientAccess\Owa\web.config") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\ClientAccess\Owa\web.config", strOutputPath & "\2FAA.owa.web.config" End If AALog " (+) RWWGuardSentry Configuration collected" End If If boolRWWGuardSentry2011Installed = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\2FAA.RWWGuardSentry2011.xml") ' Get RWWGuardSentry File Version AALog " " AALog "Detecting RWWGuardSentry Version" objXMLOutputFile.WriteLine "" AALog " " objXMLOutputFile.WriteLine vbTab & "RWWGuardSentry.dll" objXMLOutputFile.WriteLine vbTab & vbTab & "" & objFSO.GetFileVersion(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\V14\ClientAccess\Owa\Bin\RWWGuardSentry.dll") & "" objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine "" AALog " (+) Version Detection Complete" ' Get config file AALog " " AALog "Collecting RWWGuardSentry Configuration Information" If objFSO.FileExists(objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\V14\ClientAccess\Owa\web.config") Then objFSO.CopyFile objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Microsoft\Exchange Server\V14\ClientAccess\Owa\web.config", strOutputPath & "\2FAA.owa2010.web.config" End If AALog " (+) RWWGuardSentry Configuration collected" End If If boolADUSInstalled = True Then Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\ADUS.WindowsService.xml") objXMLOutputFile.WriteLine "" ' Get ADUS Service Status AALog " " AALog " Detecting ADUS Service Status" Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service where Name = 'ADUS'") For Each objService In colRunningServices objXMLOutputFile.WriteLine vbTab & "" & objService.State & "" Next AALog " (+) Service Detection Complete" ' Get ADUS File Versions AALog " " AALog "Detecting ADUS Component Versions" If AAFolderExists("ADUS", "ADUS") Then AALog " " AAFileVersion "ADUS.exe","ADUS" AAFileVersion "ADUS.XmlSerializers.dll","ADUS" AAFileVersion "ADUSConfig.exe","ADUS" AAFileVersion "ADUSPostflight.exe","ADUS" AAFileVersion "DirSyncHelper.dll","ADUS" AAFileVersion "InstallUtil.exe","ADUS" End If AALog " (+) Version Detection Complete" objXMLOutputFile.WriteLine "" ' Get ADUS Application Log Set objXMLOutputFile = objFSO.CreateTextFile(strOutputPath & "\ADUS.ApplicationLog.xml") objXMLOutputFile.WriteLine "" AALog " " AALog "Querying AuthAnvil ADUS Application Event Log" Call QueryAAEventLog("Select * from Win32_NTLogEvent Where Logfile = 'Application' and (SourceName = 'ADUS' or SourceName = 'ADUSPostflight')") AALog " (+) AuthAnvil ADUS Application Event Log Query Complete" objXMLOutputFile.WriteLine "" ' Export Registry Settings AALog " " AALog "Collecting ADUS Registry Configuration Information" objWSHShell.Run "REG EXPORT " & Chr(34) & "HKEY_LOCAL_MACHINE\SOFTWARE\Scorpion Software\AuthAnvil\ADUS" & Chr(34) & " " & strOutputPath & "\ADUS.reg", 1, True If objFSO.FileExists(strOutputPath & "\ADUS.reg") Then objFSO.MoveFile strOutputPath & "\ADUS.reg", strOutputPath & "\ADUS.re_" End If AALog " (+) ADUS Registry Configuration collected" ' Get config files AALog " " AALog "Collecting AuthAnvil ADUS Configuration Files" If objFSO.FileExists(strBasePath & "ADUS\ADUS.InstallLog") Then objFSO.CopyFile strBasePath & "ADUS\ADUS.InstallLog", strOutputPath & "\ADUS.InstallLog" End If If objFSO.FileExists(strBasePath & "ADUS\ADUS.InstallState") Then objFSO.CopyFile strBasePath & "ADUS\ADUS.InstallState", strOutputPath & "\ADUS.InstallState" End If If objFSO.FileExists(strBasePath & "ADUS\ADUS.exe.config") Then objFSO.CopyFile strBasePath & "ADUS\ADUS.exe.config", strOutputPath & "\ADUS.exe.config" End If AALog " (+) AuthAnvil ADUS Configuration Files collected" ' Get debug logs (if present) AALog " " AALog "Collecting AuthAnvil ADUS Debug Log Files (If Present)" If objFSO.FileExists("C:\Logging\ADUSTrace.log") Then objFSO.CopyFile "C:\Logging\ADUSTrace.log", strOutputPath & "\ADUS.Trace.log" AALog " (+) ADUSTrace.log collected" End If AALog " (+) AuthAnvil ADUS Debug Logs collected" End If ' Housekeeping AALog " " AALog "Diagnostic information gathered." AALog "Please zip the " & strOutputDir & " folder and email it to:" AALog "support@scorpionsoft.com with your case number in the subject line." objLog.WriteLine FormatDateTime(Date(),2) & " " & FormatDateTime(Time(),4) & " Script Run Complete" '*********************************************************************************** ' Procedures. '*********************************************************************************** Sub AAFileVersion (ByVal sAAFile, sAAFolder) ' Determine the Version of a passed AuthAnvil file Dim oWSH Dim oFSO Dim bFileExists Dim sAAFilePath Dim cDrives Set oWSH = CreateObject("WScript.Shell") bFileExists = False Set oFSO = CreateObject("Scripting.FileSystemObject") sAAFilePath = objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\" & sAAFolder & "\" & sAAFile If oFSO.FileExists(sAAFilePath) Then bFileExists = True End If If bFileExists = True Then objXMLOutputFile.WriteLine vbTab & vbTab & "" & sAAFile objXMLOutputFile.WriteLine vbTab & vbTab & vbTab & "" & oFSO.GetFileVersion(sAAFilePath) & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" Else objXMLOutputFile.WriteLine vbTab & vbTab & "" & sAAFile objXMLOutputFile.WriteLine vbTab & vbTab & vbTab & "Not Found" objXMLOutputFile.WriteLine vbTab & vbTab & "" AALog " (!) " & sAAFile & " Not Found" End If End Sub Sub AAFileVersion32 (ByVal sAAFile, sAAFolder) ' Determine the Version of a passed AuthAnvil file Dim oWSH Dim oFSO Dim bFileExists Dim sAAFilePath Dim cDrives Set oWSH = CreateObject("WScript.Shell") bFileExists = False Set oFSO = CreateObject("Scripting.FileSystemObject") sAAFilePath = objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\Scorpion Software\" & sAAFolder & "\" & sAAFile If oFSO.FileExists(sAAFilePath) Then bFileExists = True End If If bFileExists = True Then objXMLOutputFile.WriteLine vbTab & vbTab & "" & sAAFile objXMLOutputFile.WriteLine vbTab & vbTab & vbTab & "" & oFSO.GetFileVersion(sAAFilePath) & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" Else objXMLOutputFile.WriteLine vbTab & vbTab & "" & sAAFile objXMLOutputFile.WriteLine vbTab & vbTab & vbTab & "Not Found" objXMLOutputFile.WriteLine vbTab & vbTab & "" AALog " (!) " & sAAFile & " Not Found" End If End Sub Sub AALog( sLogText ) ' Log output to a text file. If the script is in verbose mode, log output to screen also Dim sLogValue Dim oLogShell Set oLogShell = WScript.CreateObject("WScript.Shell") sLogValue = FormatDateTime(Date(),2) & " " & FormatDateTime(Time(),3) & " " & sLogText If (boolVerbose = True) Then WScript.Echo sLogText End If objLog.WriteLine sLogValue End Sub Sub QueryAAEventLog(sEventLogQuery) ' Query the Event log and write the entries to the XML File Dim oWMIService, cLoggedEvents Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set cLoggedEvents = oWMIService.ExecQuery (sEventLogQuery) For Each oEvent In cLoggedEvents objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oEvent.RecordNumber & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & GetDate(oEvent.TimeGenerated) & " " & GetTime(oEvent.TimeGenerated) & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oEvent.Type & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oEvent.EventCode & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oEvent.SourceName & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oEvent.Message & "" objXMLOutputFile.WriteLine vbTab & "" Next End Sub Sub QueryAASiteSettings(sAADB) ' Query the AuthAnvil database for site settings and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If Dim sSQLQuery sSQLQuery = "SELECT Sites.SiteName, Settings.SiteID, Settings.Duration, Settings.Threshold, Settings.SMTPServer, Settings.BaseURL, Settings.FromAddr FROM Settings, Sites WHERE Settings.SiteID = Sites.SiteID" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Duration") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Threshold") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SMTPServer") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("BaseURL") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("FromAddr") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QueryAASQLLog(sAADB) ' Query the AuthAnvil SQL log and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT * FROM LOGS ORDER BY TimeStamp DESC" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Timestamp") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Message") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("EventID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SourceIP") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Username") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QuerySSOApplicationConfigInfo(sAADB) ' Query the AuthAnvil SSO SQL SSO_ApplicationConfigInfo table and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT * FROM SSO_ApplicationConfigInfo ORDER BY ApplicationID" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SettingDisplayName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SettingNumber") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QuerySSOApplications(sAADB) ' Query the AuthAnvil SSO SQL SSO_Applications table and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT * FROM SSO_Applications ORDER BY ApplicationID" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationType") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationIconName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationURLRedirect") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationImageName") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QuerySSOSiteSettings(sAADB) ' Query the AuthAnvil SSO SQL SSO_Applications table and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT * FROM SSO_SiteSettings ORDER BY ApplicationID" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ApplicationID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("AttributeID") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Enabled") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting1") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting2") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting3") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting4") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting5") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting6") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting7") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting8") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting9") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Setting10") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QuerySSOAudit(sAADB) ' Query the AuthAnvil SSO SQL SSO_Audit table and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT * FROM SSO_Audit" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Id") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteId") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Timestamp") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("UserName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Message") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & ByteArrayToString(oRS("Data")) & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Source") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("AuditSignature") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QuerySSOException(sAADB) ' Query the AuthAnvil SSO SQL SSO_Exception table and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT ex.Message, ex.SiteId, ex.UserName, COUNT(*) AS TotalMessages, MIN(ex.Timestamp) AS FirstEntry, MAX(ex.Timestamp) AS LastEntry," & _ " (SELECT DISTINCT CAST(sub.CorrelationId AS varchar(MAX))+';' FROM SSO_Exception AS sub WHERE sub.Message=ex.Message FOR XML PATH(''), TYPE).value('.', 'varchar(MAX)') AS CorrelationIds" & _ " FROM SSO_Exception AS ex" & _ " GROUP BY ex.Message, ex.SiteId, ex.UserName" & _ " ORDER BY LastEntry DESC" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Message") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteId") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("UserName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("TotalMessages") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("FirstEntry") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("LastEntry") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("CorrelationIds") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QuerySSOServiceProvider(sAADB) ' Query the AuthAnvil SSO SQL SSO_ServiceProvider table and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT" & _ " sp.Id, sp.SiteId, spp.DisplayName, spp.Description, sp.Enabled, sp.ReplyToUrl, spau.AudienceUri," & _ " p.DisplayName AS 'ProtocolDisplayName', spp.TokenLifeTime, at.AuthenticationType," & _ " p.Enabled AS 'ProtocolEnabled', p.Discoverable AS 'ProtocolDiscoverable'" & _ " FROM SSO_ServiceProvider sp" & _ " INNER JOIN SSO_ServiceProviderAudienceUri spau ON (sp.Id = spau.ServiceProviderId)" & _ " INNER JOIN SSO_ServiceProviderProperty spp ON (sp.Id = spp.ServiceProviderId)" & _ " INNER JOIN SSO_Protocol p ON (sp.ProtocolId = p.Id)" & _ " INNER JOIN SSO_AuthenticationType at ON (sp.AuthenticationTypeId = at.Id)" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Id") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteId") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("DisplayName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Description") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Enabled") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ReplyToUrl") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("AudienceUri") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ProtocolDisplayName") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("ProtocolDiscoverable") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub Sub QuerySSOScheduler(sAADB) ' Query the AuthAnvil SSO SQL SSO_Scheduler table and write the entries to the XML File Dim oCN, sConnection Set oCN = CreateObject("ADODB.Connection") sConnection = "Driver={SQL Server};" & sAADB On Error Resume Next oCN.Open sConnection If Err.Number <> 0 Then objXMLOutputFile.WriteLine vbTab & "Could not open database connection" Err.clear Exit Sub End If On Error Goto 0 Dim sSQLQuery sSQLQuery = "SELECT * FROM SSO_Scheduler" Dim oRS Set oRS = CreateObject("ADODB.Recordset") Set oRS = oCN.Execute(sSQLQuery) Do Until oRS.EOF objXMLOutputFile.WriteLine vbTab & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Id") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("SiteId") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("TaskId") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Name") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("WorkerProcessId") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Started") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Completed") & "" objXMLOutputFile.WriteLine vbTab & vbTab & "" & oRS("Message") & "" objXMLOutputFile.WriteLine vbTab & "" oRS.MoveNext Loop oRS.Close oCN.Close End Sub '*********************************************************************************** ' Functions. '*********************************************************************************** Function AAFolderExists (ByVal sFolder, sFriendlyName) ' Returns TRUE or False based on the existence of an AuthAnvil Folder. Dim oWSH Dim bFolderExists Dim oFSO Dim cDrives Set oWSH = CreateObject("WScript.Shell") bFolderExists = False Set oFSO = CreateObject("Scripting.FileSystemObject") strAAFolderPath = objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES%") & "\Scorpion Software\" & sFolder & "\" If oFSO.FolderExists(strAAFolderPath) Then bFolderExists = True AALog " (+) " & sFriendlyName & " folder detected" Else bFolderExists = False AALog " (!) " & sFriendlyName & " folder not detected on this computer" End If AAFolderExists = bFolderExists End Function Function AAFolderExists32 (ByVal sFolder, sFriendlyName) ' Returns TRUE or False based on the existence of an AuthAnvil Folder. Dim oWSH Dim bFolderExists Dim oFSO Dim cDrives Set oWSH = CreateObject("WScript.Shell") bFolderExists = False Set oFSO = CreateObject("Scripting.FileSystemObject") strAAFolderPath = objWSHShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\Scorpion Software\" & sFolder & "\" If oFSO.FolderExists(strAAFolderPath) Then bFolderExists = True AALog " (+) " & sFriendlyName & " folder detected" Else bFolderExists = False AALog " (!) " & sFriendlyName & " folder not detected on this computer" End If AAFolderExists32 = bFolderExists End Function Function DomainRole() ' Determines what role this computer plays in the network that it is joined to and returns that role Dim oWMI, colComputer Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colComputer = oWMI.ExecQuery ("Select DomainRole from Win32_ComputerSystem") For Each oComputer In colComputer iDR = oComputer.DomainRole Next Select Case iDR Case 0 DomainRole = "Standalone Workstation" Case 1 DomainRole = "Member Workstation" Case 2 DomainRole = "Standalone Server" Case 3 DomainRole = "Member Server" Case 4 DomainRole = "Backup Domain Controller" Case 5 DomainRole = "Primary Domain Controller" Case Else DomainRole = "Unknown" End Select End Function Function GetTime(sWmiDate) ' Pass in a WMI date like "20041229114458.000000-360" ' Returns in military hour:min:sec format, with hours from 0 to 23. ' Does NOT set to UTC or Zulu time; this is local time at the machine. GetTime = Mid(sWmiDate,9,2) & ":" & Mid(sWmiDate,11,2) & ":" & Mid(sWmiDate,13,2) GetTime = TimeValue(GetTime) 'RecordSet needs a VB Date value. End Function Function GetDate(sWmiDate) ' Pass in a WMI date like "20041229114458.000000-360" ' _____________MONTH_____________________DAY_______________________YEAR_________ GetDate = Mid(sWmiDate,5,2) & "/" & Mid(sWmiDate,7,2) & "/" & Mid(sWmiDate,3,2) GetDate = DateValue(GetDate) 'RecordSet needs a VB Date value. End Function Function IsUsingCscript() ' Determines if the script is being run using cscript.exe Dim iPosition iPosition = InStr( LCase(WScript.FullName) , "cscript.exe" ) If iPosition = 0 Then IsUsingCscript = False Else IsUsingCscript = True End Function Function RegKeyExists(ByVal sRegKey) ' Returns TRUE or False based on the existence of a registry key. Dim oSHell, bKeyExists Set oSHell = CreateObject("WScript.Shell") bKeyExists = False On Error Resume Next Err.Clear oSHell.RegRead sRegKey If Err.Number <> 0 Then bKeyExists = False ElseIf Err.Number = 0 Then bKeyExists = True Else AALog " (X) Cannot read registry key, quitting" WScript.Quit End If RegKeyExists = bKeyExists End Function Function ByteArrayToString(input) ' If the input is a ByteArray, return it as a String; otherwise, just return the original value. If VarType(input) = (vbByte + vbArray) Then Dim i, tempStr tempStr = "0x" For i = 1 To LenB(input) tempStr = tempStr & Right("0" & Hex(AscB(MidB(input, i, 1))), 2) Next ByteArrayToString = tempStr Else ByteArrayToString = input End If End Function 'END OF SCRIPT************************************************************************