Imports System Imports System.IO Imports System.Data.OleDb Imports System.Data.Odbc Imports System.TimeSpan Imports System.Math Imports System.Management Imports System.Text Imports System.Security.Cryptography Imports Microsoft.Win32 Imports System.DirectoryServices Public Class AutomatedSystemScan Inherits System.Web.UI.Page Dim cnnCommand As New System.Data.OleDb.OleDbCommand Dim cnnDataReader As System.Data.OleDb.OleDbDataReader Dim lstItem As ListItem Dim strDBConnection As String = "Provider=sqloledb;Data Source=;Initial Catalog=;Integrated Security=SSPI;" ' new above Dim conn As New System.Data.SqlClient.SqlConnection Dim da As New System.Data.SqlClient.SqlDataAdapter Dim ds As New DataSet Dim func As New func Dim qry As String Dim qrytest As String '______________________________Autochecklist Main/Security/Login Variables______________________________________ Dim strWebsiteHomeFolder As String = "d:\Inetpub\wwwroot\web\test_apps\BensWork\Test2\" 'Change when deployed. Dim strUser As String ' New Impersonation Variables Dim strUserPass As String Dim strUserServerName As String Dim strUserDomainName As String Dim strPW As String ' Security Variables Dim strSecurePW As String Dim strUserName As String = Dim strNTLMDomain As String Dim strFormatConnectionAuthority As String Dim clsSQLQuery As New classSQLQuery ' Database Query Class Dim objMgmt As ManagementObject ' Registry Key Object Dim objManagementScope As ManagementScope ' Registry Key Object Dim objManagementClass As ManagementClass ' Registry Key Object Dim objManagementBaseObject As ManagementBaseObject ' Registry Key Object Dim clsGetPassword As New classGetPassword Dim objSearchDD As ManagementObjectSearcher ' Disk Drives Dim objSearchLD As ManagementObjectSearcher ' Logical Drive Info Dim objSearchDM As ManagementObjectSearcher ' Desktop Monitor Dim objSearchWS As ManagementObjectSearcher ' Windows Services Dim objSearchHDD As ManagementObjectSearcher Dim objSearchPage As ManagementObjectSearcher Dim objSearchOS As ManagementObjectSearcher Dim strLoginXML As String '_________________________________Server Build Database - PreSet Vars_______________________ Dim strServerID As String Dim strServerName As String Dim strDomainName As String Dim strIPAddress As String Dim strOS As String Dim strRIBpresent As String Dim strRIBipAddress As String Dim strDNSsuffix As String Dim strADOU As String Dim strGateway As String Dim strSubnetMask As String Dim strWINS1 As String Dim strWINS2 As String Dim strDNS1 As String Dim strDNS2 As String Dim strDNS3 As String Dim strBuildType As String Dim strServerConfig As String Dim strArrayConfig As String Dim strPartitionInfo As String '________________________________Master Boolean List of Passed Tests________________________________ Dim intFileNameSIM As Integer = 0 Dim intFileNameTSMOpFile As Integer = 0 Dim intFileNameBackupExec As Integer = 0 Dim intDrives As Integer = 0 Dim intPageFileSizeChecked As Integer = 0 Dim intChkHWDiskSize As Integer = 0 Dim strCDROMdriveLetter As String Dim intChkCDROMdriveLetter As Integer = 0 Dim intChkScreenResolution As Integer = 0 Dim intShortDateFormat As Integer = 0 Dim intBITSOK As Integer = 0 Dim intLegalNoticeCap As Integer = 0 Dim intLegalNoticeText As Integer = 0 Dim intDefaultDomainName As Integer = 0 Dim intCachedLogonsCount As Integer = 0 Dim intDontDisplayLastUserName As Integer = 0 Dim intAllocateCDROMs As Integer = 0 Dim intAllocateFloppies As Integer = 0 Dim intShutdownWithoutLogon As Integer = 0 Dim intTemplateUsed As Integer = 0 Dim intNetworkName As Integer = 0 Dim intTivoliPath As Integer = 0 Dim intIntelServerImageVersion As Integer = 0 Dim intSymProductVersion As Integer = 0 Dim intAntiVirus As Integer = 0 Dim intIISAdminOK As Integer = 0 Dim intWWWServiceOK As Integer = 0 Dim intNNTPServiceOK As Integer = 0 Dim intSMTPServiceOK As Integer = 0 Dim intAutoUpdatesOK As Integer = 0 Dim intRenameMaverick As Integer = 0 Dim intReadCreateCommRights As Integer = 0 Dim intSendAuthenticationTrap As Integer = 0 Dim intBootTimeOutCheck As Integer = 0 Dim intAutoRestartOn As Integer = 0 Dim intKernelMemDump As Integer = 0 Dim intServernameMatches As Integer = 0 Dim intDuplexSettingCheck As Integer = 0 Dim intChkRiloEnabled As Integer = 0 Dim intChkRiloXfrAutoSelectOff As Integer = 0 Dim intChkRiloSpeed100Mbs As Integer = 0 Dim intChkRiloFullDuplex As Integer = 0 Dim intChkRiloDisenableDHCP As Integer = 0 Dim intChkRiloNoRegisterwithWINS As Integer = 0 Dim intChkRiloNoRegisterwithDNS As Integer = 0 Dim intChkRiloRenameAdministrator As Integer = 0 Dim intChkRiloDomainName As Integer = 0 Dim intChkRiloPrimaryDNS As Integer = 0 Dim intChkRiloSecondaryDNS As Integer = 0 Dim intChkRiloConnection As Integer = 0 Dim intChkRiloEverConnect As Integer = 0 Dim intChkPasswordHistory As Integer = 0 Dim intChkMaxPasswordAge As Integer = 0 Dim intChkMinPasswordAge As Integer = 0 Dim intChkMinPasswordLength As Integer = 0 Dim intChkAccountLockoutDuration As Integer = 0 Dim intChkAccountInvalidLogin As Integer = 0 Dim intChkAccountLockoutCounter As Integer = 0 Dim intAuditAccountLogonSuccess As Integer = 0 Dim intAuditAccountLogonFailure As Integer = 0 Dim intAuditAccountManagementSuccess As Integer = 0 Dim intAuditAccountManagementFailure As Integer = 0 Dim intAuditAccountDSASuccess As Integer = 0 Dim intAuditAccountDSAFailure As Integer = 0 Dim intAuditAccountLogonEventSuccess As Integer = 0 Dim intAuditAccountLogonEventFailure As Integer = 0 Dim intAuditAccountObjectAccessSuccess As Integer = 0 Dim intAuditAccountObjectAccessFailure As Integer = 0 Dim intAuditAccountPolicyChangeSuccess As Integer = 0 Dim intAuditAccountPolicyChangeFailure As Integer = 0 Dim intAuditAccountPrivilegeUseSuccess As Integer = 0 Dim intAuditAccountPrivilegeUseFailure As Integer = 0 Dim intAuditAccountProcessTrackingSuccess As Integer = 0 Dim intAuditAccountProcessTrackingFailure As Integer = 0 Dim intAuditAccountSystemEventsSuccess As Integer = 0 Dim intAuditAccountSystemEventsFailure As Integer = 0 Dim intSecondaryVideoAdapter As Integer = 0 Dim intLSASAM As Integer = 0 Dim intIPAddressLocated As Integer = 0 Dim intGatewayLocated As Integer = 0 Dim intSubnetLocated As Integer = 0 Dim intDomainLocated As Integer = 0 Dim intDNSRegistrationChecked As Integer = 0 Dim intDNS1Located As Integer = 0 Dim intDNS2Located As Integer = 0 Dim intDNS3Located As Integer = 0 Dim intAppEventMaxSize As Integer = 0 Dim intAppEventLogFileSizeZero As Integer = 0 Dim intAppEventLogFileOverwrite As Integer = 0 Dim intAppEventLogCheck As Integer = 0 Dim intSecEventMaxSize As Integer = 0 Dim intSecEventLogFileSizeZero As Integer = 0 Dim intSecEventLogFileOverwrite As Integer = 0 Dim intSecEventLogCheck As Integer = 0 Dim intSysEventMaxSize As Integer = 0 Dim intSysEventLogFileSizeZero As Integer = 0 Dim intSysEventLogFileOverwrite As Integer = 0 Dim intSysEventLogCheck As Integer = 0 Dim intSNMPTrap1ID As Integer = 0 Dim intSNMPTrap2ID As Integer = 0 Dim intSNMPTrap3ID As Integer = 0 Dim intSNMPHosts1 As Integer = 0 Dim intSNMPHosts2 As Integer = 0 Dim intSNMPHosts3 As Integer = 0 Dim intUncheckLMHostLookup As Integer = 0 Dim intNBTEnabled As Integer = 0 Dim intSecedAdminName As Integer = 0 Dim intSecedGuestName As Integer = 0 Dim intSecedEnableGuest As Integer = 0 Dim intSecedRemoteSD As Integer = 0 Dim intSecedAdminSD As Integer = 0 Dim intNetIDShowNetIcon As Integer = 0 Dim intRegistrationEnabled As Integer = 0 Dim intWINS1Located As Integer = 0 Dim intWINS2Located As Integer = 0 Dim intLocateLocalGA As Integer = 0 Dim intSNMPAgentTab As Integer = 0 Dim intSNMPBusinessUnitContact As Integer = 0 Dim intSNMPServerLocation As Integer = 0 Dim intSNMPServerMaverick As Integer = 0 Dim intSNMPAuthenticationTrap As Integer = 0 Dim intSNMPrenametoIntelServer As Integer = 0 Dim intSNMPAcceptableHOSTS As Integer = 0 Dim intSNMPAcceptableHOSTSOK As Integer = 0 '______________________________________SCAN VARIABLES_______________________________________________ Dim intScanServerMasterSwitch = 0 Dim intFormComplete = 0 Dim intIDNetCardValue As Integer Dim strSIMPath As String = "" Dim strLargeSysCache As String = "" Dim strPriorityControl As String = "" Dim strTCPIPWindow As String = "" Dim strTSMOpLabel As String = "" Dim strImageType As String = "" Dim strArraySelectID As String = "" Dim xx As Integer = 1 Dim strNetIDArray() As String Dim strMemorySize As String Dim strPageFileSize As String Dim strActualMemorySize As String Dim strActualPageFileSize As String Dim strOSVersion As String Dim strOSPackVersion As String Dim ActualPageFileSize As String Dim strScreenHeight As String Dim strScreenWidth As String Dim strFileNameFNM As String = "" Dim strFileNameFRC As String = "" Dim strFileNameFAP As String = "" Dim strFileNameFSS As String = "" Dim strFileNameFSK As String = "" Dim strDiskSize As String = "1.1" Dim strDiskSize1 As String = "1.1" Dim strDiskSize2 As String = "1.1" Dim strDiskSize3 As String = "1.1" Dim strDiskSize4 As String = "1.1" Dim strDiskSize5 As String = "1.1" Dim strDiskSize6 As String = "1.1" Dim strShortDateFormat As String 'Registry Scan Variables: Dim myValue As String Dim aSubKeys() As String Dim strkey As String Dim m_strServiceName As String Dim m_strServiceState As String Dim m_strServiceStartMode As String Dim strBITSState As String ' checkbox0.gif=unchecked Dim strBITSStartMode As String ' checkbox1.gif=checked Dim strBITSBaselineState As String Dim strBITSBaselineStartMode As String Dim strSNMPState As String ' strBaseline = Baseline Value Dim strSNMPStartMode As String Dim strSNMPBaselineState As String Dim strSNMPBaselineStartMode As String Dim strAntiVirusState As String Dim strAntiVirusStartMode As String Dim strTelephonyState As String Dim strTelephonyStartMode As String Dim strTelephonyBaselineState As String Dim strTelephonyBaselineStartMode As String Dim strTelephonyBaselineState2 As String Dim strTelephonyBaselineStartMode2 As String Dim strTelephonyBaselineState3 As String Dim strTelephonyBaselineStartMode3 As String Dim strTSMBackupSchedState As String Dim strTSMBackupSchedStartMode As String Dim strTSMBackupBaselineState As String Dim strTSMBackupBaselineStartMode As String Dim strIISAdminState As String Dim strIISAdminStartMode As String Dim intIISAdminBaseline As Integer = 1 Dim strIISAdminBaselineState As String Dim strIISAdminBaselineStartMode As String Dim strWWWServiceState As String Dim strWWWServiceStartMode As String Dim intWWWServiceBaseline As Integer = 1 Dim strWWWServiceBaselineState As String Dim strWWWServiceBaselineStartMode As String Dim strNNTPServiceState As String Dim strNNTPServiceStartMode As String Dim intNNTPServiceBaseline As Integer = 1 Dim strNNTPServiceBaselineState As String Dim strNNTPServiceBaselineStartMode As String Dim strSMTPServiceState As String Dim strSMTPServiceStartMode As String Dim intSMTPServiceBaseline As Integer = 1 Dim strSMTPServiceBaselineState As String Dim strSMTPServiceBaselineStartMode As String Dim strAutoUpdatesState As String Dim strAutoUpdatesStartMode As String Dim strAutoUpdatesBaselineState As String Dim strAutoUpdatesBaselineStartMode As String Dim strTivoliEndpointState As String Dim strTivoliEndpointStartMode As String Dim strTivoliEndpointBaselineState As String Dim strTivoliEndpointBaselineStartMode As String Dim strIISAdminBaselineState2 As String Dim strIISAdminBaselineStartMode2 As String Dim strIISAdminBaselineState3 As String Dim strIISAdminBaselineStartMode3 As String Dim strWWWServiceBaselineState2 As String Dim strWWWServiceBaselineStartMode2 As String Dim strWWWServiceBaselineState3 As String Dim strWWWServiceBaselineStartMode3 As String Dim strNNTPServiceBaselineState2 As String Dim strNNTPServiceBaselineStartMode2 As String Dim strNNTPServiceBaselineState3 As String Dim strNNTPServiceBaselineStartMode3 As String Dim strSMTPServiceBaselineState2 As String Dim strSMTPServiceBaselineStartMode2 As String Dim strSMTPServiceBaselineState3 As String Dim strSMTPServiceBaselineStartMode3 As String Dim myKeyValue As String Dim myPathValue As String Dim my2ndKeyValue As String Dim strKeyPath As String ' This Key Changes depending on the scan Dim inta As Integer ' Iterator Dim intb As Integer ' Iterator Dim intc As Integer ' Iterator Dim intd As Integer ' Iterator Dim inte As Integer ' Iterator' Dim strRenameMaverick As String Dim strDDLUNsetting As String Dim strSMTPAuthenticationTrap As String Dim strDuplexPath As String Dim intNetIDLength As Integer Dim arrNetIDSubKeys() As String Dim intNetIDDuplex As Integer Dim strNetIDDuplexPath As String Dim strNetIDTarget As String Dim arrCardLocator() As String Dim intCardLocatorArray As Integer Dim strSecondLevelValue As String Dim strNetCfgforDuplexLocation As String Dim strHDDArrayState As String Dim strHDDArrayStartMode As String Dim intStartSharing As Integer Dim intSharingType As Integer Dim arrDiskDrives() As String Dim ActualMemorySize As String Dim strCreateAdminLabel As String '_________________________DB DYNAMIC VARIABLES - Actual Values retrieved from database_________________ Dim intLoadLatestSettings As Integer = 1 Dim strTCPServerAddy As String Dim strChkRiloEnabled As String Dim strBACKUPChkRiloEnabled As String Dim strChkRiloXfrAutoSelectOff As String Dim strBACKUPChkRiloXfrAutoSelectOff As String Dim strChkRiloSpeed100Mbs As String Dim strChkRiloFullDuplex As String Dim strChkRiloDisenableDHCP As String Dim strChkRiloNoRegisterwithWINS As String Dim strChkRiloNoRegisterwithDNS As String Dim strChkRiloRenameAdministrator As String Dim strChkRiloDomainName As String Dim strChkRiloPrimaryDNS As String Dim strChkRiloSecondaryDNS As String Dim strChkRiloConnection As String Dim strChkPasswordHistory As String Dim strChkMaxPasswordAge As String Dim strChkMinPasswordAge As String Dim strChkMinPasswordLength As String Dim strChkAccountLockoutDuration As String Dim strChkAccountInvalidLogin As String Dim strChkAccountLockoutCounter As String Dim strAuditAccountLogon As String Dim strAuditAccountManagement As String Dim strAuditAccountDSA As String Dim strAuditAccountLogonEvent As String Dim strAuditAccountObjectAccess As String Dim strAuditAccountPolicyChange As String Dim strAuditAccountPrivilegeUse As String Dim strAuditAccountProcessTracking As String Dim strAuditAccountSystemEvents As String Dim strSecondaryVideoAdapter As String Dim strSecondaryVideoValue As String Dim strSecondaryVideoValueCompare As String = "1" Dim uInt32AppLogMaxSize As String Dim uInt32AppLogOverwrite As String Dim AppLogFileSize As Long Dim uInt32SecLogMaxSize As String Dim uInt32SecLogOverwrite As String Dim SecLogFileSize As Long Dim uInt32SysLogMaxSize As String Dim uInt32SysLogOverwrite As String Dim SysLogFileSize As Long Dim strSNMPTrap1ID As String Dim strSNMPTrap2ID As String Dim strSNMPTrap3ID As String Dim strSNMPHosts1 As String Dim strSNMPHosts2 As String Dim strSNMPHosts3 As String Dim strUncheckLMHostLookup As String Dim strNBTEnabled As String Dim strNetIDGUID As String Dim strNetIDInstanceID As String = "Blank" Dim strNetIDShowNetIcon As String Dim uInt32ShowNetworkIcon As String Dim uInt32DNSRegistration As String Dim strVerifyFNM As String Dim strVerifyFRC As String Dim strVerifyFAP As String Dim strVerifyFSS As String Dim strVerifyFSK As String Dim strDefaultDomainName As String Dim strCachedLogonsCount As String Dim strDontDisplayLastUserName As String Dim strAllocateCDROMs As String Dim strAllocateFloppies As String Dim strShutdownWithoutLogon As String Dim strSecTemplateKey As String Dim strTemplateUsed As String Dim strDCNameKey As String Dim strDCValue As String Dim strNetworkName As String Dim strTivoliKey As String Dim strTivoliPath As String Dim strTivoliSetting As String Dim strSymantecKey As String Dim strSymProductVersion As String Dim strStdSymantecProductVersion Dim strIntelTeamImageKey As String Dim strIntelServerImageVersion As String Dim strIntelImageSetting As String Dim strLSAChecks As String Dim strLSASAM As String Dim strIPPathname As String Dim strIPAddress2Check As String Dim strGateway2Check As String Dim strSubnetMask2Check As String Dim strDomain2Check As String Dim strDNSNames2Check1 As String Dim strDNSNames2Check2 As String Dim strDNSNames2Check3 As String Dim strDomainKey As String Dim strIPKey As String Dim strGatewayKey As String Dim strSubnetMaskKey As String Dim strDNSKey As String Dim strWINSKeyPath As String Dim strWINS12Check As String Dim strWINS22Check As String Dim arrSubKeys() As String Dim arrWINSSubKeys() As String Dim intArrayLength As Integer Dim i As Integer ' Iterator Dim strSNMPBusinessUnitContact As String Dim strSNMPBusinessUnitContactPathname As String Dim strSNMPBusinessUnitContactKey As String Dim strSNMPServerLocation As String Dim strSNMPServerLocationPathname As String Dim strSNMPServerLocationKey As String Dim strSNMPMaverickPathname As String Dim strSNMPMaverickTrapPathname As String Dim strSNMPServerMavName As String Dim strSNMPAuthenticationTrap As String Dim strSNMPAuthenticationTrapPathname As String Dim strSNMPAuthenticationTrapKey As String Dim strSNMPrenametoIntelServerPathname As String Dim strSNMPrenametoIntelServerKey As String Dim strSNMPAcceptableHOSTSPathname As String Dim strSNMPAcceptableHOSTSKey As String = "1" '2 and 3 Dim strLegalsKey As String ' HKLM" Dim strLegalNoticeCaption As String Dim strLegalNoticeText As String Dim strLegalNoticeCaptionText As String Dim strLegalNoticeTextContent As String Dim strStdDateFormat As String Dim strStdDomainName As String Dim strStdIntLogonCount As String Dim strStdSecurityTemplate1 As String Dim strStdSecurityTemplate2 As String Dim strAppEventLogPath As String Dim strAppEventLogMaxSizeKey As String Dim strAppEventLogOverwriteKey As String Dim strAppEventLogMaxSizeValue As String Dim strAppEventLogOverwriteKeyValue As String Dim strSecEventLogPath As String Dim strSecEventLogMaxSizeKey As String Dim strSecEventLogOverwriteKey As String Dim strSecEventLogMaxSizeValue As String Dim strSecEventLogOverwriteKeyValue As String Dim strSysEventLogPath As String Dim strSysEventLogMaxSizeKey As String Dim strSysEventLogOverwriteKey As String Dim strSysEventLogMaxSizeValue As String Dim strSysEventLogOverwriteKeyValue As String Dim strSuffixAppFileName As String Dim strSuffixSecFileName As String Dim strSuffixSysFileName As String Dim strSNMPTrap1 As String Dim strSNMPTrap2 As String Dim strSNMPTrap3 As String Dim strSNMPHostVerify1A As String Dim strSNMPHostVerify1B As String Dim strSNMPHostVerify2A As String Dim strSNMPHostVerify2B As String Dim strSNMPHostVerify3A As String Dim strSNMPHostVerify3B As String Dim strLMHostLookupPath As String Dim strNBTEnabledPath As String Dim strSecedAdminName As String Dim strSecedGuestName As String Dim strSecedEnableGuest As String Dim strSecedRemoteSD As String Dim strSecedAdminSD As String Dim strDontDisplayPath As String Dim strBootTimeOutCheck As String Dim strAutoRestartPath As String Dim strKernelMemDump As String Dim NetIDPathPrefix As String Dim NetIDClassPath As String = NetIDPathPrefix & "Enum\Root\MS_NDISWANIP\0000\" Dim NetIDClassKey As String Dim strNetIDDuplexLocator As String Dim strCardLocator As String Dim strBaselineDuplexSetting As String Dim strNewKeyforLogon As String ' HKLM" Dim strSNMPTrap1B As String Dim strSNMPTrap2B As String Dim strNewNetIDGUID As String Dim strNewShowIcon As String Dim strNewIPAddress As String Dim strNewIPArray() As String Dim intNewIPArrayLength As Integer Dim strNewGateway As String Dim strNewGatewayArray() As String Dim intNewGatewayArrayLength As Integer Dim strNewSubnetMask As String Dim strNewSubnetMaskArray() As String Dim intNewSubnetMaskArrayLength As Integer Dim arrSDSubKeys() As String Dim intSDSubKeyLength As Integer Dim strNewWINS As String Dim strNewWINSArray() As String Dim intNewWINSArrayLength As Integer Dim strNewDNS As String Dim strNewDNSArray() As String Dim intNewDNSArrayLength As Integer Dim strNewEnumKeyPath As String ' "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\" Dim strNetworkCardType1 As String ' = "4102" ' 100/Full for some cards Dim strNetworkcardType2 As String ' = "4" ' 100/Full for some cards Dim strSecBaseFileSize As String ' 100000 ' ensures a cleared out log Dim strSysBaseFileSize As String ' 100000 Dim strAppBaseFileSize As String ' 100000 Dim strSNMPReadCreateCommBase As String ' 16 Dim strSNMPProfileImagePath As String ' "ProfileImagepath" Dim strCrashDumpEnabledKey As String ' "CrashDumpEnabled" Dim strAutoRebootKey As String ' "AutoReboot" Dim strNBTStartKey As String ' "Start" Dim strEnableLMHostsKey As String ' "EnableLMHOSTS" Dim strComputerNameKey As String ' "ComputerName" Dim strComputerNamePath As String ' "SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\" Dim strSNMPEnableAuthTraps As String ' "EnableAuthenticationTraps" Dim strSNMPRenMavKey As String ' "-IntelServer" Dim strSNMPTrapParmsPath As String ' "SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\" Dim strFPShareTypePath As String ' "SYSTEM\CurrentControlSet\Services\lanmanserver\" Dim strFPShareTypeKey As String ' "Type" Dim strFPShareKey As String ' "Start" Dim strFPShareTypeBaseValue As String ' "32" Dim strFPShareBaseValue As String ' "2" Dim strDNSRegKeyName As String ' "Domain" Dim strDNSRegEnabledKey As String ' "RegistrationEnabled" Dim strDNSNetCfgInstanceIDKey As String ' "NetCfgInstanceID" Dim strNICDuplexSpeedRate1 As String ' "SpeedDuplex" Dim strNICDuplexSpeedRate2 As String ' "RequestedMediaType" Dim strNetworkNameServer As String ' "NameServer" Dim strNetworkNameServerList As String ' "NameServerList" Dim strNetworkPrefixNetBT As String ' "SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces\Tcpip_" Dim strNetworkSubnetMaskKey As String ' "SubnetMask" Dim strNetworkGatewayKey As String ' "DefaultGateway" Dim strNetworkIPKeyName As String ' "IPAddress" Dim strNetworkShowIconKey As String ' "ShowIcon" Dim strNewNetworkPathPrefix As String ' "SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\" Dim strNewNetworkPathSuffix As String ' "\Connection\" Dim strNewNetIDPath As String ' "SOFTWARE\Microsoft\EAPOL\Parameters\General\" Dim strNewNetIDKey As String ' "InterfaceList" Dim strNewShortDatePath As String ' ".DEFAULT\Control Panel\International\" Dim strNewShortDateKey As String ' "sShortDate" Dim strDefaultFSKFilename As String ' "\c$\Documents and Settings\All Users\Start Menu\Programs\Windows Resource Kit Tools\Windows Resource Kit Tools Help.lnk" Dim strDefaultFSSFilename As String ' "\c$\Documents and Settings\All Users\Start Menu\Programs\Windows Support Tools\Support Tools Help.lnk" Dim strDefaultFAPFilename As String ' "\c$\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools\Windows Server 2003 Administration Tools Pack Help.lnk" Dim strDefaultFRCFilename As String ' "\c$\cmdcons\KBDCA.DLL" Dim strDefaultFNMFilename1 As String ' "\c$\WINDOWS\system32\netmon\netmon.exe" Dim strDefaultFNMFilename2 As String ' "\c$\WINNT\system32\netmon\netmon.exe" Dim strWMIDDquery As String ' "SELECT * FROM Win32_DiskDrive" <- Updated in SQL Dim strWMILogicalquery As String ' "SELECT * FROM Win32_LogicalDisk" Dim strWMIDisplayquery As String ' "SELECT * FROM Win32_DisplayConfiguration" Dim strWMIServicesquery As String ' "SELECT * FROM Win32_Service" Dim strWMIHDDArrayquery As String ' "SELECT * FROM Win32_SystemDriver where caption='Cpqarray'" Dim strWMIPagefilequery As String ' "SELECT * FROM Win32_LogicalMemoryConfiguration" Dim strWMIOSquery As String ' "SELECT * FROM Win32_OperatingSystem" Dim strTSMOpFileLocation As String Dim strPriorityControlPath As String Dim strPriorityControlKey As String Dim strMemMgmtPath As String Dim strMemMgmtKey As String Dim strBackupExecPath As String Dim strWindowSizePath As String Dim strWindowSizeKey As String '_________________________________Text Replacements after successful scan_____________________________ Dim strChk1_1 As String = "Enable NIC" Dim strChk1_2 As String = "Tranceiver Speed Autoselect Off" Dim strChk1_3 As String = "Speed to 100 Bmits/s" Dim strChk1_4 As String = "Full Duplex" Dim strChk1_5 As String = "Dis-enable DHCP" Dim strChk1_6 As String = "Don't register with WINS" Dim strChk1_7 As String = "Don't register with DNS" Dim strChk1_8 As String = "Rename Administrator" Dim strChk2_1 As String = "Mirrored 18GB System Array" Dim strChk2_2 As String = "Disable The Extra Display Adapter" Dim strChk2_3 As String = "CD-ROM is the R drive" Dim strChk2_4 As String = "Configure Network Connections" Dim strChk2_5 As String = "1. 100 Full Duplex" Dim strChk2_6 As String = "2. Show icon in taskbar" Dim strChk2_7 As String = "3. File and Printer Sharing for Microsoft Networks" Dim strChk2_8 As String = "4. TCP/IP Settings" Dim strChk2_9 As String = "1. IP Address, Subnet Mask, and Default Gateway" Dim strChk2_10 As String = "2. DNS" Dim strChk2_11 As String = "3. WINS" Dim strChk3_1 As String = "Select IIS unless it's an Exchange or Web server" Dim strChk3_2 As String = "If it's an Exchange server, select NNTP Server, SMTP Service and WWW Server." Dim strChk3_3 As String = "Select Management and Monitoring Tools and Simple Network Management Protocol (SNMP)" Dim strChk3_4 As String = "Verify Administrative Tools/Monitoring" Dim strChk3_5 As String = "Current OS Service Pack" Dim strChk3_6 As String = "IE6 Service Pack 1" Dim strChk3_7 As String = "Run Hotfixes Scanner from Intel Server website" Dim strChk3_8 As String = "Check for Symantec Applications" Dim strChk3_9 As String = "TSM or Backup Exec" Dim strChk3_10 As String = "Tivoli Endpoint" Dim strChk4_1 As String = "Verify that the Administrator account is renamed to Admin" Dim strChk4_2 As String = "Verify the Guest account is renamed to LocalGA and disabled" Dim strChk4_3 As String = "Verify that in the Administrators group that the TitanBaseusa\Domain Admins group, TitanBaseusa\h240 NT Netware Team, and any other global group requested by the client is added." Dim strChk4_4 As String = "Account Policies > Password Policy" Dim strChk4_5 As String = "Account Policies > Account Lockout Policy" Dim strChk4_6 As String = "Account Policies > Account Lockout Policy" Dim strChk4_7 As String = "Select User Rights Assignments. Verify:" Dim strChk4_8 As String = "Select Security Options" Dim strChk5_1 As String = "Configure Server For Remote SNMP Reboot" Dim strChk5_2 As String = "Modify short date format to mm/dd/yyyy" Dim strChk5_3 As String = "800x600 Display Settings" Dim strChk5_4 As String = "Server Specific" Dim strChk5_5 As String = "Server Specific" Dim strChk5_6 As String = "Configure Service Settings" Dim strChk5_7 As String = "Agent Tab" Dim strChk5_8 As String = "Trap Tab" Dim strChk5_9 As String = "Security Tab" Dim strChk5_10 As String = "Verify Telephony service is set to Automatic on Windows 2003 Servers ONLY!" #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. Private Sub InitializeComponent() End Sub Protected WithEvents plsWait As System.Web.UI.HtmlControls.HtmlGenericControl Protected WithEvents LabelSIM As System.Web.UI.WebControls.Label Protected WithEvents Label86 As System.Web.UI.WebControls.Label Protected WithEvents Label87 As System.Web.UI.WebControls.Label Protected WithEvents Label88 As System.Web.UI.WebControls.Label Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents Label2 As System.Web.UI.WebControls.Label Protected WithEvents Label3 As System.Web.UI.WebControls.Label Protected WithEvents Label4 As System.Web.UI.WebControls.Label Protected WithEvents Label5 As System.Web.UI.WebControls.Label Protected WithEvents Label6 As System.Web.UI.WebControls.Label Protected WithEvents Label7 As System.Web.UI.WebControls.Label Protected WithEvents Label8 As System.Web.UI.WebControls.Label Protected WithEvents Label9 As System.Web.UI.WebControls.Label Protected WithEvents Label10 As System.Web.UI.WebControls.Label Protected WithEvents Label11 As System.Web.UI.WebControls.Label Protected WithEvents Label12 As System.Web.UI.WebControls.Label Protected WithEvents Label13 As System.Web.UI.WebControls.Label Protected WithEvents Label14 As System.Web.UI.WebControls.Label Protected WithEvents Label15 As System.Web.UI.WebControls.Label Protected WithEvents Label16 As System.Web.UI.WebControls.Label Protected WithEvents Label17 As System.Web.UI.WebControls.Label Protected WithEvents Label18 As System.Web.UI.WebControls.Label Protected WithEvents Label19 As System.Web.UI.WebControls.Label Protected WithEvents Label20 As System.Web.UI.WebControls.Label Protected WithEvents Label21 As System.Web.UI.WebControls.Label Protected WithEvents Label22 As System.Web.UI.WebControls.Label Protected WithEvents Label23 As System.Web.UI.WebControls.Label Protected WithEvents Label24 As System.Web.UI.WebControls.Label Protected WithEvents Label25 As System.Web.UI.WebControls.Label Protected WithEvents Label27 As System.Web.UI.WebControls.Label Protected WithEvents Label28 As System.Web.UI.WebControls.Label Protected WithEvents Label29 As System.Web.UI.WebControls.Label Protected WithEvents Label31 As System.Web.UI.WebControls.Label Protected WithEvents Label30 As System.Web.UI.WebControls.Label Protected WithEvents Label32 As System.Web.UI.WebControls.Label Protected WithEvents Label34 As System.Web.UI.WebControls.Label Protected WithEvents Label33 As System.Web.UI.WebControls.Label Protected WithEvents Label35 As System.Web.UI.WebControls.Label Protected WithEvents Label36 As System.Web.UI.WebControls.Label Protected WithEvents Label37 As System.Web.UI.WebControls.Label Protected WithEvents Label38 As System.Web.UI.WebControls.Label Protected WithEvents Label39 As System.Web.UI.WebControls.Label Protected WithEvents Label40 As System.Web.UI.WebControls.Label Protected WithEvents Label41 As System.Web.UI.WebControls.Label Protected WithEvents Label42 As System.Web.UI.WebControls.Label Protected WithEvents Label43 As System.Web.UI.WebControls.Label Protected WithEvents Label44 As System.Web.UI.WebControls.Label Protected WithEvents Label45 As System.Web.UI.WebControls.Label Protected WithEvents Label46 As System.Web.UI.WebControls.Label Protected WithEvents Label47 As System.Web.UI.WebControls.Label Protected WithEvents Label48 As System.Web.UI.WebControls.Label Protected WithEvents Label49 As System.Web.UI.WebControls.Label Protected WithEvents Label50 As System.Web.UI.WebControls.Label Protected WithEvents Label51 As System.Web.UI.WebControls.Label Protected WithEvents Label52 As System.Web.UI.WebControls.Label Protected WithEvents Label53 As System.Web.UI.WebControls.Label Protected WithEvents Label54 As System.Web.UI.WebControls.Label Protected WithEvents Label55 As System.Web.UI.WebControls.Label Protected WithEvents Label56 As System.Web.UI.WebControls.Label Protected WithEvents Label57 As System.Web.UI.WebControls.Label Protected WithEvents Label58 As System.Web.UI.WebControls.Label Protected WithEvents Label59 As System.Web.UI.WebControls.Label Protected WithEvents Label60 As System.Web.UI.WebControls.Label Protected WithEvents Label61 As System.Web.UI.WebControls.Label Protected WithEvents Label62 As System.Web.UI.WebControls.Label Protected WithEvents Label63 As System.Web.UI.WebControls.Label Protected WithEvents Label64 As System.Web.UI.WebControls.Label Protected WithEvents Label65 As System.Web.UI.WebControls.Label Protected WithEvents Label66 As System.Web.UI.WebControls.Label Protected WithEvents Label67 As System.Web.UI.WebControls.Label Protected WithEvents Label68 As System.Web.UI.WebControls.Label Protected WithEvents Label69 As System.Web.UI.WebControls.Label Protected WithEvents Label70 As System.Web.UI.WebControls.Label Protected WithEvents Label71 As System.Web.UI.WebControls.Label Protected WithEvents Label72 As System.Web.UI.WebControls.Label Protected WithEvents Label73 As System.Web.UI.WebControls.Label Protected WithEvents Label74 As System.Web.UI.WebControls.Label Protected WithEvents Label75 As System.Web.UI.WebControls.Label Protected WithEvents Label76 As System.Web.UI.WebControls.Label Protected WithEvents Label77 As System.Web.UI.WebControls.Label Protected WithEvents Label78 As System.Web.UI.WebControls.Label Protected WithEvents Label79 As System.Web.UI.WebControls.Label Protected WithEvents Label80 As System.Web.UI.WebControls.Label Protected WithEvents Label81 As System.Web.UI.WebControls.Label Protected WithEvents Label82 As System.Web.UI.WebControls.Label Protected WithEvents Label83 As System.Web.UI.WebControls.Label Protected WithEvents Label84 As System.Web.UI.WebControls.Label Protected WithEvents Label85 As System.Web.UI.WebControls.Label Protected WithEvents Label26 As System.Web.UI.WebControls.Label Protected WithEvents btn_Scan As System.Web.UI.WebControls.Button Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox Protected WithEvents btn_Cancel As System.Web.UI.WebControls.Button Protected WithEvents btn_Submit As System.Web.UI.WebControls.Button Protected WithEvents Run As System.Web.UI.WebControls.Button Protected WithEvents btn_plsWait As System.Web.UI.WebControls.Button Protected WithEvents btn_Test As System.Web.UI.WebControls.Button Protected WithEvents chk2_5 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_6 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_7 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_8 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_9 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_10 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_11 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_1 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_2 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_3 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_4 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_5 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_7 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_8 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk3_9 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_1 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_2 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_3 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_4 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_5 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_6 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_7 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk4_8 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_1 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_2 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_3 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_4 As System.Web.UI.WebControls.CheckBox Protected WithEvents lbl_servername As System.Web.UI.WebControls.Label Protected WithEvents chk5_5 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_6 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_7 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_8 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_9 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk5_10 As System.Web.UI.WebControls.CheckBox Protected WithEvents lbl_error As System.Web.UI.WebControls.Label Protected WithEvents btn_Save As System.Web.UI.WebControls.Button Protected WithEvents chk1_1 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk1_2 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk1_3 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk1_4 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk1_5 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk1_6 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk1_7 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk1_8 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_1 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_2 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_3 As System.Web.UI.WebControls.CheckBox Protected WithEvents chk2_4 As System.Web.UI.WebControls.CheckBox Protected WithEvents lst_servers As System.Web.UI.WebControls.DropDownList Protected WithEvents btn_view As System.Web.UI.WebControls.Button Protected WithEvents lbl_ipaddress As System.Web.UI.WebControls.Label Protected WithEvents lbl_subnetmask As System.Web.UI.WebControls.Label Protected WithEvents lbl_defaultgateway As System.Web.UI.WebControls.Label Protected WithEvents lbl_dns1 As System.Web.UI.WebControls.Label Protected WithEvents lbl_dns2 As System.Web.UI.WebControls.Label Protected WithEvents lbl_dns3 As System.Web.UI.WebControls.Label Protected WithEvents lbl_wins1 As System.Web.UI.WebControls.Label Protected WithEvents lbl_wins2 As System.Web.UI.WebControls.Label 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here conn.ConnectionString = "Data Source=;Initial Catalog;User Id=; Password=" cnnCommand.Connection = New System.Data.OleDb.OleDbConnection(strDBConnection) conn.Open() If Not IsPostBack Then DisableCheckBoxes() ResetCheckBoxText() ' New Code Follows ________________________________________________________________ cnnCommand.CommandText = "SELECT tbl_svrbuild_svrinfo.id, tbl_svrbuild_svrinfo.servername FROM tbl_svrbuild_svrinfo " _ & " LEFT OUTER JOIN tbl_svrbuild_chkbuild ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_chkbuild.svrid " _ & " LEFT OUTER JOIN tbl_svrbuild_chkpost ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_chkpost.svrid " _ & " LEFT OUTER JOIN tbl_svrbuild_chkfinal ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_chkfinal.svrid " _ & "WHERE ltrim(rtrim(servername)) <> '' AND tbl_svrbuild_chkfinal.status <> 1 AND tbl_svrbuild_chkpost.status = 1 AND tbl_svrbuild_chkbuild.status = 1 ORDER BY servername" cnnCommand.Connection.Open() cnnDataReader = cnnCommand.ExecuteReader() Do While cnnDataReader.Read lstItem = New ListItem 'lstItem.Value = cnnDataReader.Item("id") lstItem.Value = cnnDataReader.Item("servername") lstItem.Text = cnnDataReader.Item("servername") If cnnDataReader.Item("id") = Request.Form.Item("id") Then lstItem.Selected = True End If lst_servers.Items.Add(lstItem) Loop cnnCommand.Connection.Close() cnnDataReader.Close() cnnCommand.CommandText = "SELECT tbl_svrbuild_svrinfo.id, tbl_svrbuild_svrinfo.servername FROM tbl_svrbuild_svrinfo " _ & " LEFT OUTER JOIN tbl_svrbuild_novell_chkbuild ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_novell_chkbuild.svrid " _ & " LEFT OUTER JOIN tbl_svrbuild_chkpost ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_chkpost.svrid " _ & " LEFT OUTER JOIN tbl_svrbuild_chkfinal ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_chkfinal.svrid " _ & "WHERE ltrim(rtrim(servername)) <> '' AND tbl_svrbuild_chkfinal.status <> 1 AND tbl_svrbuild_chkpost.status = 1 AND tbl_svrbuild_novell_chkbuild.status = 1 ORDER BY servername" cnnCommand.Connection.Open() cnnDataReader = cnnCommand.ExecuteReader() Do While cnnDataReader.Read lstItem = New ListItem 'lstItem.Value = cnnDataReader.Item("id") lstItem.Value = cnnDataReader.Item("servername") lstItem.Text = cnnDataReader.Item("servername") If cnnDataReader.Item("id") = Request.Form.Item("id") Then lstItem.Selected = True End If lst_servers.Items.Add(lstItem) Loop cnnCommand.Connection.Close() cnnDataReader.Close() lst_servers.Items.Insert(0, "Please select...") ' New Code Ends ________________________________________________________________ 'qry = "SELECT tbl_svrbuild_svrinfo.id, tbl_svrbuild_svrinfo.servername FROM tbl_svrbuild_svrinfo " _ '& " LEFT OUTER JOIN tbl_svrbuild_chkfinal ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_chkfinal.svrid " _ '& " LEFT OUTER JOIN tbl_svrbuild_chkbuild ON tbl_svrbuild_svrinfo.id = tbl_svrbuild_chkbuild.svrid " _ '& " WHERE ltrim(rtrim(servername)) <> '' AND tbl_svrbuild_svrinfo.os LIKE '%Windows%' AND tbl_svrbuild_chkfinal.status <> 1 AND tbl_svrbuild_chkbuild.status <> 1 ORDER BY servername" 'da.SelectCommand = New SqlClient.SqlCommand(qry) 'da.SelectCommand.Connection = conn 'ds.Clear() 'da.Fill(ds) 'lst_servers.DataSource = ds 'lst_servers.DataTextField = "servername" 'lst_servers.DataValueField = "id" 'lst_servers.DataBind() 'lst_servers.Items.Insert(0, "") Else strUserServerName = Request.Form("INserver") ' change these lines to switch between 'strUserServerName = Request.Form("lst_servers") ' server select boxes (and "" this code below) strUserDomainName = Request.Form("INdomain") strUser = Request.Form("INuser") ' New Impersonation Login strUserPass = Request.Form("INpass") End If ds.Clear() ds.Dispose() da.Dispose() conn.Close() conn.Dispose() 'Update form with current baseline values: End Sub Public Sub btn_view_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_view.Click Session.Add("ssnSelectedServer", "") Session.Add("ssnSelectedDomain", "") Session.Add("ssnSpecifiedUser", "") Session.Add("ssnSpecifiedPass", "") ResetCheckBoxText() EnableCheckBoxes() ClearCheckBoxes() conn.ConnectionString = "Data Source=;Initial Catalog=;User Id=; Password=" conn.Open() ' change below to select from different server select box: "" WHICH ONE qry = "SELECT * FROM tbl_svrbuild_svrinfo WHERE servername = " & func.CheckString(Trim(Request.Form.Item("INserver")), "") 'qrytest = "SELECT * FROM tbl_svrbuild_svrinfo WHERE servername = " & func.CheckString(Trim(Request.Form.Item("lst_servers")), "") 'qry = "SELECT * FROM tbl_svrbuild_svrinfo WHERE servername = " & func.CheckString(Trim(Request.Form.Item("lst_servers")), "") 'qry = "SELECT * FROM tbl_svrbuild_svrinfo WHERE id = " & (Trim(Request.Form.Item("lst_servers"))) 'invalid column Response.Write(qry) da.SelectCommand = New SqlClient.SqlCommand(qry) da.SelectCommand.Connection = conn ds.Clear() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then lbl_servername.Text = ds.Tables(0).Rows(0).Item("servername") lbl_ipaddress.Text = ds.Tables(0).Rows(0).Item("ipaddress") lbl_subnetmask.Text = ds.Tables(0).Rows(0).Item("subnetmask") lbl_defaultgateway.Text = ds.Tables(0).Rows(0).Item("defaultgateway") lbl_dns1.Text = ds.Tables(0).Rows(0).Item("dns1") lbl_dns2.Text = ds.Tables(0).Rows(0).Item("dns2") lbl_dns3.Text = ds.Tables(0).Rows(0).Item("dns3") lbl_wins1.Text = ds.Tables(0).Rows(0).Item("wins1") lbl_wins2.Text = ds.Tables(0).Rows(0).Item("wins2") strServerName = ds.Tables(0).Rows(0).Item("servername") strDomainName = ds.Tables(0).Rows(0).Item("domainname") strIPAddress = ds.Tables(0).Rows(0).Item("ipaddress") strOS = ds.Tables(0).Rows(0).Item("os") strRIBpresent = ds.Tables(0).Rows(0).Item("ribpresent") strRIBipAddress = ds.Tables(0).Rows(0).Item("ribipaddress") strDNSsuffix = ds.Tables(0).Rows(0).Item("dnssuffix") strADOU = ds.Tables(0).Rows(0).Item("adou") strGateway = ds.Tables(0).Rows(0).Item("defaultgateway") strSubnetMask = ds.Tables(0).Rows(0).Item("subnetmask") strWINS1 = ds.Tables(0).Rows(0).Item("wins1") strWINS2 = ds.Tables(0).Rows(0).Item("wins2") strDNS1 = ds.Tables(0).Rows(0).Item("dns1") strDNS2 = ds.Tables(0).Rows(0).Item("dns2") strDNS3 = ds.Tables(0).Rows(0).Item("dns3") strBuildType = ds.Tables(0).Rows(0).Item("buildtype") strServerConfig = ds.Tables(0).Rows(0).Item("serverconfig") strArrayConfig = ds.Tables(0).Rows(0).Item("arrayconfig") strPartitionInfo = ds.Tables(0).Rows(0).Item("partitioninfo") If UCase(strPartitionInfo) = "SEE ABOVE" Then strPartitionInfo = "" End If 'SetCheckedData(Request.Form.Item("lst_servers")) Session.Add("ssnSelectedServer", strUserServerName) Session.Add("ssnSelectedDomain", strUserDomainName) Session.Add("ssnSpecifiedUser", strUser) Session.Add("ssnSpecifiedPass", strUserPass) 'Response.Write(strUserServerName & "
") 'Response.Write(strUserDomainName & "
") 'Response.Write(strUser & "
") 'Response.Write(strUserPass & "
") End If ds.Clear() ds.Dispose() da.Dispose() conn.Close() conn.Dispose() If lbl_servername.Text <> "" Then RunWMIScans() ' STARTS THE SCAN PROCESS Else lbl_error.Text = "Server Not Found in Build Database" Session.Add("ssnSelectedServer", strUserServerName) Session.Add("ssnSelectedDomain", strUserDomainName) Session.Add("ssnSpecifiedUser", strUser) Session.Add("ssnSpecifiedPass", strUserPass) 'Response.Write(strUserServerName & "
") 'Response.Write(strUserDomainName & "
") 'Response.Write(strUser & "
") 'Response.Write(strUserPass & "
") 'RunWMIScans() End If End Sub Public Sub btn_Scan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Scan.Click lbl_error.Text = "Scanning... " ResetCheckBoxText() EnableCheckBoxes() ClearCheckBoxes() 'RunWMIScans() 'lbl_error.Text = "Scan Complete for test server: " & strServerName End Sub Public Sub RunWMIScans() ' Type of Install If InStr(UCase(strBuildType), "MANUAL") Then 'Response.Write("Found Manual
") strImageType = "auto" ' change to "manual" if different records available End If If InStr(UCase(strBuildType), "IMAGE") Or UCase(strBuildType) = "AUTOMATED" Then 'Response.Write("Found Image
") strImageType = "auto" ' standard End If ' Type of Operating System If InStr(UCase(strOS), "2003") Then strImageType = "2003sp0" & strImageType ' standard 'Response.Write("Image/OS: " & strImageType) End If If InStr(UCase(strOS), "2000") Then strImageType = "2003sp0" & strImageType ' change to "2000sp4" if different records available 'Response.Write("Image/OS: " & strImageType) End If If InStr(UCase(strOS), "NETWARE") Then strImageType = "2003sp0" & strImageType ' change to "novell65" if different records available 'Response.Write("Image/OS: " & strImageType) End If ' If not detectable If strImageType = "" Then strImageType = "Unknown" ElseIf strImageType = "auto" Or strImageType = "manual" Then strImageType = "2003sp0auto" End If If intLoadLatestSettings = 1 Then ' Settings are in SQL database. If = 1, load latest data. strSIMPath = clsSQLQuery.fncSQLQuery("strSIMPath", strImageType) strChkRiloEnabled = clsSQLQuery.fncSQLQuery("strChkRiloEnabled", strImageType) strChkRiloXfrAutoSelectOff = clsSQLQuery.fncSQLQuery("strChkRiloXfrAutoSelectOff", strImageType) strChkRiloSpeed100Mbs = clsSQLQuery.fncSQLQuery("strChkRiloSpeed100Mbs", strImageType) strChkRiloFullDuplex = clsSQLQuery.fncSQLQuery("strChkRiloFullDuplex", strImageType) strChkRiloDisenableDHCP = clsSQLQuery.fncSQLQuery("strChkRiloDisenableDHCP", strImageType) strChkRiloNoRegisterwithWINS = clsSQLQuery.fncSQLQuery("strChkRiloNoRegisterwithWINS", strImageType) strChkRiloNoRegisterwithDNS = clsSQLQuery.fncSQLQuery("strChkRiloNoRegisterwithDNS", strImageType) strChkRiloRenameAdministrator = clsSQLQuery.fncSQLQuery("strChkRiloRenameAdministrator", strImageType) strChkRiloDomainName = clsSQLQuery.fncSQLQuery("strChkRiloDomainName", strImageType) strChkRiloPrimaryDNS = clsSQLQuery.fncSQLQuery("strChkRiloPrimaryDNS", strImageType) strChkRiloSecondaryDNS = clsSQLQuery.fncSQLQuery("strChkRiloSecondaryDNS", strImageType) strChkRiloConnection = clsSQLQuery.fncSQLQuery("strChkRiloConnection", strImageType) strChkPasswordHistory = clsSQLQuery.fncSQLQuery("strChkPasswordHistory", strImageType) strChkMaxPasswordAge = clsSQLQuery.fncSQLQuery("strChkMaxPasswordAge", strImageType) strChkMinPasswordAge = clsSQLQuery.fncSQLQuery("strChkMinPasswordAge", strImageType) strChkMinPasswordLength = clsSQLQuery.fncSQLQuery("strChkMinPasswordLength", strImageType) strChkAccountLockoutDuration = clsSQLQuery.fncSQLQuery("strChkAccountLockoutDuration", strImageType) strChkAccountInvalidLogin = clsSQLQuery.fncSQLQuery("strChkAccountInvalidLogin", strImageType) strChkAccountLockoutCounter = clsSQLQuery.fncSQLQuery("strChkAccountLockoutCounter", strImageType) strAuditAccountLogon = clsSQLQuery.fncSQLQuery("strAuditAccountLogon", strImageType) strAuditAccountManagement = clsSQLQuery.fncSQLQuery("strAuditAccountManagement", strImageType) strAuditAccountDSA = clsSQLQuery.fncSQLQuery("strAuditAccountDSA", strImageType) strAuditAccountLogonEvent = clsSQLQuery.fncSQLQuery("strAuditAccountLogonEvent", strImageType) strAuditAccountObjectAccess = clsSQLQuery.fncSQLQuery("strAuditAccountObjectAccess", strImageType) strAuditAccountPolicyChange = clsSQLQuery.fncSQLQuery("strAuditAccountPolicyChange", strImageType) strAuditAccountPrivilegeUse = clsSQLQuery.fncSQLQuery("strAuditAccountPrivilegeUse", strImageType) strAuditAccountProcessTracking = clsSQLQuery.fncSQLQuery("strAuditAccountProcessTracking", strImageType) strAuditAccountSystemEvents = clsSQLQuery.fncSQLQuery("strAuditAccountSystemEvents", strImageType) strSecondaryVideoAdapter = clsSQLQuery.fncSQLQuery("strSecondaryVideoAdapter", strImageType) strSecondaryVideoValue = clsSQLQuery.fncSQLQuery("strSecondaryVideoValue", strImageType) strSecondaryVideoValueCompare = clsSQLQuery.fncSQLQuery("strSecondaryVideoValueCompare", strImageType) strVerifyFNM = clsSQLQuery.fncSQLQuery("strVerifyFNM", strImageType) strVerifyFRC = clsSQLQuery.fncSQLQuery("strVerifyFRC", strImageType) strVerifyFAP = clsSQLQuery.fncSQLQuery("strVerifyFAP", strImageType) strVerifyFSS = clsSQLQuery.fncSQLQuery("strVerifyFSS", strImageType) strVerifyFSK = clsSQLQuery.fncSQLQuery("strVerifyFSK", strImageType) strDefaultDomainName = clsSQLQuery.fncSQLQuery("strDefaultDomainName", strImageType) strCachedLogonsCount = clsSQLQuery.fncSQLQuery("strCachedLogonsCount", strImageType) strDontDisplayLastUserName = clsSQLQuery.fncSQLQuery("strDontDisplayLastUserName", strImageType) strAllocateCDROMs = clsSQLQuery.fncSQLQuery("strAllocateCDROMs", strImageType) strAllocateFloppies = clsSQLQuery.fncSQLQuery("strAllocateFloppies", strImageType) strShutdownWithoutLogon = clsSQLQuery.fncSQLQuery("strShutdownWithoutLogon", strImageType) strSecTemplateKey = clsSQLQuery.fncSQLQuery("strSecTemplateKey", strImageType) strTemplateUsed = clsSQLQuery.fncSQLQuery("strTemplateUsed", strImageType) strStdSecurityTemplate1 = clsSQLQuery.fncSQLQuery("strStdSecurityTemplate1", strImageType) strStdSecurityTemplate2 = clsSQLQuery.fncSQLQuery("strStdSecurityTemplate2", strImageType) strDCNameKey = clsSQLQuery.fncSQLQuery("strDCNameKey", strImageType) strNetworkName = clsSQLQuery.fncSQLQuery("strNetworkName", strImageType) strDCValue = clsSQLQuery.fncSQLQuery("strDCValue", strImageType) strTivoliKey = clsSQLQuery.fncSQLQuery("strTivoliKey", strImageType) strTivoliPath = clsSQLQuery.fncSQLQuery("strTivoliPath", strImageType) strTivoliSetting = clsSQLQuery.fncSQLQuery("strTivoliSetting", strImageType) strSymantecKey = clsSQLQuery.fncSQLQuery("strSymantecKey", strImageType) strSymProductVersion = clsSQLQuery.fncSQLQuery("strSymProductVersion", strImageType) strStdSymantecProductVersion = clsSQLQuery.fncSQLQuery("strStdSymantecProductVersion", strImageType) strIntelTeamImageKey = clsSQLQuery.fncSQLQuery("strIntelTeamImageKey", strImageType) strIntelServerImageVersion = clsSQLQuery.fncSQLQuery("strIntelServerImageVersion", strImageType) strIntelImageSetting = clsSQLQuery.fncSQLQuery("strIntelImageSetting", strImageType) strLSAChecks = clsSQLQuery.fncSQLQuery("strLSAChecks", strImageType) strLSASAM = clsSQLQuery.fncSQLQuery("strLSASAM", strImageType) intLSASAM = clsSQLQuery.fncSQLQuery("intLSASAM", strImageType) strDNSNames2Check1 = clsSQLQuery.fncSQLQuery("strDNSNames2Check1", strImageType) strDNSNames2Check2 = clsSQLQuery.fncSQLQuery("strDNSNames2Check2", strImageType) strDNSNames2Check3 = clsSQLQuery.fncSQLQuery("strDNSNames2Check3", strImageType) strDomainKey = clsSQLQuery.fncSQLQuery("strDomainKey", strImageType) strIPPathname = clsSQLQuery.fncSQLQuery("strIPPathname", strImageType) strIPKey = clsSQLQuery.fncSQLQuery("strIPKey", strImageType) strGatewayKey = clsSQLQuery.fncSQLQuery("strGatewayKey", strImageType) strSubnetMaskKey = clsSQLQuery.fncSQLQuery("strSubnetMaskKey", strImageType) strDNSKey = clsSQLQuery.fncSQLQuery("strDNSKey", strImageType) strWINSKeyPath = clsSQLQuery.fncSQLQuery("strWINSKeyPath", strImageType) strWINS12Check = clsSQLQuery.fncSQLQuery("strWINS12Check", strImageType) strWINS22Check = clsSQLQuery.fncSQLQuery("strWINS22Check", strImageType) strSNMPBusinessUnitContactPathname = clsSQLQuery.fncSQLQuery("strSNMPBusinessUnitContactPathname", strImageType) strSNMPBusinessUnitContactKey = clsSQLQuery.fncSQLQuery("strSNMPBusinessUnitContactKey", strImageType) strSNMPServerLocationPathname = clsSQLQuery.fncSQLQuery("strSNMPServerLocationPathname", strImageType) strSNMPServerLocationKey = clsSQLQuery.fncSQLQuery("strSNMPServerLocationKey", strImageType) strSNMPMaverickPathname = clsSQLQuery.fncSQLQuery("strSNMPMaverickPathname", strImageType) strSNMPAuthenticationTrapPathname = clsSQLQuery.fncSQLQuery("strSNMPAuthenticationTrapPathname", strImageType) strSNMPAuthenticationTrapKey = clsSQLQuery.fncSQLQuery("strSNMPAuthenticationTrapKey", strImageType) strSNMPrenametoIntelServerPathname = clsSQLQuery.fncSQLQuery("strSNMPrenametoIntelServerPathname", strImageType) strSNMPrenametoIntelServerKey = clsSQLQuery.fncSQLQuery("strSNMPrenametoIntelServerKey", strImageType) strSNMPAcceptableHOSTSPathname = clsSQLQuery.fncSQLQuery("strSNMPAcceptableHOSTSPathname", strImageType) strSNMPAcceptableHOSTSKey = clsSQLQuery.fncSQLQuery("strSNMPAcceptableHOSTSKey", strImageType) strLegalsKey = clsSQLQuery.fncSQLQuery("strLegalsKey", strImageType) strLegalNoticeCaption = clsSQLQuery.fncSQLQuery("strLegalNoticeCaption", strImageType) strLegalNoticeText = clsSQLQuery.fncSQLQuery("strLegalNoticeText", strImageType) strLegalNoticeCaptionText = clsSQLQuery.fncSQLQuery("strLegalNoticeCaptionText", strImageType) strLegalNoticeTextContent = clsSQLQuery.fncSQLQuery("strLegalNoticeTextContent", strImageType) strStdDateFormat = clsSQLQuery.fncSQLQuery("strStdDateFormat", strImageType) strStdDomainName = clsSQLQuery.fncSQLQuery("strStdDomainName", strImageType) strAppEventLogPath = clsSQLQuery.fncSQLQuery("strAppEventLogPath", strImageType) strAppEventLogMaxSizeKey = clsSQLQuery.fncSQLQuery("strAppEventLogMaxSizeKey", strImageType) strAppEventLogOverwriteKey = clsSQLQuery.fncSQLQuery("strAppEventLogOverwriteKey", strImageType) strAppEventLogMaxSizeValue = clsSQLQuery.fncSQLQuery("strAppEventLogMaxSizeValue", strImageType) strAppEventLogOverwriteKeyValue = clsSQLQuery.fncSQLQuery("strAppEventLogOverwriteKeyValue", strImageType) strSecEventLogPath = clsSQLQuery.fncSQLQuery("strSecEventLogPath", strImageType) strSecEventLogMaxSizeKey = clsSQLQuery.fncSQLQuery("strSecEventLogMaxSizeKey", strImageType) strSecEventLogOverwriteKey = clsSQLQuery.fncSQLQuery("strSecEventLogOverwriteKey", strImageType) strSecEventLogMaxSizeValue = clsSQLQuery.fncSQLQuery("strSecEventLogMaxSizeValue", strImageType) strSecEventLogOverwriteKeyValue = clsSQLQuery.fncSQLQuery("strSecEventLogOverwriteKeyValue", strImageType) strSysEventLogPath = clsSQLQuery.fncSQLQuery("strSysEventLogPath", strImageType) strSysEventLogMaxSizeKey = clsSQLQuery.fncSQLQuery("strSysEventLogMaxSizeKey", strImageType) strSysEventLogOverwriteKey = clsSQLQuery.fncSQLQuery("strSysEventLogOverwriteKey", strImageType) strSysEventLogMaxSizeValue = clsSQLQuery.fncSQLQuery("strSysEventLogMaxSizeValue", strImageType) strSysEventLogOverwriteKeyValue = clsSQLQuery.fncSQLQuery("strSysEventLogOverwriteKeyValue", strImageType) strSuffixAppFileName = clsSQLQuery.fncSQLQuery("strSuffixAppFileName", strImageType) strSuffixSecFileName = clsSQLQuery.fncSQLQuery("strSuffixSecFileName", strImageType) strSuffixSysFileName = clsSQLQuery.fncSQLQuery("strSuffixSysFileName", strImageType) strSNMPTrap1 = clsSQLQuery.fncSQLQuery("strSNMPTrap1", strImageType) strSNMPTrap2 = clsSQLQuery.fncSQLQuery("strSNMPTrap2", strImageType) strSNMPTrap3 = clsSQLQuery.fncSQLQuery("strSNMPTrap3", strImageType) strSNMPHostVerify1A = clsSQLQuery.fncSQLQuery("strSNMPHostVerify1A", strImageType) strSNMPHostVerify1B = clsSQLQuery.fncSQLQuery("strSNMPHostVerify1B", strImageType) strSNMPHostVerify2A = clsSQLQuery.fncSQLQuery("strSNMPHostVerify2A", strImageType) strSNMPHostVerify2B = clsSQLQuery.fncSQLQuery("strSNMPHostVerify2B", strImageType) strSNMPHostVerify3A = clsSQLQuery.fncSQLQuery("strSNMPHostVerify3A", strImageType) strSNMPHostVerify3B = clsSQLQuery.fncSQLQuery("strSNMPHostVerify3B", strImageType) strLMHostLookupPath = clsSQLQuery.fncSQLQuery("strLMHostLookupPath", strImageType) strNBTEnabledPath = clsSQLQuery.fncSQLQuery("strNBTEnabledPath", strImageType) strSecedAdminName = clsSQLQuery.fncSQLQuery("strSecedAdminName", strImageType) strSecedGuestName = clsSQLQuery.fncSQLQuery("strSecedGuestName", strImageType) strSecedEnableGuest = clsSQLQuery.fncSQLQuery("strSecedEnableGuest", strImageType) strSecedRemoteSD = clsSQLQuery.fncSQLQuery("strSecedRemoteSD", strImageType) strSecedAdminSD = clsSQLQuery.fncSQLQuery("strSecedAdminSD", strImageType) strDontDisplayPath = clsSQLQuery.fncSQLQuery("strDontDisplayPath", strImageType) strBootTimeOutCheck = clsSQLQuery.fncSQLQuery("strBootTimeOutCheck", strImageType) strAutoRestartPath = clsSQLQuery.fncSQLQuery("strAutoRestartPath", strImageType) strKernelMemDump = clsSQLQuery.fncSQLQuery("strKernelMemDump", strImageType) strBaselineDuplexSetting = clsSQLQuery.fncSQLQuery("strBaselineDuplexSetting", strImageType) strNewKeyforLogon = clsSQLQuery.fncSQLQuery("strNewKeyforLogon", strImageType) strSNMPTrap1B = clsSQLQuery.fncSQLQuery("strSNMPTrap1B", strImageType) strSNMPTrap2B = clsSQLQuery.fncSQLQuery("strSNMPTrap2B", strImageType) NetIDPathPrefix = clsSQLQuery.fncSQLQuery("NetIDPathPrefix", strImageType) NetIDClassKey = clsSQLQuery.fncSQLQuery("NetIDClassKey", strImageType) strNetIDDuplexLocator = clsSQLQuery.fncSQLQuery("strNetIDDuplexLocator", strImageType) strCardLocator = clsSQLQuery.fncSQLQuery("strCardLocator", strImageType) strNewEnumKeyPath = clsSQLQuery.fncSQLQuery("strNewEnumKeyPath", strImageType) strNetworkCardType1 = clsSQLQuery.fncSQLQuery("strNetworkCardType1", strImageType) strNetworkcardType2 = clsSQLQuery.fncSQLQuery("strNetworkcardType2", strImageType) strSecBaseFileSize = clsSQLQuery.fncSQLQuery("strSecBaseFileSize", strImageType) strSysBaseFileSize = clsSQLQuery.fncSQLQuery("strSysBaseFileSize", strImageType) strAppBaseFileSize = clsSQLQuery.fncSQLQuery("strAppBaseFileSize", strImageType) strSNMPReadCreateCommBase = clsSQLQuery.fncSQLQuery("strSNMPReadCreateCommBase", strImageType) strSNMPProfileImagePath = clsSQLQuery.fncSQLQuery("strSNMPProfileImagePath", strImageType) strCrashDumpEnabledKey = clsSQLQuery.fncSQLQuery("strCrashDumpEnabledKey", strImageType) strAutoRebootKey = clsSQLQuery.fncSQLQuery("strAutoRebootKey", strImageType) strNBTStartKey = clsSQLQuery.fncSQLQuery("strNBTStartKey", strImageType) strEnableLMHostsKey = clsSQLQuery.fncSQLQuery("strEnableLMHostsKey", strImageType) strComputerNameKey = clsSQLQuery.fncSQLQuery("strComputerNameKey", strImageType) strComputerNamePath = clsSQLQuery.fncSQLQuery("strComputerNamePath", strImageType) strSNMPEnableAuthTraps = clsSQLQuery.fncSQLQuery("strSNMPEnableAuthTraps", strImageType) strSNMPRenMavKey = clsSQLQuery.fncSQLQuery("strSNMPRenMavKey", strImageType) strSNMPTrapParmsPath = clsSQLQuery.fncSQLQuery("strSNMPTrapParmsPath", strImageType) strFPShareTypePath = clsSQLQuery.fncSQLQuery("strFPShareTypePath", strImageType) strFPShareTypeKey = clsSQLQuery.fncSQLQuery("strFPShareTypeKey", strImageType) strFPShareKey = clsSQLQuery.fncSQLQuery("strFPShareKey", strImageType) strFPShareTypeBaseValue = clsSQLQuery.fncSQLQuery("strFPShareTypeBaseValue", strImageType) strFPShareBaseValue = clsSQLQuery.fncSQLQuery("strFPShareBaseValue", strImageType) strDNSRegKeyName = clsSQLQuery.fncSQLQuery("strDNSRegKeyName", strImageType) strDNSRegEnabledKey = clsSQLQuery.fncSQLQuery("strDNSRegEnabledKey", strImageType) strDNSNetCfgInstanceIDKey = clsSQLQuery.fncSQLQuery("strDNSNetCfgInstanceIDKey", strImageType) strNICDuplexSpeedRate1 = clsSQLQuery.fncSQLQuery("strNICDuplexSpeedRate1", strImageType) strNICDuplexSpeedRate2 = clsSQLQuery.fncSQLQuery("strNICDuplexSpeedRate2", strImageType) strNetworkNameServer = clsSQLQuery.fncSQLQuery("strNetworkNameServer", strImageType) strNetworkNameServerList = clsSQLQuery.fncSQLQuery("strNetworkNameServerList", strImageType) strNetworkPrefixNetBT = clsSQLQuery.fncSQLQuery("strNetworkPrefixNetBT", strImageType) strNetworkSubnetMaskKey = clsSQLQuery.fncSQLQuery("strNetworkSubnetMaskKey", strImageType) strNetworkGatewayKey = clsSQLQuery.fncSQLQuery("strNetworkGatewayKey", strImageType) strNetworkIPKeyName = clsSQLQuery.fncSQLQuery("strNetworkIPKeyName", strImageType) strNetworkShowIconKey = clsSQLQuery.fncSQLQuery("strNetworkShowIconKey", strImageType) strNewNetworkPathPrefix = clsSQLQuery.fncSQLQuery("strNewNetworkPathPrefix", strImageType) strNewNetworkPathSuffix = clsSQLQuery.fncSQLQuery("strNewNetworkPathSuffix", strImageType) strNewNetIDPath = clsSQLQuery.fncSQLQuery("strNewNetIDPath", strImageType) strNewNetIDKey = clsSQLQuery.fncSQLQuery("strNewNetIDKey", strImageType) strNewShortDatePath = clsSQLQuery.fncSQLQuery("strNewShortDatePath", strImageType) strNewShortDateKey = clsSQLQuery.fncSQLQuery("strNewShortDateKey", strImageType) strDefaultFSKFilename = clsSQLQuery.fncSQLQuery("strDefaultFSKFilename", strImageType) strDefaultFSSFilename = clsSQLQuery.fncSQLQuery("strDefaultFSSFilename", strImageType) strDefaultFAPFilename = clsSQLQuery.fncSQLQuery("strDefaultFAPFilename", strImageType) strDefaultFRCFilename = clsSQLQuery.fncSQLQuery("strDefaultFRCFilename", strImageType) strDefaultFNMFilename1 = clsSQLQuery.fncSQLQuery("strDefaultFNMFilename1", strImageType) strDefaultFNMFilename2 = clsSQLQuery.fncSQLQuery("strDefaultFNMFilename2", strImageType) strWMIDDquery = clsSQLQuery.fncSQLQuery("strWMIDDquery", strImageType) strWMILogicalquery = clsSQLQuery.fncSQLQuery("strWMILogicalquery", strImageType) strWMIDisplayquery = clsSQLQuery.fncSQLQuery("strWMIDisplayquery", strImageType) strWMIServicesquery = clsSQLQuery.fncSQLQuery("strWMIServicesquery", strImageType) strWMIHDDArrayquery = clsSQLQuery.fncSQLQuery("strWMIHDDArrayquery", strImageType) strWMIPagefilequery = clsSQLQuery.fncSQLQuery("strWMIPagefilequery", strImageType) strWMIOSquery = clsSQLQuery.fncSQLQuery("strWMIOSquery", strImageType) strTSMOpFileLocation = clsSQLQuery.fncSQLQuery("strTSMOpFileLocation", strImageType) strPriorityControlPath = clsSQLQuery.fncSQLQuery("strPriorityControlPath", strImageType) strPriorityControlKey = clsSQLQuery.fncSQLQuery("strPriorityControlKey", strImageType) strMemMgmtPath = clsSQLQuery.fncSQLQuery("strMemMgmtPath", strImageType) strMemMgmtKey = clsSQLQuery.fncSQLQuery("strMemMgmtKey", strImageType) strBackupExecPath = clsSQLQuery.fncSQLQuery("strBackupExecPath", strImageType) strWindowSizePath = clsSQLQuery.fncSQLQuery("strWindowSizePath", strImageType) strWindowSizeKey = clsSQLQuery.fncSQLQuery("strWindowSizeKey", strImageType) strTCPServerAddy = clsSQLQuery.fncSQLQuery("strTCPServerAddy", strImageType) End If Label86.Text = "" & strUserServerName & "" Label87.Text = strLegalNoticeTextContent Label88.Text = "" & strLegalNoticeCaptionText & "" ' ___________SET BASELINE SERVICES SETTINGS__________ strIISAdminBaselineState = "Running" strIISAdminBaselineStartMode = "Auto" strNNTPServiceBaselineState = "Off" strNNTPServiceBaselineStartMode = "Service Removed" strSMTPServiceBaselineState = "Off" strSMTPServiceBaselineStartMode = "Service Removed" strWWWServiceBaselineState = "Running" strWWWServiceBaselineStartMode = "Auto" strBITSBaselineState = "Stopped" strBITSBaselineStartMode = "Disabled" strAutoUpdatesBaselineState = "Stopped" strAutoUpdatesBaselineStartMode = "Disabled" strTivoliEndpointBaselineState = "Running" strTivoliEndpointBaselineStartMode = "Auto" strTelephonyBaselineState = "Running" strTelephonyBaselineStartMode = "Manual" strTSMBackupBaselineState = "Off" strTSMBackupBaselineStartMode = "Service Removed" strSNMPBaselineState = "Running" strSNMPBaselineStartMode = "Auto" strIISAdminBaselineState2 = "Off" strIISAdminBaselineStartMode2 = "Service Removed" strIISAdminBaselineState3 = "Stopped" strIISAdminBaselineStartMode3 = "Disabled" strWWWServiceBaselineState2 = "Off" strWWWServiceBaselineStartMode2 = "Service Removed" strWWWServiceBaselineState3 = "Stopped" strWWWServiceBaselineStartMode3 = "Disabled" strNNTPServiceBaselineState2 = "Running" strNNTPServiceBaselineStartMode2 = "Auto" strNNTPServiceBaselineState3 = "Running" strNNTPServiceBaselineStartMode3 = "Manual" strSMTPServiceBaselineState2 = "Running" strSMTPServiceBaselineStartMode2 = "Auto" strSMTPServiceBaselineState3 = "Running" strSMTPServiceBaselineStartMode3 = "Manual" strTelephonyBaselineState2 = "Running" strTelephonyBaselineStartMode2 = "Auto" strTelephonyBaselineState3 = "Off" strTelephonyBaselineStartMode3 = "Service Removed" '____________________________________________________ strUserServerName = Session.Item("ssnSelectedServer") strUserDomainName = Session.Item("ssnSelectedDomain") strUser = Session.Item("ssnSpecifiedUser") strUserPass = Session.Item("ssnSpecifiedPass") strFormatConnectionAuthority = "ntlmdomain:" & strDomainName Response.Write("1" & strUserServerName & "
") Response.Write("2" & strUserDomainName & "
") Response.Write("3" & strUser & "
") Response.Write("4" & strUserPass & "
") Response.Write("5" & strUserName & "
") If strUser = "" Or strUserPass = "" Then lbl_error.Text = lbl_error.Text & "
ER Username and Password Required" intScanServerMasterSwitch = 0 Else intScanServerMasterSwitch = 1 End If 'strSecurePW = clsGetPassword.fncGetPW(strUserName) ' Secure Access using supplied L/P 'strPW = strSecurePW 'intScanServerMasterSwitch = 0 If intScanServerMasterSwitch = 1 Then ' HARDWARE/SOFTWARE SCAN CODE___________________________________________________________________________________ 'New Impersonation Code: Dim clsImpersonate As New classImpersonation Try clsImpersonate.subBeginImpersonation(strUser, strUserPass, strDomainName) Catch e As Exception 'Response.Write("Check match: " & strUser & "
" & strUserPass & "
" & strDomainName) 'lbl_error.Text = lbl_error.Text & "
Check match: User: " & strUser & "
Pass: *****
Domain: " & strDomainName lbl_error.Text = lbl_error.Text & "
Login Incorrect. Please try again." End Try Dim Connection As New ConnectionOptions ' Change the next line to search for the Environment NameSpace to see if it is Equal to (else these settings not required) If strUserServerName <> Server.MachineName Or strUserServerName <> "DSMNTNW001" Then 'Connection.Username = "TitanBaseusa\Admin" << not used with ConnectionAuthority 'Connection.Username = "Admin" 'Connection.Password = strPW Connection.Username = strUser Connection.Password = strUserPass Connection.Impersonation = ImpersonationLevel.Impersonate Connection.EnablePrivileges = True Connection.Authority = strFormatConnectionAuthority End If ' RILO and BOOT CHECK SCAN CODE_________________________________________________________________________________________ ' Boot Check and Security Checks: Dim bootchkproc As New System.Diagnostics.Process bootchkproc.EnableRaisingEvents = True bootchkproc.StartInfo.WorkingDirectory = strWebsiteHomeFolder & "external\" ' d: drive of NTNW001, use final Folder when deployed "" Dim strBooEdAccessArguments As String = " " & strUserServerName & " " & strUserPass & " " & strUser & " " & strWebsiteHomeFolder bootchkproc.StartInfo.FileName = strWebsiteHomeFolder & "external\bootchek.bat" ' this file is located on the D: drive of NTNW001 bootchkproc.StartInfo.Arguments = strBooEdAccessArguments ' instead of D: drive root, use final Folder when deployed "" bootchkproc.StartInfo.CreateNoWindow = True bootchkproc.StartInfo.ErrorDialog = True bootchkproc.Start() bootchkproc.WaitForExit() ' Problem Area bootchkproc.Close() bootchkproc.Dispose() Dim attrFile2 As FileAttributes = FileAttributes.Normal Dim attrFile3 As FileAttributes = FileAttributes.System Try File.SetAttributes("\\" & strUserServerName & "\C$\boot.ini", attrFile2) File.Copy("\\" & strUserServerName & "\C$\boot.ini", strWebsiteHomeFolder & "netxml\boot" & strUserServerName & ".txt", True) File.SetAttributes("\\" & strUserServerName & "\C$\boot.ini", attrFile3) Catch End Try Try Dim strNetBooEdServerName As String = strWebsiteHomeFolder & "netxml\boot" & strUserServerName & ".txt" Dim booSR As System.IO.StreamReader = New System.IO.StreamReader(strNetBooEdServerName) Dim booline As String Dim boolinepos As Integer ' finds the file ' Read Settings... and flip setting to 1 if found Do booline = booSR.ReadLine() boolinepos = InStr(booline, strBootTimeOutCheck, CompareMethod.Text) If boolinepos > 0 Then intBootTimeOutCheck = 1 End If 'Response.Write("File Read Properly") Loop Until booline Is Nothing booSR.Close() Catch Exception As Exception 'Response.Write("The BootEdit file could not be read. Reason: ") 'Response.Write(Exception.Message) Label50.Text = Label50.Text & "The BootEdit file could not be read. Reason: " Label50.Text = Label50.Text & Exception.Message Finally 'Do this End Try strLoginXML = " " Dim fsXMLnet As New FileStream(strWebsiteHomeFolder & "External\" & strUserServerName & "netxml.xml", FileMode.Create, FileAccess.Write) Dim stXMLnet As New StreamWriter(fsXMLnet) stXMLnet.BaseStream.Seek(0, SeekOrigin.End) stXMLnet.WriteLine("") stXMLnet.WriteLine(strLoginXML) stXMLnet.WriteLine(" ") stXMLnet.WriteLine(" ") stXMLnet.WriteLine(" ") stXMLnet.WriteLine(" ") stXMLnet.WriteLine("") stXMLnet.Close() Dim fsXMLusr As New FileStream(strWebsiteHomeFolder & "External\" & strUserServerName & "usrxml.xml", FileMode.Create, FileAccess.Write) Dim stXMLusr As New StreamWriter(fsXMLusr) stXMLusr.BaseStream.Seek(0, SeekOrigin.End) stXMLusr.WriteLine("") stXMLusr.WriteLine(strLoginXML) stXMLusr.WriteLine(" ") stXMLusr.WriteLine(" ") stXMLusr.WriteLine(" ") stXMLusr.WriteLine(" ") stXMLusr.WriteLine("") stXMLusr.Close() Dim strNetServerName As String = strWebsiteHomeFolder & "ribxml\net" & strUserServerName & "-Rib.txt" Dim strUsrServerName As String = strWebsiteHomeFolder & "ribxml\usr" & strUserServerName & "-Rib.txt" 'Dim strNetArguments As String = " -s " & strUserServerName & "-Rib -l ..\ribxml\net" & strUserServerName & "-Rib.txt -f " & strUserServerName & "netxml.xml" 'Dim strUsrArguments As String = " -s " & strUserServerName & "-Rib -l ..\ribxml\usr" & strUserServerName & "-Rib.txt -f " & strUserServerName & "usrxml.xml" Dim strNetArguments As String = " -s " & strRIBipAddress & " -l ..\ribxml\net" & strUserServerName & "-Rib.txt -f " & strUserServerName & "netxml.xml" Dim strUsrArguments As String = " -s " & strRIBipAddress & " -l ..\ribxml\usr" & strUserServerName & "-Rib.txt -f " & strUserServerName & "usrxml.xml" 'Dim strNetArguments As String = " -s " & UCase(strUserServerName) & "-RIB -l ..\ribxml\net" & strUserServerName & "-Rib.txt -f get_net.xml" 'Dim strUsrArguments As String = " -s " & UCase(strUserServerName) & "-RIB -l ..\ribxml\usr" & strUserServerName & "-Rib.txt -f get_usr.xml" 'Get the latest RILO data... Dim proc As New System.Diagnostics.Process proc.EnableRaisingEvents = False proc.StartInfo.FileName = strWebsiteHomeFolder & "external\cpqlocfg.exe" proc.StartInfo.Arguments = strNetArguments proc.StartInfo.WorkingDirectory = strWebsiteHomeFolder & "external\" proc.StartInfo.CreateNoWindow = True proc.Start() proc.WaitForExit() proc.StartInfo.Arguments = strUsrArguments proc.Start() proc.WaitForExit() proc.Close() proc.Dispose() Try 'Dim SR As New System.IO.StreamReader("d:\Inetpub\wwwroot\web\test_apps\BensWork\Test2\ribxml\netDSM-FS-CFS02-Rib.txt", IO.FileMode.Open) Dim SR As System.IO.StreamReader = New System.IO.StreamReader(strNetServerName) Dim USR As System.IO.StreamReader = New System.IO.StreamReader(strUsrServerName) Dim line As String Dim linepos As Integer ' Read Settings... and flip setting to 1 if found in the RILO XML file. Do line = SR.ReadLine() linepos = InStr(line, strChkRiloEnabled, CompareMethod.Text) If linepos > 0 Then intChkRiloEnabled = 1 End If linepos = 0 linepos = InStr(line, strChkRiloXfrAutoSelectOff, CompareMethod.Text) If linepos > 0 Then intChkRiloXfrAutoSelectOff = 1 End If linepos = 0 linepos = InStr(line, strChkRiloSpeed100Mbs, CompareMethod.Text) If linepos > 0 Then intChkRiloSpeed100Mbs = 1 End If linepos = 0 linepos = InStr(line, strChkRiloFullDuplex, CompareMethod.Text) If linepos > 0 Then intChkRiloFullDuplex = 1 End If linepos = 0 linepos = InStr(line, strChkRiloDisenableDHCP, CompareMethod.Text) If linepos > 0 Then intChkRiloDisenableDHCP = 1 End If linepos = 0 linepos = InStr(line, strChkRiloNoRegisterwithWINS, CompareMethod.Text) If linepos > 0 Then intChkRiloNoRegisterwithWINS = 1 End If linepos = 0 linepos = InStr(line, strChkRiloNoRegisterwithDNS, CompareMethod.Text) If linepos > 0 Then intChkRiloNoRegisterwithDNS = 1 End If linepos = 0 linepos = InStr(line, strChkRiloDomainName, CompareMethod.Text) If linepos > 0 Then intChkRiloDomainName = 1 End If linepos = 0 linepos = InStr(line, strChkRiloPrimaryDNS, CompareMethod.Text) If linepos > 0 Then intChkRiloPrimaryDNS = 1 End If linepos = 0 linepos = InStr(line, strChkRiloSecondaryDNS, CompareMethod.Text) If linepos > 0 Then intChkRiloSecondaryDNS = 1 End If linepos = 0 linepos = InStr(line, strChkRiloConnection, CompareMethod.Text) If linepos > 0 Then intChkRiloConnection = 0 Else intChkRiloConnection = 1 intChkRiloEverConnect = intChkRiloEverConnect + 1 End If linepos = 0 'Response.Write("File Read Properly") Loop Until line Is Nothing SR.Close() If intChkRiloEverConnect < 5 Then intChkRiloConnection = 0 Else intChkRiloConnection = 1 End If Do line = USR.ReadLine() linepos = InStr(line, strChkRiloRenameAdministrator, CompareMethod.Text) If linepos = 0 Then ' this should not exist, Admin username must be removed intChkRiloRenameAdministrator = 1 End If If intChkRiloConnection = 0 Then intChkRiloRenameAdministrator = 0 End If linepos = 0 Loop Until line Is Nothing USR.Close() If intChkRiloRenameAdministrator = 1 And intChkRiloSecondaryDNS = 0 And intChkRiloPrimaryDNS = 0 And intChkRiloDomainName = 0 And intChkRiloNoRegisterwithDNS = 0 And intChkRiloDisenableDHCP = 0 And intChkRiloXfrAutoSelectOff = 0 And intChkRiloSpeed100Mbs = 0 And intChkRiloFullDuplex = 0 Then intChkRiloRenameAdministrator = 0 End If File.Delete(strWebsiteHomeFolder & "external\" & strUserServerName & "netxml.xml") File.Delete(strWebsiteHomeFolder & "external\" & strUserServerName & "usrxml.xml") Dim attrFile As FileAttributes = FileAttributes.Normal File.SetAttributes(strWebsiteHomeFolder & "netxml\boot" & strUserServerName & ".txt", attrFile) 'File.Delete(strWebsiteHomeFolder & "netxml\boot" & strUserServerName & ".txt") Catch Exception As Exception 'Response.Write("The RILO XML status file could not be read. Reason: ") 'Response.Write(Exception.Message) lbl_error.Text = lbl_error.Text & "The RILO XML status file could not be read. Reason: " lbl_error.Text = lbl_error.Text & Exception.Message File.Delete(strWebsiteHomeFolder & "external\" & strUserServerName & "netxml.xml") File.Delete(strWebsiteHomeFolder & "external\" & strUserServerName & "usrxml.xml") Finally 'Do this End Try ' RILO SCAN CODE END____________________________________________________________________________________________ Try Dim Scope As New ManagementScope("\\" & strUserServerName & "\root\CIMV2", Connection) Dim Query As New ObjectQuery(strWMIDDquery) Dim QueryLogicalDisk As New ObjectQuery(strWMILogicalquery) Dim QueryDisplayConfig As New ObjectQuery(strWMIDisplayquery) Dim QueryService As New ObjectQuery(strWMIServicesquery) Dim QueryHDDArray As New ObjectQuery(strWMIHDDArrayquery) Dim QueryPagefile As New ObjectQuery(strWMIPagefilequery) Dim QueryOS As New ObjectQuery(strWMIOSquery) objSearchDD = New ManagementObjectSearcher(Scope, Query) objSearchLD = New ManagementObjectSearcher(Scope, QueryLogicalDisk) objSearchDM = New ManagementObjectSearcher(Scope, QueryDisplayConfig) objSearchWS = New ManagementObjectSearcher(Scope, QueryService) objSearchHDD = New ManagementObjectSearcher(Scope, QueryHDDArray) objSearchPage = New ManagementObjectSearcher(Scope, QueryPagefile) objSearchOS = New ManagementObjectSearcher(Scope, QueryOS) Catch err3 As UnauthorizedAccessException lbl_error.Text = lbl_error.Text & "
Unauthorized Access to WMI: " & strUserServerName & ": " + err3.Message Catch err4 As ManagementException lbl_error.Text = lbl_error.Text & "
Management Exception WMI: " & strUserServerName & ": " + err4.Message Catch errSystemExc As SystemException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect WMI: System Exception: " & strUserServerName & ": " + errSystemExc.Message Catch errComExc As Exception lbl_error.Text = lbl_error.Text & "
General Exception WMI: " & strUserServerName & ": " + errComExc.Message Catch errAppExc As ApplicationException lbl_error.Text = lbl_error.Text & "
Application Exception WMI: " & strUserServerName & ": " + errAppExc.Message Catch errRPCExc As System.Runtime.InteropServices.COMException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect WMI: RPC Server Not Found: " & strUserServerName & ": " + errRPCExc.Message End Try Try intDrives = 0 For Each objMgmt In objSearchDD.Get If Not strDiskSize1 > 2 Then strDiskSize1 = objMgmt("size").ToString() ElseIf Not strDiskSize2 > 2 Then strDiskSize2 = objMgmt("size").ToString() ElseIf Not strDiskSize3 > 2 Then strDiskSize3 = objMgmt("size").ToString() ElseIf Not strDiskSize4 > 2 Then strDiskSize4 = objMgmt("size").ToString() ElseIf Not strDiskSize5 > 2 Then strDiskSize5 = objMgmt("size").ToString() ElseIf Not strDiskSize6 > 2 Then strDiskSize6 = objMgmt("size").ToString() End If intDrives += 1 'Response.Write(intDrives & " ") Next Catch err3 As UnauthorizedAccessException lbl_error.Text = lbl_error.Text & "
Unauthorized Access to HDD: " & strUserServerName & ": " + err3.Message Catch err4 As ManagementException lbl_error.Text = lbl_error.Text & "
Management Exception HDD: " & strUserServerName & ": " + err4.Message Catch errSystemExc As SystemException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect HDD: System Exception: " & strUserServerName & ": " + errSystemExc.Message Catch errComExc As Exception lbl_error.Text = lbl_error.Text & "
General Exception HDD: " & strUserServerName & ": " + errComExc.Message Catch errAppExc As ApplicationException lbl_error.Text = lbl_error.Text & "
Application Exception HDD: " & strUserServerName & ": " + errAppExc.Message Catch errRPCExc As System.Runtime.InteropServices.COMException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect (HDD): RPC Server Not Found: " & strUserServerName & ": " + errRPCExc.Message End Try Try For Each objMgmt In objSearchLD.Get strCDROMdriveLetter = objMgmt("DeviceID").ToString() Next For Each objMgmt In objSearchDM.Get strScreenHeight = objMgmt("PelsHeight").ToString() strScreenWidth = objMgmt("PelsWidth").ToString() Exit For Next For Each objMgmt In objSearchHDD.Get strHDDArrayState = objMgmt("State").ToString() strHDDArrayStartMode = objMgmt("StartMode").ToString() Exit For Next For Each objMgmt In objSearchPage.Get strPageFileSize = objMgmt("TotalPageFileSpace").ToString() strMemorySize = objMgmt("TotalPhysicalMemory").ToString() 'Response.Write("Page: " & strPageFileSize & "
") 'Response.Write("Page: " & strMemorySize & "
") Next For Each objMgmt In objSearchOS.Get strOSVersion = objMgmt("Caption").ToString() strOSPackVersion = objMgmt("ServicePackMajorVersion").ToString() Next ActualPageFileSize = Decimal.Round(((strPageFileSize / 1024) / 1024), 2) ActualMemorySize = Decimal.Round(((strMemorySize / 1024) / 1024), 2) If ActualPageFileSize / 1.5 >= ActualMemorySize Then intPageFileSizeChecked = 1 End If '___________________________________________________________________________________ ' Check that files exist as per installed applications: If File.Exists("\\" & strUserServerName & strDefaultFNMFilename1) Or File.Exists("\\" & strUserServerName & strDefaultFNMFilename2) Then strFileNameFNM = strVerifyFNM 'Response.Write("\\" & strUserServerName & strDefaultFNMFilename1 & "
") 'Response.Write(strFileNameFNM & "
") 'Response.Write(strVerifyFNM & "
") End If If File.Exists("\\" & strUserServerName & strDefaultFRCFilename) Then strFileNameFRC = strVerifyFRC End If If File.Exists("\\" & strUserServerName & strDefaultFAPFilename) Then strFileNameFAP = strVerifyFAP End If If File.Exists("\\" & strUserServerName & strDefaultFSSFilename) Then strFileNameFSS = strVerifyFSS End If If File.Exists("\\" & strUserServerName & strDefaultFSKFilename) Then strFileNameFSK = strVerifyFSK End If If File.Exists("\\" & strUserServerName & strTSMOpFileLocation) Then intFileNameTSMOpFile = 1 End If If File.Exists("\\" & strUserServerName & strBackupExecPath) Then intFileNameBackupExec = 1 End If If File.Exists("\\" & strUserServerName & strSIMPath) Then intFileNameSIM = 1 End If ' ------------------------------------------------------------------------- ' Check for registry keys for compliance: Catch err3 As UnauthorizedAccessException lbl_error.Text = lbl_error.Text & "
Unauthorized Access to WMI Search: " & strUserServerName & ": " + err3.Message Catch err4 As ManagementException lbl_error.Text = lbl_error.Text & "
Management Exception WMI Search: " & strUserServerName & ": " + err4.Message Catch errSystemExc As SystemException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect WMI Search: System Exception: " & strUserServerName & ": " + errSystemExc.Message Catch errComExc As Exception lbl_error.Text = lbl_error.Text & "
General Exception WMI Search: " & strUserServerName & ": " + errComExc.Message Catch errAppExc As ApplicationException lbl_error.Text = lbl_error.Text & "
Application Exception WMI Search: " & strUserServerName & ": " + errAppExc.Message Catch errRPCExc As System.Runtime.InteropServices.COMException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect (WMI Search): RPC Server Not Found: " & strUserServerName & ": " + errRPCExc.Message End Try Try objManagementScope = New ManagementScope objManagementScope.Path.Server = strUserServerName objManagementScope.Path.NamespacePath = "root\default" If strUserServerName <> "DSMINFRA001" Or strUserServerName <> "DSMNTNW001" Then objManagementScope.Options.EnablePrivileges = True objManagementScope.Options.Impersonation = ImpersonationLevel.Impersonate 'objManagementScope.Options.Username = "TitanBaseusa\Admin" << not used with Connection Authority Specified objManagementScope.Options.Username = strUser objManagementScope.Options.Password = strUserPass 'OPTIONAL: ' Note: Username/Password not allowed on INFRA001 (considered Local) objManagementScope.Options.Authority = strFormatConnectionAuthority End If objManagementClass = New ManagementClass("stdRegProv") objManagementClass.Scope = objManagementScope strKeyPath = strNewShortDatePath objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.Users), Long)) 'objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath & strkey) << std format example objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewShortDatePath) objManagementBaseObject.SetPropertyValue("sValueName", strNewShortDateKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then 'lbResults.Items.Add(myValue) strShortDateFormat = myValue End If 'strSecondaryVideoAdapter objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSecondaryVideoAdapter) objManagementBaseObject.SetPropertyValue("sValueName", strSecondaryVideoValue) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then If myValue = strSecondaryVideoValueCompare Then intSecondaryVideoAdapter = 1 End If End If '_______________________________________________________________________________ 'new Net ID '.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.'.' objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetIDPath) objManagementBaseObject.SetPropertyValue("sValueName", strNewNetIDKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strNewNetIDGUID = myValue End If strNewNetIDGUID = Replace(strNewNetIDGUID, "\DEVICE\", "") 'Response.Write(strNewNetIDGUID & "
") strNetIDArray = Split(strNewNetIDGUID, "}") 'Response.Write(strNetIDArray.Length & "
") ' -1 to get the size strNewNetIDGUID = strNetIDArray(0) & "}" 'Response.Write(strNewNetIDGUID & "
") Dim strNewNetworkPath As String = strNewNetworkPathPrefix & strNewNetIDGUID & strNewNetworkPathSuffix xx = 0 intc = 0 intIDNetCardValue = 0 For xx = 0 To (strNetIDArray.Length - 2) 'strNewNetworkPath = "SYSTEM\CurrentControlSet\Services\" & strNewNetIDGUID & "\Parameters\Tcpip\" UNCOMMENT strNewNetworkPath = "SYSTEM\CurrentControlSet\Services\" & strNetIDArray(xx) & "}" & "\Parameters\Tcpip\" 'Response.Write("
" & strNetIDArray(xx)) objManagementBaseObject = objManagementClass.GetMethodParameters("GetMultiStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strNetworkIPKeyName) objManagementBaseObject = objManagementClass.InvokeMethod("GetMultiStringValue", objManagementBaseObject, Nothing) strNewIPArray = objManagementBaseObject("sValue") intNewIPArrayLength = strNewIPArray.Length For intc = 0 To intNewIPArrayLength - 1 If InStr(strNewIPArray(intc), strIPAddress) Then intIPAddressLocated = 1 intIDNetCardValue = xx End If Next If intIPAddressLocated = 1 Then 'Response.Write("Location: " & intIDNetCardValue & " is: " & strNetIDArray(intIDNetCardValue) & "
") strArraySelectID = strNetIDArray(intIDNetCardValue) & "}" 'Response.Write("Found at: " & strArraySelectID & "
") End If 'Response.Write("IP Addy Located: " & intIPAddressLocated & "
") Next 'Response.Write("Correct ID 970: " & strArraySelectID & "
") 'strNewNetworkPath = strNewNetworkPathPrefix & strNewNetIDGUID & strNewNetworkPathSuffix strNewNetworkPath = strNewNetworkPathPrefix & strArraySelectID & strNewNetworkPathSuffix objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strNetworkShowIconKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32ShowNetworkIcon = objManagementBaseObject("uValue").ToString myValue = uInt32ShowNetworkIcon If Not myValue = "" Then strNewShowIcon = myValue If myValue = "1" Then intNetIDShowNetIcon = 1 End If End If 'Response.Write("ShowIcon: " & intNetIDShowNetIcon) ' works - at some point we determine if it works then switch array if not strNewNetworkPath = "SYSTEM\CurrentControlSet\Services\" & strArraySelectID & "\Parameters\Tcpip\" ' CHANGE IT HERE TOO intc = 0 objManagementBaseObject = objManagementClass.GetMethodParameters("GetMultiStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strNetworkGatewayKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetMultiStringValue", objManagementBaseObject, Nothing) strNewGatewayArray = objManagementBaseObject("sValue") intNewGatewayArrayLength = strNewGatewayArray.Length For intc = 0 To intNewGatewayArrayLength - 1 If InStr(strNewGatewayArray(intc), strGateway) Then intGatewayLocated = 1 End If Next 'Response.Write("Subnet NetPath Key:" & strNewNetworkPath & "
") 'Response.Write("Subnet NetPath Key:" & strNetworkSubnetMaskKey & "
") intc = 0 objManagementBaseObject = objManagementClass.GetMethodParameters("GetMultiStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strNetworkSubnetMaskKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetMultiStringValue", objManagementBaseObject, Nothing) strNewSubnetMaskArray = objManagementBaseObject("sValue") intNewSubnetMaskArrayLength = strNewSubnetMaskArray.Length For intc = 0 To intNewSubnetMaskArrayLength - 1 If InStr(strNewSubnetMaskArray(intc), strSubnetMask) Then intSubnetLocated = 1 End If Next ' WINS ' "SYSTEM\ControlSet001\Services\NetBT\Parameters\Interfaces\Tcpip_" & strNewNetIDGUID & "\" intc = 0 'strNewNetworkPath = strNetworkPrefixNetBT & strNewNetIDGUID & "\" strNewNetworkPath = strNetworkPrefixNetBT & strArraySelectID & "\" objManagementBaseObject = objManagementClass.GetMethodParameters("GetMultiStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strNetworkNameServerList) objManagementBaseObject = objManagementClass.InvokeMethod("GetMultiStringValue", objManagementBaseObject, Nothing) strNewWINSArray = objManagementBaseObject("sValue") intNewWINSArrayLength = strNewWINSArray.Length For intc = 0 To intNewWINSArrayLength - 1 If InStr(strNewWINSArray(intc), strWINS1) Then intWINS1Located = 1 End If If InStr(strNewWINSArray(intc), strWINS2) Then intWINS2Located = 1 End If Next 'DNS1-3 "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\" & strNewNetIDGUID & "\" intc = 0 strNewNetworkPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\" & strArraySelectID & "\" objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strNetworkNameServer) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "blank" Then If InStr(myValue, strDNS1) Then intDNS1Located = 1 End If If InStr(myValue, strDNS2) Then intDNS2Located = 1 End If If InStr(myValue, strDNS3) Then intDNS3Located = 1 End If End If 'Speed/Duplex "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\" ' enum keys to find NetCfgInstanceId = strNewNetIDGUID ' then get RequestedMediaType = 4102 else ' get SpeedDuplex = 4 Completed ' May HAVE to use strArraySelectID objManagementBaseObject = objManagementClass.GetMethodParameters("EnumKey") '<<<< get keys objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) With objManagementClass .Scope = objManagementScope objManagementBaseObject = .GetMethodParameters("EnumKey") With objManagementBaseObject .SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) .SetPropertyValue("sSubKeyName", strNewEnumKeyPath) End With arrSDSubKeys = CType(.InvokeMethod("EnumKey", objManagementBaseObject, Nothing).Properties.Item("sNames").Value, String()) End With intSDSubKeyLength = arrSDSubKeys.Length 'Response.Write("SpeedDuplexArray Length: " & intSDSubKeyLength & "
") 'Response.Write("StringEnumKeyPath: " & strNewEnumKeyPath & "
") For inta = 0 To intSDSubKeyLength - 1 'Card Type 1 - Listed as "RequestedMediaType" Settign objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewEnumKeyPath & arrSDSubKeys(inta) & "\") objManagementBaseObject.SetPropertyValue("sValueName", strNICDuplexSpeedRate2) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myKeyValue = objManagementBaseObject("sValue") 'Response.Write(strNewEnumKeyPath & arrSDSubKeys(inta) & "\ " ") 'Response.Write("Network Card Type: " & strNetworkCardType1 & "
") If myKeyValue = strNetworkCardType1 Then ' if key matches card Speeduplex value, then objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") ' Check that NetGUID Matches card objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewEnumKeyPath & arrSDSubKeys(inta) & "\") objManagementBaseObject.SetPropertyValue("sValueName", strDNSNetCfgInstanceIDKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) my2ndKeyValue = objManagementBaseObject("sValue") 'If my2ndKeyValue = strNewNetIDGUID Then If my2ndKeyValue = strArraySelectID Then intDuplexSettingCheck = 1 myPathValue = arrSDSubKeys(inta) End If End If Next inta = 0 For inta = 0 To intSDSubKeyLength - 1 'Card Type 2 - Listed as "SpeedDuplex" Setting objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewEnumKeyPath & arrSDSubKeys(inta) & "\") objManagementBaseObject.SetPropertyValue("sValueName", strNICDuplexSpeedRate1) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myKeyValue = objManagementBaseObject("sValue") 'Response.Write(strNewEnumKeyPath & arrSDSubKeys(inta) & "\ " ") 'Response.Write("Network Card Type: " & strNetworkcardType2 & "
") 'Response.Write("Found Data: " & myKeyValue & "
") 'Response.Write("Previous section: " & strArraySelectID & "
") If myKeyValue = strNetworkcardType2 Then objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") ' Check that NetGUID Matches card objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewEnumKeyPath & arrSDSubKeys(inta) & "\") objManagementBaseObject.SetPropertyValue("sValueName", strDNSNetCfgInstanceIDKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) my2ndKeyValue = objManagementBaseObject("sValue") 'Response.Write("Looking for: " & strArraySelectID & "
") 'Response.Write("Found: " & my2ndKeyValue & "
") 'Response.Write("strNewNetIDGUID: " & strNewNetIDGUID & "
") 'Response.Write("array with postion: " & arrSDSubKeys(inta) & "
") If my2ndKeyValue = strArraySelectID Then intDuplexSettingCheck = 1 myPathValue = arrSDSubKeys(inta) End If End If Next 'DNSReg " objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strDNSRegEnabledKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32DNSRegistration = objManagementBaseObject("uValue").ToString myValue = uInt32DNSRegistration If Not myValue = "" Then If myValue = "1" Then intRegistrationEnabled = 1 End If End If 'DNS Suffix " objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewNetworkPath) objManagementBaseObject.SetPropertyValue("sValueName", strDNSRegKeyName) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then If myValue = strDNSsuffix Then intDomainLocated = 1 End If End If 'TCPIP Window Size objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strWindowSizePath) objManagementBaseObject.SetPropertyValue("sValueName", strWindowSizeKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("uValue").ToString If Not myValue = "" Then 'If myValue = "1" Then strTCPIPWindow = myValue 'Response.Write(myValue & " <- TCPIP Window Size:" & strTCPIPWindow & "
") 'End If End If 'Processor/priority 'Response.Write(strPriorityControlPath & """ & strPriorityControlKey & "
") objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strPriorityControlPath) objManagementBaseObject.SetPropertyValue("sValueName", strPriorityControlKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("uValue").ToString If Not myValue = "" Then 'If myValue = "1" Then strPriorityControl = myValue 'Response.Write(myValue & " <- Proc & priority:" & strPriorityControl & "
") 'End If End If 'MemUsage 'Response.Write(strMemMgmtPath & """ & strMemMgmtKey & "
") objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strMemMgmtPath) objManagementBaseObject.SetPropertyValue("sValueName", strMemMgmtKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("uValue").ToString If Not myValue = "" Then 'If myValue = "1" Then strLargeSysCache = myValue 'Response.Write(myValue & " <- Programs or Cache:" & strLargeSysCache & "
") 'End If End If Catch err3 As UnauthorizedAccessException lbl_error.Text = lbl_error.Text & "
Unauthorized Access to NetID: " & strUserServerName & ": " + err3.Message Catch err4 As ManagementException lbl_error.Text = lbl_error.Text & "
Management Exception NetID: " & strUserServerName & ": " + err4.Message Catch errSystemExc As SystemException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect NetID: System Exception: " & strUserServerName & ": " + errSystemExc.Message Catch errComExc As Exception lbl_error.Text = lbl_error.Text & "
General Exception NetID: " & strUserServerName & ": " + errComExc.Message Catch errAppExc As ApplicationException lbl_error.Text = lbl_error.Text & "
Application Exception NetID: " & strUserServerName & ": " + errAppExc.Message Catch errRPCExc As System.Runtime.InteropServices.COMException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect (NetID): RPC Server Not Found: " & strUserServerName & ": " + errRPCExc.Message End Try Try '_________________________________________________________________________________________ ' LEGAL NOTICES objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strLegalsKey) objManagementBaseObject.SetPropertyValue("sValueName", strLegalNoticeCaption) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strLegalNoticeCaption = myValue If myValue = strLegalNoticeCaptionText Then intLegalNoticeCap = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strLegalsKey) objManagementBaseObject.SetPropertyValue("sValueName", strLegalNoticeText) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strLegalNoticeText = myValue If myValue = strLegalNoticeTextContent Then intLegalNoticeText = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewKeyforLogon) objManagementBaseObject.SetPropertyValue("sValueName", strDefaultDomainName) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strDefaultDomainName = myValue If myValue = strStdDomainName Then intDefaultDomainName = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewKeyforLogon) objManagementBaseObject.SetPropertyValue("sValueName", strCachedLogonsCount) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strCachedLogonsCount = myValue If myValue = strStdIntLogonCount Then intCachedLogonsCount = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewKeyforLogon) objManagementBaseObject.SetPropertyValue("sValueName", strAllocateFloppies) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strAllocateFloppies = myValue If myValue = "1" Then intAllocateFloppies = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewKeyforLogon) objManagementBaseObject.SetPropertyValue("sValueName", strAllocateCDROMs) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strAllocateCDROMs = myValue If myValue = "1" Then intAllocateCDROMs = 1 End If End If '_______________________________________________________________________________ Dim uInt32DDLUN As String objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strDontDisplayPath) objManagementBaseObject.SetPropertyValue("sValueName", strDontDisplayLastUserName) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32DDLUN = objManagementBaseObject("uValue").ToString myValue = uInt32DDLUN If Not myValue = "" Then strDDLUNsetting = myValue If myValue = "1" Then intDontDisplayLastUserName = 1 End If End If '_______________________________________________________________________________ Dim uInt32RAnonSAM As String objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strLSAChecks) objManagementBaseObject.SetPropertyValue("sValueName", strLSASAM) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32RAnonSAM = objManagementBaseObject("uValue").ToString myValue = uInt32RAnonSAM If Not myValue = "" Then If myValue = "1" Then intLSASAM = 1 End If End If '_______________________________________________________________________________ Dim uInt32FPShare As String objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strFPShareTypePath) objManagementBaseObject.SetPropertyValue("sValueName", strFPShareKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32FPShare = objManagementBaseObject("uValue").ToString myValue = uInt32FPShare If Not myValue = "" Then If myValue = strFPShareBaseValue Then intStartSharing = 1 End If End If '_______________________________________________________________________________ Dim uInt32FPShareType As String objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strFPShareTypePath) objManagementBaseObject.SetPropertyValue("sValueName", strFPShareTypeKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32FPShareType = objManagementBaseObject("uValue").ToString myValue = uInt32FPShareType If Not myValue = "" Then If myValue = strFPShareTypeBaseValue Then intSharingType = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strNewKeyforLogon) objManagementBaseObject.SetPropertyValue("sValueName", strShutdownWithoutLogon) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strShutdownWithoutLogon = myValue If myValue = "1" Then intShutdownWithoutLogon = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSecTemplateKey) objManagementBaseObject.SetPropertyValue("sValueName", strTemplateUsed) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strTemplateUsed = myValue If myValue = strStdSecurityTemplate1 Then intTemplateUsed = 1 End If If myValue = strStdSecurityTemplate2 Then intTemplateUsed = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strDCNameKey) objManagementBaseObject.SetPropertyValue("sValueName", strNetworkName) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strNetworkName = myValue If myValue = strDCValue Then intNetworkName = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strTivoliKey) objManagementBaseObject.SetPropertyValue("sValueName", strTivoliPath) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strTivoliPath = myValue If myValue = strTivoliSetting Then intTivoliPath = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSymantecKey) objManagementBaseObject.SetPropertyValue("sValueName", strSymProductVersion) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSymProductVersion = myValue If myValue = strStdSymantecProductVersion Then intSymProductVersion = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strLSAChecks) objManagementBaseObject.SetPropertyValue("sValueName", strLSASAM) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strLSASAM = myValue If myValue > 0 Then intLSASAM = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strIntelTeamImageKey) objManagementBaseObject.SetPropertyValue("sValueName", strIntelServerImageVersion) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strIntelServerImageVersion = myValue If myValue = strIntelImageSetting Then intIntelServerImageVersion = 1 End If End If '_______________________________________________________________________________ 'SNMP Scan Code: objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSNMPBusinessUnitContactPathname) objManagementBaseObject.SetPropertyValue("sValueName", strSNMPBusinessUnitContactKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPBusinessUnitContact = myValue intSNMPBusinessUnitContact = 1 End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSNMPServerLocationPathname) objManagementBaseObject.SetPropertyValue("sValueName", strSNMPServerLocationKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPServerLocation = myValue intSNMPServerLocation = 1 End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("EnumKey") '<<<< objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSNMPTrapParmsPath) strKeyPath = strSNMPMaverickPathname With objManagementClass .Scope = objManagementScope objManagementBaseObject = .GetMethodParameters("EnumKey") With objManagementBaseObject .SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) .SetPropertyValue("sSubKeyName", strSNMPMaverickPathname) End With arrSubKeys = CType(.InvokeMethod("EnumKey", objManagementBaseObject, Nothing).Properties.Item("sNames").Value, String()) End With intArrayLength = arrSubKeys.Length For i = 0 To intArrayLength - 1 objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSNMPMaverickPathname & "\" & arrSubKeys(i)) objManagementBaseObject.SetPropertyValue("sValueName", strSNMPProfileImagePath) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = arrSubKeys(i) strSNMPServerMavName = myValue If InStr(myValue, "maverick") Then intSNMPServerMaverick = 1 End If Next 'SNMP Trap Tab addresses: strKeyPath = strSNMPMaverickPathname & "maverick\" objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", "(1)") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPTrap1ID = myValue If myValue = strSNMPTrap1 Or myValue = strSNMPTrap1B Or myValue = strSNMPTrap2 Or myValue = strSNMPTrap2B Then intSNMPTrap1ID = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", "1") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPTrap1ID = myValue If myValue = strSNMPTrap1 Or myValue = strSNMPTrap1B Or myValue = strSNMPTrap2 Or myValue = strSNMPTrap2B Then intSNMPTrap1ID = 1 End If End If '______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", "(2)") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPTrap2ID = myValue If myValue = strSNMPTrap1 Or myValue = strSNMPTrap1B Or myValue = strSNMPTrap2 Or myValue = strSNMPTrap2B Then intSNMPTrap2ID = 1 End If End If '______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", "2") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPTrap2ID = myValue If myValue = strSNMPTrap1 Or myValue = strSNMPTrap1B Or myValue = strSNMPTrap2 Or myValue = strSNMPTrap2B Then intSNMPTrap2ID = 1 End If End If '______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", "(3)") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPTrap3ID = myValue If myValue = strSNMPTrap1 Or myValue = strSNMPTrap1B Or myValue = strSNMPTrap2 Or myValue = strSNMPTrap2B Or myValue = strSNMPTrap3 Then intSNMPTrap3ID = 1 End If End If '______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", "3") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPTrap3ID = myValue If myValue = strSNMPTrap1 Or myValue = strSNMPTrap1B Or myValue = strSNMPTrap2 Or myValue = strSNMPTrap2B Or myValue = strSNMPTrap3 Then intSNMPTrap3ID = 1 End If End If '______________________________________________________________________________ ' TIVTECIM not found? If intSNMPTrap3ID = 1 Then intSNMPTrap3ID = 0 ' TIVTECIM exists! ElseIf intSNMPTrap3ID = 0 Then 'TIVTECIM not found intSNMPTrap3ID = 1 End If 'SNMP Security Tab: Dim uInt32RenameMaverick As String strKeyPath = strSNMPAuthenticationTrapPathname & "ValidCommunities\" objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", strSNMPRenMavKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32RenameMaverick = objManagementBaseObject("uValue").ToString myValue = uInt32RenameMaverick If Not myValue = "" Then strRenameMaverick = myValue If Not myValue = "" Then intRenameMaverick = 1 End If If myValue = strSNMPReadCreateCommBase Then intReadCreateCommRights = 1 End If End If '_______________________________________________________________________________ Dim uInt32SendAuthenticationTrap As String strKeyPath = strSNMPAuthenticationTrapPathname objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", strSNMPEnableAuthTraps) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32SendAuthenticationTrap = objManagementBaseObject("uValue").ToString myValue = uInt32SendAuthenticationTrap If Not myValue = "" Then strSMTPAuthenticationTrap = myValue If myValue = "1" Then intSendAuthenticationTrap = 1 End If End If '_______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSNMPAcceptableHOSTSPathname) objManagementBaseObject.SetPropertyValue("sValueName", "1") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPHosts1 = myValue If myValue = strSNMPHostVerify1A Or myValue = strSNMPHostVerify1B Or myValue = strSNMPHostVerify2A Or myValue = strSNMPHostVerify2B Or myValue = strSNMPHostVerify3A Or myValue = strSNMPHostVerify3B Then intSNMPHosts1 = 1 End If End If '______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSNMPAcceptableHOSTSPathname) objManagementBaseObject.SetPropertyValue("sValueName", "2") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPHosts2 = myValue If myValue = strSNMPHostVerify1A Or myValue = strSNMPHostVerify1B Or myValue = strSNMPHostVerify2A Or myValue = strSNMPHostVerify2B Or myValue = strSNMPHostVerify3A Or myValue = strSNMPHostVerify3B Then intSNMPHosts2 = 1 End If End If '______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSNMPAcceptableHOSTSPathname) objManagementBaseObject.SetPropertyValue("sValueName", "3") objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then strSNMPHosts3 = myValue If myValue = strSNMPHostVerify1A Or myValue = strSNMPHostVerify1B Or myValue = strSNMPHostVerify2A Or myValue = strSNMPHostVerify2B Or myValue = strSNMPHostVerify3A Or myValue = strSNMPHostVerify3B Then intSNMPHosts3 = 1 End If End If '______________________________________________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetStringValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strComputerNamePath) objManagementBaseObject.SetPropertyValue("sValueName", strComputerNameKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetStringValue", objManagementBaseObject, Nothing) myValue = objManagementBaseObject("sValue") If Not myValue = "" Then 'Response.Write(myValue & """) 'Response.Write(UCase(strUserServerName) & """) If myValue = UCase(strUserServerName) Then intServernameMatches = 1 'Response.Write(myValue & ""(2)") 'Response.Write(strUserServerName & ""(2)") End If End If '_______________________________________________________________________________ Dim uInt32UncheckEnableLMHOST As String strKeyPath = strLMHostLookupPath objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", strEnableLMHostsKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32UncheckEnableLMHOST = objManagementBaseObject("uValue").ToString myValue = uInt32UncheckEnableLMHOST If Not myValue = "" Then strUncheckLMHostLookup = myValue If myValue = "0" Then intUncheckLMHostLookup = 1 End If End If '_______________________________________________________________________________ Dim uInt32NBTEnabled As String strKeyPath = strNBTEnabledPath objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKeyPath) objManagementBaseObject.SetPropertyValue("sValueName", strNBTStartKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32NBTEnabled = objManagementBaseObject("uValue").ToString myValue = uInt32NBTEnabled If Not myValue = "" Then strNBTEnabled = myValue If myValue = "1" Then intNBTEnabled = 1 End If End If '_______________________________________________________________________________ Catch err3 As UnauthorizedAccessException lbl_error.Text = lbl_error.Text & "
Unauthorized Access to SNMP/Reg: " & strUserServerName & ": " + err3.Message Catch err4 As ManagementException lbl_error.Text = lbl_error.Text & "
Management Exception SNMP/Reg: " & strUserServerName & ": " + err4.Message Catch errSystemExc As SystemException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect SNMP/Reg: System Exception: " & strUserServerName & ": " + errSystemExc.Message Catch errComExc As Exception lbl_error.Text = lbl_error.Text & "
General Exception SNMP/Reg: " & strUserServerName & ": " + errComExc.Message Catch errAppExc As ApplicationException lbl_error.Text = lbl_error.Text & "
Application Exception SNMP/Reg: " & strUserServerName & ": " + errAppExc.Message Catch errRPCExc As System.Runtime.InteropServices.COMException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect (SNMP/Reg): RPC Server Not Found: " & strUserServerName & ": " + errRPCExc.Message End Try Try Dim uInt32AutoRestartOnFailure As String objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strAutoRestartPath) objManagementBaseObject.SetPropertyValue("sValueName", strAutoRebootKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32AutoRestartOnFailure = objManagementBaseObject("uValue").ToString myValue = uInt32AutoRestartOnFailure If Not myValue = "" Then If myValue = "1" Then intAutoRestartOn = 1 End If End If '_______________________________________________________________________________ Dim uInt32KernelMemDump As String objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strKernelMemDump) objManagementBaseObject.SetPropertyValue("sValueName", strCrashDumpEnabledKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32KernelMemDump = objManagementBaseObject("uValue").ToString myValue = uInt32KernelMemDump If Not myValue = "" Then If myValue <> "0" Then intKernelMemDump = 1 End If End If '_______________________________________________________________________________ '_______LOG FILE CHECKS_______________________________________________ objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strAppEventLogPath) objManagementBaseObject.SetPropertyValue("sValueName", strAppEventLogMaxSizeKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32AppLogMaxSize = objManagementBaseObject("uValue").ToString If Not uInt32AppLogMaxSize = "" Then If uInt32AppLogMaxSize = strAppEventLogMaxSizeValue Then intAppEventMaxSize = 1 End If End If objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strAppEventLogPath) objManagementBaseObject.SetPropertyValue("sValueName", strAppEventLogOverwriteKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32AppLogOverwrite = objManagementBaseObject("uValue").ToString If Not uInt32AppLogOverwrite = "" Then If uInt32AppLogOverwrite = strAppEventLogOverwriteKeyValue Then intAppEventLogFileOverwrite = 1 End If End If Dim strAppFileName As String = "\\" & strUserServerName & strSuffixAppFileName If File.Exists(strAppFileName) Then Dim Appfi As FileInfo = New FileInfo(strAppFileName) Dim AppfileSize As Long = Appfi.Length AppLogFileSize = AppfileSize If Not AppfileSize > strAppBaseFileSize Then intAppEventLogFileSizeZero = 1 End If End If 'Security objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSecEventLogPath) objManagementBaseObject.SetPropertyValue("sValueName", strSecEventLogMaxSizeKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32SecLogMaxSize = objManagementBaseObject("uValue").ToString If Not uInt32SecLogMaxSize = "" Then If uInt32SecLogMaxSize = strSecEventLogMaxSizeValue Then intSecEventMaxSize = 1 End If End If objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSecEventLogPath) objManagementBaseObject.SetPropertyValue("sValueName", strSecEventLogOverwriteKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32SecLogOverwrite = objManagementBaseObject("uValue").ToString If Not uInt32SecLogOverwrite = "" Then If uInt32SecLogOverwrite = strSecEventLogOverwriteKeyValue Then intSecEventLogFileOverwrite = 1 End If End If Dim strSecFileName As String = "\\" & strUserServerName & strSuffixSecFileName If File.Exists(strSecFileName) Then Dim Secfi As FileInfo = New FileInfo(strSecFileName) Dim SecfileSize As Long = Secfi.Length SecLogFileSize = SecfileSize If Not SecfileSize > strSecBaseFileSize Then intSecEventLogFileSizeZero = 1 End If End If 'System objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSysEventLogPath) objManagementBaseObject.SetPropertyValue("sValueName", strSysEventLogMaxSizeKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32SysLogMaxSize = objManagementBaseObject("uValue").ToString If Not uInt32SysLogMaxSize = "" Then If uInt32SysLogMaxSize = strSysEventLogMaxSizeValue Then intSysEventMaxSize = 1 End If End If objManagementBaseObject = objManagementClass.GetMethodParameters("GetDWORDValue") objManagementBaseObject.SetPropertyValue("hDefKey", CType("&H" & Hex(RegistryHive.LocalMachine), Long)) objManagementBaseObject.SetPropertyValue("sSubKeyName", strSysEventLogPath) objManagementBaseObject.SetPropertyValue("sValueName", strSysEventLogOverwriteKey) objManagementBaseObject = objManagementClass.InvokeMethod("GetDWORDValue", objManagementBaseObject, Nothing) uInt32SysLogOverwrite = objManagementBaseObject("uValue").ToString If Not uInt32SysLogOverwrite = "" Then If uInt32SysLogOverwrite = strSysEventLogOverwriteKeyValue Then intSysEventLogFileOverwrite = 1 End If End If Dim strSysFileName As String = "\\" & strUserServerName & strSuffixSysFileName If File.Exists(strSysFileName) Then Dim Sysfi As FileInfo = New FileInfo(strSysFileName) Dim SysfileSize As Long = Sysfi.Length SysLogFileSize = SysfileSize If Not SysfileSize > strSysBaseFileSize Then intSysEventLogFileSizeZero = 1 End If End If '_______________________________________________________________________________ Catch err3 As UnauthorizedAccessException lbl_error.Text = lbl_error.Text & "
Unauthorized Access to Log Files: " & strUserServerName & ": " + err3.Message Catch err4 As ManagementException lbl_error.Text = lbl_error.Text & "
Management Exception Log Files: " & strUserServerName & ": " + err4.Message Catch errSystemExc As SystemException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect Log Files: System Exception: " & strUserServerName & ": " + errSystemExc.Message Catch errComExc As Exception lbl_error.Text = lbl_error.Text & "
General Exception Log Files: " & strUserServerName & ": " + errComExc.Message Catch errAppExc As ApplicationException lbl_error.Text = lbl_error.Text & "
Application Exception Log Files: " & strUserServerName & ": " + errAppExc.Message Catch errRPCExc As System.Runtime.InteropServices.COMException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect (Log Files): RPC Server Not Found: " & strUserServerName & ": " + errRPCExc.Message End Try Try '_______________________________________________________________________________ ' Check Windows Services State and Status For Each objMgmt In objSearchWS.Get m_strServiceName = objMgmt("DisplayName").ToString() m_strServiceState = objMgmt("State").ToString() m_strServiceStartMode = objMgmt("StartMode").ToString() If m_strServiceName = "Symantec AntiVirus" Then strAntiVirusState = m_strServiceState strAntiVirusStartMode = m_strServiceStartMode End If If m_strServiceName = "IIS Admin Service" Then strIISAdminState = m_strServiceState strIISAdminStartMode = m_strServiceStartMode End If If m_strServiceName = "Network News Transport Protocol (NNTP)" Then strNNTPServiceState = m_strServiceState strNNTPServiceStartMode = m_strServiceStartMode End If If m_strServiceName = "Simple Mail Transport Protocol (SMTP)" Then strSMTPServiceState = m_strServiceState strSMTPServiceStartMode = m_strServiceStartMode End If If m_strServiceName = "World Wide Web Publishing Service" Then strWWWServiceState = m_strServiceState strWWWServiceStartMode = m_strServiceStartMode End If If m_strServiceName = "Background Intelligent Transfer Service" Then strBITSState = m_strServiceState strBITSStartMode = m_strServiceStartMode End If If m_strServiceName = "SNMP Service" Then strSNMPState = m_strServiceState strSNMPStartMode = m_strServiceStartMode End If If m_strServiceName = "Telephony" Then strTelephonyState = m_strServiceState strTelephonyStartMode = m_strServiceStartMode End If If m_strServiceName = "TSM Backup Scheduler" Then strTSMBackupSchedState = m_strServiceState strTSMBackupSchedStartMode = m_strServiceStartMode End If If m_strServiceName = "Automatic Updates" Then strAutoUpdatesState = m_strServiceState strAutoUpdatesStartMode = m_strServiceStartMode End If If m_strServiceName = "Tivoli Endpoint" Then strTivoliEndpointState = m_strServiceState strTivoliEndpointStartMode = m_strServiceStartMode End If Next If strWWWServiceState = "" Then strWWWServiceState = "Off" strWWWServiceStartMode = "Service Removed" End If If strIISAdminState = "" Then strIISAdminState = "Off" strIISAdminStartMode = "Service Removed" End If If strBITSState = "" Then strBITSState = "Off" strBITSStartMode = "Service Removed" End If If strTivoliEndpointState = "" Then strTivoliEndpointState = "Off" strTivoliEndpointStartMode = "Service Removed" End If If strAutoUpdatesState = "" Then strAutoUpdatesState = "Off" strAutoUpdatesStartMode = "Service Removed" End If If strTSMBackupSchedState = "" Then strTSMBackupSchedState = "Off" strTSMBackupSchedStartMode = "Service Removed" End If If strTelephonyState = "" Then strTelephonyState = "Off" strTelephonyStartMode = "Service Removed" End If If strSNMPState = "" Then strSNMPState = "Off" strSNMPStartMode = "Service Removed" End If If strSMTPServiceState = "" Then strSMTPServiceState = "Off" strSMTPServiceStartMode = "Service Removed" End If If strNNTPServiceState = "" Then strNNTPServiceState = "Off" strNNTPServiceStartMode = "Service Removed" End If If strAntiVirusState = "" Then strAntiVirusState = "Off" strAntiVirusStartMode = "Service Removed" End If Catch err6 As UnauthorizedAccessException lbl_error.Text = lbl_error.Text & "
Unauthorized Access to Services: " & strUserServerName & ": " + err6.Message Catch err7 As ManagementException lbl_error.Text = lbl_error.Text & "
Management Exception Services: " & strUserServerName & ": " + err7.Message Catch errSystem10 As SystemException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect Services: System Exception: " & strUserServerName & ": " + errSystem10.Message Catch errComExc As Exception lbl_error.Text = lbl_error.Text & "
General Exception Services: " & strUserServerName & ": " + errComExc.Message Catch errAppExc As ApplicationException lbl_error.Text = lbl_error.Text & "
Application Exception Services: " & strUserServerName & ": " + errAppExc.Message Catch errRPCExc As System.Runtime.InteropServices.COMException lbl_error.Text = lbl_error.Text & "
MgmtScope Connect (Services): RPC Server Not Found: " & strUserServerName & ": " + errRPCExc.Message End Try Try 'Dim str As String = "\\" & strUserServerName & "\c$\windows\temp\secedit" & strUserServerName & ".txt" Dim TSMOPSR As System.IO.StreamReader = New System.IO.StreamReader("\\" & strUserServerName & strTSMOpFileLocation) Dim tsmline As String Dim tsmlinepos As Integer Do tsmline = TSMOPSR.ReadLine() tsmlinepos = InStr(tsmline, strTCPServerAddy, CompareMethod.Text) If tsmlinepos > 0 Then strTSMOpLabel = strTSMOpLabel & "
" & tsmline Exit Do End If Loop Catch ex As Exception ' do this End Try Try 'Dim strNetSecedServerName As String = strWebsiteHomeFolder & "netxml\secedit" & strUserServerName & ".txt" Dim strNetSecedServerName As String = "\\" & strUserServerName & "\c$\windows\temp\secedit" & strUserServerName & ".txt" 'Response.Write(strNetSecedServerName & "
") Dim SCESR As System.IO.StreamReader = New System.IO.StreamReader(strNetSecedServerName) Dim sceline As String Dim scelinepos As Integer ' finds the file Do sceline = SCESR.ReadLine() scelinepos = InStr(sceline, strSecedAdminName, CompareMethod.Text) If scelinepos > 0 Then intSecedAdminName = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strSecedGuestName, CompareMethod.Text) If scelinepos > 0 Then intSecedGuestName = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strSecedEnableGuest, CompareMethod.Text) If scelinepos > 0 Then intSecedEnableGuest = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strSecedRemoteSD, CompareMethod.Text) If scelinepos > 0 Then intSecedRemoteSD = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strSecedAdminSD, CompareMethod.Text) If scelinepos > 0 Then intSecedAdminSD = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strChkPasswordHistory, CompareMethod.Text) If scelinepos > 0 Then intChkPasswordHistory = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strChkMaxPasswordAge, CompareMethod.Text) If scelinepos > 0 Then intChkMaxPasswordAge = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strChkMinPasswordAge, CompareMethod.Text) If scelinepos > 0 Then intChkMinPasswordAge = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strChkMinPasswordLength, CompareMethod.Text) If scelinepos > 0 Then intChkMinPasswordLength = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strChkAccountLockoutDuration, CompareMethod.Text) If scelinepos > 0 Then intChkAccountLockoutDuration = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strChkAccountInvalidLogin, CompareMethod.Text) If scelinepos > 0 Then intChkAccountInvalidLogin = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strChkAccountLockoutCounter, CompareMethod.Text) If scelinepos > 0 Then intChkAccountLockoutCounter = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountLogon, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountLogonSuccess = 1 intAuditAccountLogonFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountManagement, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountManagementSuccess = 1 intAuditAccountManagementFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountDSA, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountDSASuccess = 1 intAuditAccountDSAFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountLogonEvent, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountLogonEventSuccess = 1 intAuditAccountLogonEventFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountObjectAccess, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountObjectAccessSuccess = 1 intAuditAccountObjectAccessFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountPolicyChange, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountPolicyChangeSuccess = 1 intAuditAccountPolicyChangeFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountPrivilegeUse, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountPrivilegeUseSuccess = 1 intAuditAccountPrivilegeUseFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountProcessTracking, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountProcessTrackingSuccess = 1 intAuditAccountProcessTrackingFailure = 1 End If scelinepos = 0 scelinepos = InStr(sceline, strAuditAccountSystemEvents, CompareMethod.Text) If scelinepos > 0 Then intAuditAccountSystemEventsSuccess = 1 intAuditAccountSystemEventsFailure = 1 End If scelinepos = 0 'Response.Write("File Read Properly") Loop Until sceline Is Nothing SCESR.Close() Catch Exception As Exception lbl_error.Text = lbl_error.Text & "
The SecEdit file could not be read. Reason: " + Exception.Message Finally 'Do this End Try Try Dim tempInt As Integer = 1 Dim AD As New DirectoryEntry("WinNT://" & strUserServerName & ",computer") ' access denied Dim group As DirectoryEntry = AD.Children.Find("administrators", "group") Dim members As Object = group.Invoke("Members", Nothing) Dim member As Object For Each member In CType(members, IEnumerable) Dim x As New DirectoryEntry(member) strCreateAdminLabel = strCreateAdminLabel & tempInt & ": " & x.Name & "
" tempInt = tempInt + 1 Next member group.Dispose() AD.Dispose() Catch ex As Exception End Try End If '_____________________END of SCAN Codes and Bit Flips__________________________ '\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\ '\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\\/\/\/\/\/\/\ '_______BEGIN Form Changes to show baseline compliance___________________________ 'RILO Scan: Try If intChkRiloEnabled = 1 Then chk1_1.Checked = True chk1_1.Text = chk1_1.Text & " (Found: " & strChkRiloEnabled & ")" ElseIf intChkRiloDisenableDHCP <> 1 Then chk1_1.Text = chk1_1.Text & " (Not Found: " & strChkRiloEnabled & ") (Initial: )" End If If intChkRiloXfrAutoSelectOff = 1 Then chk1_2.Checked = True chk1_2.Text = chk1_2.Text & " (Found: " & strChkRiloXfrAutoSelectOff & ")" ElseIf intChkRiloXfrAutoSelectOff <> 1 Then chk1_2.Text = chk1_2.Text & " (Not Found: " & strChkRiloXfrAutoSelectOff & ") (Initial: )" End If If intChkRiloSpeed100Mbs = 1 Then chk1_3.Checked = True chk1_3.Text = chk1_3.Text & " (Found: " & strChkRiloSpeed100Mbs & ")" ElseIf intChkRiloSpeed100Mbs <> 1 Then chk1_3.Text = chk1_3.Text & " (Not Found: " & strChkRiloSpeed100Mbs & ") (Initial: )" End If If intChkRiloFullDuplex = 1 Then chk1_4.Checked = True chk1_4.Text = chk1_4.Text & " (Found: " & strChkRiloFullDuplex & ")" ElseIf intChkRiloFullDuplex <> 1 Then chk1_4.Text = chk1_4.Text & " (Not Found: " & strChkRiloFullDuplex & ") (Initial: )" End If If intChkRiloDisenableDHCP = 1 Then chk1_5.Checked = True chk1_5.Text = chk1_5.Text & " (Found: " & strChkRiloDisenableDHCP & ")" ElseIf intChkRiloDisenableDHCP <> 1 Then chk1_5.Text = chk1_5.Text & " (Not Found: " & strChkRiloDisenableDHCP & ") (Initial: )" End If If intChkRiloNoRegisterwithWINS = 1 Then chk1_6.Checked = True chk1_6.Text = chk1_6.Text & " (Found: " & strChkRiloNoRegisterwithWINS & ")" ElseIf intChkRiloNoRegisterwithWINS <> 1 Then chk1_6.Text = chk1_6.Text & " (Not Found: " & strChkRiloNoRegisterwithWINS & ") (Initial: )" End If If intChkRiloNoRegisterwithDNS = 1 Then chk1_7.Checked = True chk1_7.Text = chk1_7.Text & " (Found: " & strChkRiloNoRegisterwithDNS & ")" ElseIf intChkRiloNoRegisterwithDNS <> 1 Then chk1_7.Text = chk1_7.Text & " (Not Found: " & strChkRiloNoRegisterwithDNS & ") (Initial: )" End If If intChkRiloRenameAdministrator = 1 Then chk1_8.Checked = True chk1_8.Text = chk1_8.Text & " (Found: " & strChkRiloRenameAdministrator & " does not exist in XML)" ElseIf intChkRiloRenameAdministrator <> 1 Then chk1_8.Text = chk1_8.Text & " (Not Found: " & strChkRiloRenameAdministrator & " exists in XML) (Initial: )" End If 'Local Security Policy Scan: If intChkPasswordHistory = 1 And intChkMaxPasswordAge = 1 And intChkMinPasswordAge = 1 And intChkMinPasswordLength = 1 Then chk4_4.Checked = True chk4_4.Text = chk4_4.Text & " (Found: All settings)" Else chk4_4.Text = chk4_4.Text & " (Not Found: Missing settings)" End If If intChkPasswordHistory = 1 Then Label19.Text = "
(Found: " & strChkPasswordHistory & ")" Else Label19.Text = "
(Not Found: " & strChkPasswordHistory & ") (Initial: )" End If If intChkMaxPasswordAge = 1 Then Label20.Text = "
(Found: " & strChkMaxPasswordAge & ")" Else Label20.Text = "
(Not Found: " & strChkMaxPasswordAge & ") (Initial: )" End If If intChkMinPasswordAge = 1 Then Label21.Text = "
(Found: " & strChkMinPasswordAge & ")" Else Label21.Text = "
(Not Found: " & strChkMinPasswordAge & ") (Initial: )" End If If intChkMinPasswordLength = 1 Then Label22.Text = "
(Found: " & strChkMinPasswordLength & ")" Else Label22.Text = "
(Not Found: " & strChkMinPasswordLength & ") (Initial: )" End If If intChkAccountLockoutDuration = 1 And intChkAccountInvalidLogin = 1 And intChkAccountLockoutCounter = 1 Then chk4_5.Checked = True chk4_5.Text = chk4_5.Text & " (Found: All settings)" Else chk4_5.Text = chk4_5.Text & " (Not Found: Missing settings) (Initial: )" End If If intChkAccountLockoutDuration = 1 Then Label23.Text = "
(Found: " & strChkAccountLockoutDuration & ")" Else Label23.Text = "
(Not Found: " & strChkAccountLockoutDuration & ") (Initial: )" End If If intChkAccountInvalidLogin = 1 Then Label24.Text = "
(Found: " & strChkAccountInvalidLogin & ")" Else Label24.Text = "
(Not Found: " & strChkAccountInvalidLogin & ") (Initial: )" End If If intChkAccountLockoutCounter = 1 Then Label25.Text = "
(Found: " & strChkAccountLockoutCounter & ")" Else Label25.Text = "
(Not Found: " & strChkAccountLockoutCounter & ") (Initial: )" End If 'Audit Settings If intAuditAccountLogonSuccess = 1 And intAuditAccountManagementSuccess = 1 And intAuditAccountDSASuccess = 1 And intAuditAccountLogonEventSuccess = 1 And intAuditAccountObjectAccessSuccess = 1 And intAuditAccountPolicyChangeSuccess = 1 And intAuditAccountPrivilegeUseSuccess = 1 And intAuditAccountProcessTrackingSuccess = 1 And intAuditAccountSystemEventsSuccess = 1 Then chk4_6.Checked = True chk4_6.Text = chk4_6.Text & " (Found: All settings)" Else chk4_6.Text = chk4_6.Text & " (Not Found: Missing settings)" End If If intAuditAccountLogonEventSuccess = 1 Then Label26.Text = "Verified" Else Label26.Text = "Error" End If If intAuditAccountLogonEventFailure = 1 Then Label77.Text = "Verified" Else Label77.Text = "Error" End If If intAuditAccountManagementSuccess = 1 Then Label27.Text = "Verified" Else Label27.Text = "Error" End If If intAuditAccountManagementFailure = 1 Then Label78.Text = "Verified" Else Label78.Text = "Error" End If If intAuditAccountDSASuccess = 1 Then Label28.Text = "Verified" Else Label28.Text = "Error" End If If intAuditAccountDSAFailure = 1 Then Label79.Text = "Verified" Else Label79.Text = "Error" End If If intAuditAccountLogonSuccess = 1 Then Label29.Text = "Verified" Else Label29.Text = "Error" End If If intAuditAccountLogonFailure = 1 Then Label80.Text = "Verified" Else Label80.Text = "Error" End If If intAuditAccountObjectAccessSuccess = 1 Then Label31.Text = "Verified" Else Label31.Text = "Error" End If If intAuditAccountObjectAccessFailure = 1 Then Label81.Text = "Verified" Else Label81.Text = "Error" End If If intAuditAccountPolicyChangeSuccess = 1 Then Label30.Text = "Verified" Else Label30.Text = "Error" End If If intAuditAccountPolicyChangeFailure = 1 Then Label82.Text = "Verified" Else Label82.Text = "Error" End If If intAuditAccountPrivilegeUseSuccess = 1 Then Label32.Text = "Verified" Else Label32.Text = "Error" End If If intAuditAccountPrivilegeUseFailure = 1 Then Label83.Text = "Verified" Else Label83.Text = "Error" End If If intAuditAccountProcessTrackingSuccess = 1 Then Label34.Text = "Verified" Else Label34.Text = "Error" End If If intAuditAccountProcessTrackingFailure = 1 Then Label84.Text = "Verified" Else Label84.Text = "Error" End If If intAuditAccountSystemEventsSuccess = 1 Then Label33.Text = "Verified" Else Label33.Text = "Error" End If If intAuditAccountSystemEventsFailure = 1 Then Label85.Text = "Verified" Else Label85.Text = "Error" End If 'Hardware Scan: If strDiskSize1 > 2 Or strDiskSize2 > 2 Then intChkHWDiskSize = 1 chk2_1.Checked = True 'If strPartitionInfo = "" Then ", Partition: " & strPartitionInfo & ")" intDrives = 5 For xx = 1 To intDrives If xx = 1 Then chk2_1.Text = chk2_1.Text & " 
(Found: Disk" & xx & ":" & Decimal.Round((((strDiskSize1) / 1024) / 1024) / 1000, 2) & "GB)" ElseIf xx = 2 Then chk2_1.Text = chk2_1.Text & " 
(Found: Disk" & xx & ":" & Decimal.Round((((strDiskSize2) / 1024) / 1024) / 1000, 2) & "GB)" ElseIf xx = 3 Then chk2_1.Text = chk2_1.Text & " 
(Found: Disk" & xx & ":" & Decimal.Round((((strDiskSize3) / 1024) / 1024) / 1000, 2) & "GB)" ElseIf xx = 4 Then chk2_1.Text = chk2_1.Text & " 
(Found: Disk" & xx & ":" & Decimal.Round((((strDiskSize4) / 1024) / 1024) / 1000, 2) & "GB)" ElseIf xx = 5 Then chk2_1.Text = chk2_1.Text & " 
(Found: Disk" & xx & ":" & Decimal.Round((((strDiskSize5) / 1024) / 1024) / 1000, 2) & "GB)" ElseIf xx = 6 Then chk2_1.Text = chk2_1.Text & " 
(Found: Disk" & xx & ":" & Decimal.Round((((strDiskSize6) / 1024) / 1024) / 1000, 2) & "GB)" End If Next chk2_1.Text = chk2_1.Text & " 
(Found: Disk Array Controller State: " & strHDDArrayState & ", StartMode: " & strHDDArrayStartMode & ")" chk2_1.Text = chk2_1.Text & " 
(Build Request: " & strArrayConfig & ")" 'chk2_1.Text = chk2_1.Text & " 
(Found: Disk0:" & Decimal.Round(((strDiskSize / 1024) / 1024) / 1000, 2) & "GB Disk1:" & Decimal.Round(((strDiskSize2 / 1024) / 1024) / 1000, 2) & "GB, Disk Array Controller State: " & strHDDArrayState & ", StartMode: " & strHDDArrayStartMode & ")
(Build Request: " & strArrayConfig & ", Partition: " & strPartitionInfo & ")" Else chk2_1.Text = chk2_1.Text & " 
(Found: Disk0:" & Decimal.Round(((strDiskSize1 / 1024) / 1024) / 1000, 2) & "GB Disk1:" & Decimal.Round(((strDiskSize2 / 1024) / 1024) / 1000, 2) & "GB, Disk Array Controller State: " & strHDDArrayState & ", StartMode: " & strHDDArrayStartMode & ")
(Build Request: " & strArrayConfig & ") (Initial: )" End If If strOSVersion <> "" Then chk3_5.Checked = True chk3_5.Text = chk3_5.Text & " (Found: " & strOSVersion & "/SP:" & strOSPackVersion & ")" Else chk3_5.Text = chk3_5.Text & " (Not Found: OS/Service Pack) (Initial: )" End If If strCDROMdriveLetter = "R:" Then intChkCDROMdriveLetter = 1 chk2_3.Checked = True chk2_3.Text = chk2_3.Text & " (Found: R: CDROM Drive Letter)" ElseIf strCDROMdriveLetter <> "R:" Then chk2_3.Text = chk2_3.Text & " (Not Found: R: CDROM Drive Letter) (Initial: )" End If If strScreenHeight >= 600 And strScreenWidth >= 800 Then intChkScreenResolution = 1 chk5_3.Checked = True chk5_3.Text = chk5_3.Text & " (Found: " & strScreenWidth & "x" & strScreenHeight & ")" ElseIf strScreenHeight < 600 And strScreenHeight > 1 Or strScreenWidth < 800 And strScreenWidth > 1 Then chk5_3.Text = chk5_3.Text & " (Not Found: " & strScreenWidth & "x" & strScreenHeight & ")" Else chk5_3.Text = chk5_3.Text & " (Not Found: Screen dimensions not found) (Initial: )" End If If intSecondaryVideoAdapter = 1 Then chk2_2.Checked = True chk2_2.Text = chk2_2.Text & " (Found: NoDisplay=1)" Else chk2_2.Text = chk2_2.Text & " (Setting not found) (Initial: )" End If 'File Exists Scan: If strFileNameFNM = strVerifyFNM Then Label14.Text = " (Found: system32\netmon\netmon.exe)" Else Label14.Text = " (Not Found: system32\netmon\netmon.exe)" End If If strFileNameFRC = strVerifyFRC Then Label15.Text = " (Found: Recovery Console: cmdcons folder)" Else Label15.Text = " (Not Found: Recovery Console: cmdcons folder)" End If If strFileNameFAP = strVerifyFAP Then Label16.Text = " (Found: Admin Pack files)" Else Label16.Text = " (Not Found: Admin Pack files)" End If If strFileNameFSS = strVerifyFSS Then Label17.Text = " (Found: Server Support Tools)" Else Label17.Text = " (Not Found: Server Support Tools)" End If If strFileNameFSK = strVerifyFSK Then Label18.Text = " (Found: Resource Kit Files)" Else Label18.Text = " (Not Found: Resource Kit Files)" End If If intFileNameSIM = 1 Then LabelSIM.Text = " (Found: System Insight Manager)" Else LabelSIM.Text = " (Not Found: System Insight Manager)" End If If strFileNameFNM = strVerifyFNM And strFileNameFRC = strVerifyFRC And strFileNameFAP = strVerifyFAP And strFileNameFSS = strVerifyFSS And strFileNameFSK = strVerifyFSK And intFileNameSIM = 1 Then chk3_4.Checked = True chk3_4.Text = chk3_4.Text & " (Found: All files)" Else chk3_4.Text = chk3_4.Text & " (Not Found: Missing file(s)) (Initial: )" End If If Not strTCPIPWindow = "" Then chk2_9.Text = chk2_9.Text & " (Found TCPIP Window: " & strTCPIPWindow & ")
" Else chk2_9.Text = chk2_9.Text & " (Not Found TCPIP Window: " & strTCPIPWindow & ")
" End If 'Registry Scan: If strShortDateFormat = strStdDateFormat Then intShortDateFormat = 1 chk5_2.Checked = True chk5_2.Text = chk5_2.Text & " (Found: Valid date format)" Else chk5_2.Text = chk5_2.Text & " (Not Found: Valid date format) (Initial: )" End If If intLegalNoticeText = 1 Then Label41.Text = "
Found: " & strLegalNoticeText & "" 'add to total Else Label41.Text = "
Not Found. Current config: '" & strLegalNoticeText & "'
(Initial: )" End If If intLegalNoticeCap = 1 Then Label42.Text = "
Found: '" & strLegalNoticeCaption & "'" 'add to total Else Label42.Text = "
Not Found. Current config: '" & strLegalNoticeCaption & "'
(Initial: )" End If If intSNMPBusinessUnitContact = 1 Then Label64.Text = " (Found: " & strSNMPBusinessUnitContact & ")" intSNMPAgentTab += 1 Else Label64.Text = "(Business Unit Contact not found) (Initial: )" End If If intSNMPServerLocation = 1 Then Label65.Text = " (Found: " & strSNMPServerLocation & ")" intSNMPAgentTab += 1 Else Label65.Text = "(Server Location not found) (Initial: )" End If If intSNMPServerMaverick = 1 Then Label66.Text = " (Found: " & strSNMPServerMavName & ")" intSNMPAgentTab += 1 Else Label66.Text = " (Not Found: " & strSNMPServerMavName & ") (Initial: )" End If If intSNMPAgentTab = 3 Then chk5_7.Checked = True chk5_7.Text = chk5_7.Text & " (Found: All settings)" Else chk5_7.Text = chk5_7.Text & " (Not Found: Missing Settings)" End If If intSNMPTrap1ID = 1 Then Label67.Text = " (Found: " & strSNMPTrap1ID & ")" Else Label67.Text = " (Not Found: " & strSNMPTrap1ID & ") (Initial: )" End If If intSNMPTrap2ID = 1 Then Label68.Text = " (Found: " & strSNMPTrap2ID & ")" Else Label68.Text = " (Not Found: " & strSNMPTrap2ID & ") (Initial: )" End If If intSNMPTrap3ID = 1 Then Label69.Text = " (Removed: TIVTECIM)" Else Label69.Text = " (Not Removed: TIVTECIM) (Initial: )" End If If intSNMPTrap3ID = 1 And intSNMPTrap3ID = 1 And intSNMPTrap3ID = 1 Then chk5_8.Checked = True chk5_8.Text = chk5_8.Text & " (Found: All settings)" Else chk5_8.Text = chk5_8.Text & " (Not Found: Missing settings)" End If If intRenameMaverick = 1 Then Label70.Text = " (Found: -IntelServer)" Else Label70.Text = " (Not Found: -IntelServer) (Initial: )" End If If intReadCreateCommRights = 1 Then Label71.Text = " (Found: Read/Create)" Else Label71.Text = " (Not Found: Missing Value) (Initial: )" End If If intSendAuthenticationTrap = 1 Then Label72.Text = " (Found: Enabled)" Else Label72.Text = " (Not Found: Missing or incorrect) (Initial: )" End If If intSNMPHosts1 = 1 Then Label74.Text = " (Found: " & strSNMPHosts1 & ")" Else Label74.Text = " (Not Found: Missing or incorrect setting) (Initial: )" End If If intSNMPHosts2 = 1 Then Label75.Text = " (Found: " & strSNMPHosts2 & ")" Else Label75.Text = " (Not Found: Missing or incorrect setting) (Initial: )" End If If intSNMPHosts3 = 1 Then Label76.Text = " (Found: " & strSNMPHosts3 & ")" Else Label76.Text = " (Not Found: Missing or incorrect setting) (Initial: )" End If If intSNMPHosts3 = 1 And intSNMPHosts2 = 1 And intSNMPHosts1 = 1 Then Label73.Text = " (Found: All settings)" Else Label73.Text = " (Not Found: Missing settings)" End If If intSNMPHosts3 = 1 And intSNMPHosts2 = 1 And intSNMPHosts1 = 1 And intSendAuthenticationTrap = 1 And intReadCreateCommRights = 1 And intRenameMaverick = 1 Then chk5_9.Checked = True chk5_9.Text = chk5_9.Text & " (Found: All settings)" Else chk5_9.Text = chk5_9.Text & " (Not Found: Missing settings)" End If If chk5_9.Checked = True And chk5_8.Checked = True And chk5_7.Checked = True Then chk5_6.Checked = True End If 'Windows Services vs. Server Type Baseline Comparison If Not strAntiVirusState = "" Then If strAntiVirusState <> "Off" Then intAntiVirus = 1 chk3_8.Checked = True chk3_8.Text = chk3_8.Text & " (SAV:" & strAntiVirusState & "/" & strAntiVirusStartMode & ")" Else chk3_8.Text = chk3_8.Text & " (SAV:" & strAntiVirusState & "/" & strAntiVirusStartMode & ")" End If Else chk3_8.Text = chk3_8.Text & " (SAV:" & strAntiVirusState & "/" & strAntiVirusStartMode & ")" End If If strIISAdminState = strIISAdminBaselineState And strIISAdminStartMode = strIISAdminBaselineStartMode Then intIISAdminOK = 1 chk3_1.Checked = True '<------- 3.1 Check chk3_1.Text = chk3_1.Text & " (IIS:" & strIISAdminState & "/" & strIISAdminStartMode & ")" Else chk3_1.Text = chk3_1.Text & " (IIS:" & strIISAdminState & "/" & strIISAdminStartMode & ")" End If If strIISAdminState = strIISAdminBaselineState2 And strIISAdminStartMode = strIISAdminBaselineStartMode2 Then intIISAdminOK = 1 chk3_1.Checked = True '<------- 3.1 Check chk3_1.Text = chk3_1.Text & " (IIS:" & strIISAdminState & "/" & strIISAdminStartMode & ")" Else chk3_1.Text = chk3_1.Text & " (IIS:" & strIISAdminState & "/" & strIISAdminStartMode & ")" End If If strIISAdminState = strIISAdminBaselineState3 And strIISAdminStartMode = strIISAdminBaselineStartMode3 Then intIISAdminOK = 1 chk3_1.Checked = True '<------- 3.1 Check chk3_1.Text = chk3_1.Text & " (IIS:" & strIISAdminState & "/" & strIISAdminStartMode & ")" Else chk3_1.Text = chk3_1.Text & " (IIS:" & strIISAdminState & "/" & strIISAdminStartMode & ")" End If If strNNTPServiceState = strNNTPServiceBaselineState And strNNTPServiceStartMode = strNNTPServiceBaselineStartMode Then intNNTPServiceOK = 1 End If If strNNTPServiceState = strNNTPServiceBaselineState2 And strNNTPServiceStartMode = strNNTPServiceBaselineStartMode2 Then intNNTPServiceOK = 1 End If If strNNTPServiceState = strNNTPServiceBaselineState3 And strNNTPServiceStartMode = strNNTPServiceBaselineStartMode3 Then intNNTPServiceOK = 1 End If If strSMTPServiceState = strSMTPServiceBaselineState And strSMTPServiceStartMode = strSMTPServiceBaselineStartMode Then intSMTPServiceOK = 1 End If If strSMTPServiceState = strSMTPServiceBaselineState2 And strSMTPServiceStartMode = strSMTPServiceBaselineStartMode2 Then intSMTPServiceOK = 1 End If If strSMTPServiceState = strSMTPServiceBaselineState3 And strSMTPServiceStartMode = strSMTPServiceBaselineStartMode3 Then intSMTPServiceOK = 1 End If If strWWWServiceState = strWWWServiceBaselineState And strWWWServiceStartMode = strWWWServiceBaselineStartMode Then intWWWServiceOK = 1 End If If strWWWServiceState = strWWWServiceBaselineState2 And strWWWServiceStartMode = strWWWServiceBaselineStartMode2 Then intWWWServiceOK = 1 End If If strWWWServiceState = strWWWServiceBaselineState3 And strWWWServiceStartMode = strWWWServiceBaselineStartMode3 Then intWWWServiceOK = 1 End If If intWWWServiceOK = 1 And intSMTPServiceOK = 1 And intNNTPServiceOK = 1 Then chk3_2.Checked = True '<-------- 3.2 Check chk3_2.Text = chk3_2.Text & "
 (WWW:" & strWWWServiceState & "/" & strWWWServiceStartMode & ", SMTP:" & strSMTPServiceState & "/" & strSMTPServiceStartMode & ", NNTP:" & strNNTPServiceState & "/" & strNNTPServiceStartMode & ")" Else chk3_2.Text = chk3_2.Text & "
 (WWW:" & strWWWServiceState & "/" & strWWWServiceStartMode & ", SMTP:" & strSMTPServiceState & "/" & strSMTPServiceStartMode & ", NNTP:" & strNNTPServiceState & "/" & strNNTPServiceStartMode & ")" End If If strSNMPState = strSNMPBaselineState And strSNMPStartMode = strSNMPBaselineStartMode Then chk3_3.Checked = True chk3_3.Text = chk3_3.Text & "
 (SNMP:" & strSNMPState & "/" & strSNMPStartMode & ")" chk5_1.Checked = True chk5_1.Text = chk5_1.Text & " (Found: SNMP Config)" Else chk3_3.Text = chk3_3.Text & "
 (SNMP:" & strSNMPState & "/" & strSNMPStartMode & ")" chk5_1.Text = chk5_1.Text & " (Not Found: SNMP Config) (Initial: )" End If If strAutoUpdatesState = strAutoUpdatesBaselineState And strAutoUpdatesStartMode = strAutoUpdatesBaselineStartMode Then intAutoUpdatesOK = 1 Label62.Text = " (Automatic Updates:" & strAutoUpdatesState & "/" & strAutoUpdatesStartMode & ")" Else Label62.Text = " (Automatic Updates:" & strAutoUpdatesState & "/" & strAutoUpdatesStartMode & ")" End If If strBITSState = strBITSBaselineState And strBITSStartMode = strBITSBaselineStartMode Then intBITSOK = 1 Label63.Text = " (BITS:" & strBITSState & "/" & strBITSStartMode & ")" Else Label63.Text = " (BITS:" & strBITSState & "/" & strBITSStartMode & ")" End If If strTelephonyState = strTelephonyBaselineState And strTelephonyStartMode = strTelephonyBaselineStartMode Then chk5_10.Checked = True chk5_10.Text = chk5_10.Text & " (Telephony:" & strTelephonyState & "/" & strTelephonyStartMode & ")" ElseIf strTelephonyState = strTelephonyBaselineState2 And strTelephonyStartMode = strTelephonyBaselineStartMode2 Then chk5_10.Checked = True chk5_10.Text = chk5_10.Text & " (Telephony:" & strTelephonyState & "/" & strTelephonyStartMode & ")" ElseIf strTelephonyState = strTelephonyBaselineState3 And strTelephonyStartMode = strTelephonyBaselineStartMode3 Then chk5_10.Checked = True chk5_10.Text = chk5_10.Text & " (Telephony:" & strTelephonyState & "/" & strTelephonyStartMode & ")" Else chk5_10.Text = chk5_10.Text & " (Telephony:" & strTelephonyState & "/" & strTelephonyStartMode & ") (Initial: )" End If ' Windows Services End. ' Network Configuration Checks: If intSubnetLocated = 1 And intGatewayLocated = 1 And intIPAddressLocated = 1 Then chk2_9.Checked = True chk2_9.Text = chk2_9.Text & " (Found: All settings)" Else chk2_9.Text = chk2_9.Text & " (Missing: Some settings)" End If If intIPAddressLocated = 1 Then Label1.Text = " (Found: IP Address config)" Else Label1.Text = " (Not Found: IP Address config) (Initial: )" End If If intSubnetLocated = 1 Then Label2.Text = " (Found: Subnet Mask config)" Else Label2.Text = " (Not Found: Subnet Mask config) (Initial: )" End If If intGatewayLocated = 1 Then Label3.Text = " (Found: Gateway config)" Else Label3.Text = " (Not Found: Gateway config) (Initial: )" End If If intDomainLocated = 1 Then Label8.Text = " (Found: DNS Suffix config)" Label45.Text = " (Found: DNS Suffix config)" Else Label8.Text = " (Not Found: DNS Suffix config) (Initial: )" Label45.Text = " (Not Found: DNS Suffix config) (Initial: )" End If If intDNS1Located = 1 Then Label4.Text = " (Found: DNS1 config)" Else Label4.Text = " (Not Found: DNS1 config) (Initial: )" End If If intDNS2Located = 1 Then Label5.Text = " (Found: DNS2 config)" Else Label5.Text = " (Not Found: DNS2 config) (Initial: )" End If If intDNS3Located = 1 Then Label6.Text = " (Found: DNS3 config)" Else Label7.Text = " (Not Found: DNS3 config)" End If If intRegistrationEnabled = 1 Then Label9.Text = " (Found: Registration enabled)" Else Label9.Text = " (Not Found: Registration enabled) (Initial: )" End If If intRegistrationEnabled = 1 And intDNS3Located = 1 And intDNS2Located = 1 And intDNS1Located = 1 And intDomainLocated = 1 Then chk2_10.Checked = True chk2_10.Text = chk2_10.Text & " (Found: All settings)" Else chk2_10.Text = chk2_10.Text & " (Not Found: All settings)" End If If intWINS1Located = 1 Then Label10.Text = " (Found: WINS Address 1)" Else Label10.Text = " (Not Found: WINS Address 1) (Initial: )" End If If intWINS2Located = 1 Then Label11.Text = " (Found: WINS Address 2)" Else Label11.Text = " (Not Found: WINS Address 2) (Initial: )" End If If intUncheckLMHostLookup = 1 Then Label12.Text = " (Found: Enable LMHOST Disabled)" Else Label12.Text = " (Not Found: Enable LMHOST Setting enabled) (Initial: )" End If If intNBTEnabled = 1 Then Label13.Text = " (Found: NBT Enabled)" Else Label13.Text = " (Not Found: NBT Disabled) (Initial: )" End If If intNBTEnabled = 1 And intUncheckLMHostLookup = 1 And intWINS1Located = 1 And intWINS2Located = 1 Then chk2_11.Checked = True chk2_11.Text = chk2_11.Text & " (Found: All settings)" Else chk2_11.Text = chk2_11.Text & " (Not Found: All settings)" End If If chk2_11.Checked = True And chk2_10.Checked = True And chk2_9.Checked = True Then chk2_8.Checked = True chk2_8.Text = chk2_8.Text & " (Found: All settings)" Else chk2_8.Text = chk2_8.Text & " (Not Found: Missing settings)" End If If intSharingType = 1 And intStartSharing = 1 Then chk2_7.Checked = True chk2_7.Text = chk2_7.Text & " (Found: Sharing on & enabled)" Else chk2_7.Text = chk2_7.Text & " (Not Found: Sharing config) (Initial: )" End If If strLargeSysCache = "0" And strPriorityControl = "38" Then Label47.Text = Label47.Text & " 
(Found: [Applications]/Background Services)
(Found: [Programs]/System Cache)" ElseIf strLargeSysCache <> "0" And strPriorityControl = "38" Then Label47.Text = Label47.Text & " 
(Found: [Applications]/Background Services)
(Not Found: Programs/[System Cache]) (Initial: )" ElseIf strLargeSysCache = "0" And strPriorityControl <> "38" Then Label47.Text = Label47.Text & " 
(Not Found: Applications/[Background Services])
(Found: [Programs]/System Cache) (Initial: )" Else Label47.Text = Label47.Text & " 
(Not Found: Applications/[Background Services])
(Not Found: Programs/[System Cache])
 (Initial: )" End If If strLargeSysCache = "0" And strPriorityControl = "38" And intDomainLocated = 1 And intPageFileSizeChecked = 1 Then chk5_4.Checked = True End If ' LOG FILE CHECKS__________________________________________________________ If intAppEventMaxSize = 1 Then Label53.Text = " 
(Found: " & Decimal.Round((uInt32AppLogMaxSize / 1024), 0) & "kb/" & uInt32AppLogMaxSize & "b, Spec: " & Decimal.Round((strAppEventLogMaxSizeValue / 1024), 0) & "kb/" & strAppEventLogMaxSizeValue & "b)" Else Label53.Text = " 
(Not Found: " & Decimal.Round((uInt32AppLogMaxSize / 1024), 0) & "kb/" & uInt32AppLogMaxSize & "b, Spec: " & Decimal.Round((strAppEventLogMaxSizeValue / 1024), 0) & "kb/" & strAppEventLogMaxSizeValue & "b) (Initial: )" End If If intAppEventLogFileSizeZero = 1 Then Label55.Text = " (Found: Current: " & AppLogFileSize & " bytes)" Else Label55.Text = " (Not Found: Current: " & AppLogFileSize & " bytes) (Initial: )" End If If intAppEventLogFileOverwrite = 1 Then Label54.Text = " (Found: Overwrite Method)" Else Label54.Text = " (Not Found: Overwrite Method) (Initial: )" End If If intAppEventMaxSize = 1 And intAppEventLogFileSizeZero = 1 And intAppEventLogFileOverwrite = 1 Then intAppEventLogCheck = 1 End If ' Security If intSecEventMaxSize = 1 Then Label56.Text = " 
(Found: " & Decimal.Round((uInt32SecLogMaxSize / 1024), 0) & "kb/" & uInt32SecLogMaxSize & "b, Spec: " & Decimal.Round((strSecEventLogMaxSizeValue / 1024), 0) & "kb/" & strSecEventLogMaxSizeValue & "b)" Else Label56.Text = " 
(Not Found: " & Decimal.Round((uInt32SecLogMaxSize / 1024), 0) & "kb/" & uInt32SecLogMaxSize & "b, Spec: " & Decimal.Round((strSecEventLogMaxSizeValue / 1024), 0) & "kb/" & strSecEventLogMaxSizeValue & "b) (Initial: )" End If If intSecEventLogFileSizeZero = 1 Then Label58.Text = " (Found: Current: " & SecLogFileSize & " bytes)" Else Label58.Text = " (Not Found: Current: " & SecLogFileSize & " bytes) (Initial: )" End If If intSecEventLogFileOverwrite = 1 Then Label57.Text = " (Found: Overwrite Method)" Else Label57.Text = " (Not Found: Overwrite Method) (Initial: )" End If If intSecEventMaxSize = 1 And intSecEventLogFileSizeZero = 1 And intSecEventLogFileOverwrite = 1 Then intSecEventLogCheck = 1 End If ' System If intSysEventMaxSize = 1 Then Label59.Text = " 
(Found: " & Decimal.Round((uInt32SysLogMaxSize / 1024), 0) & "kb/" & uInt32SysLogMaxSize & "b, Spec: " & Decimal.Round((strSysEventLogMaxSizeValue / 1024), 0) & "kb/" & strSysEventLogMaxSizeValue & "b)" Else Label59.Text = " 
(Not Found: " & Decimal.Round((uInt32SysLogMaxSize / 1024), 0) & "kb/" & uInt32SysLogMaxSize & "b, Spec: " & Decimal.Round((strSysEventLogMaxSizeValue / 1024), 0) & "kb/" & strSysEventLogMaxSizeValue & "b) (Initial: )" End If If intSysEventLogFileSizeZero = 1 Then Label61.Text = " (Found: Current: " & SysLogFileSize & " bytes)" Else Label61.Text = " (Not Found: Current: " & SysLogFileSize & " bytes) (Initial: )" End If If intSysEventLogFileOverwrite = 1 Then Label60.Text = " (Found: Overwrite Method)" Else Label60.Text = " (Not Found: Overwrite Method) (Initial: )" End If If intSysEventMaxSize = 1 And intSysEventLogFileSizeZero = 1 And intSysEventLogFileOverwrite = 1 Then intSysEventLogCheck = 1 End If If intAppEventLogCheck = 1 And intSecEventLogCheck = 1 And intSysEventLogCheck = 1 Then chk5_5.Checked = True chk5_5.Text = chk5_5.Text & " (Found: All settings)" Else chk5_5.Text = chk5_5.Text & " (Not Found: Missing settings)" End If 'SecEdit Settings If intSecedAdminName = 1 Then chk4_1.Checked = True chk4_1.Text = chk4_1.Text & "
(Found: " & strSecedAdminName & ")" Else chk4_1.Text = chk4_1.Text & "
(Not Found: " & strSecedAdminName & ") (Initial: )" End If If intSecedGuestName = 1 And intSecedEnableGuest = 1 Then chk4_2.Checked = True chk4_2.Text = chk4_2.Text & "
(Found: " & strSecedGuestName & " & " & strSecedEnableGuest & ")" Else chk4_2.Text = chk4_2.Text & "
(Not Found: " & strSecedGuestName & " & " & strSecedEnableGuest & ") (Initial: )" End If If intSecedRemoteSD = 1 Then Label35.Text = "
(Found: " & strSecedRemoteSD & ")" Else Label35.Text = "
(Not Found: " & strSecedRemoteSD & ") (Initial: )" End If If intSecedAdminSD = 1 Then Label36.Text = "
(Found: " & strSecedAdminSD & ")" Else Label36.Text = "
(Not Found: " & strSecedAdminSD & ") (Initial: )" End If If intSecedRemoteSD = 1 And intSecedAdminSD = 1 Then chk4_7.Checked = True chk4_7.Text = chk4_7.Text & " (Found: All settings)" Else chk4_7.Text = chk4_7.Text & " (Not Found: Missing settings)" End If ' Restrict Access If intAllocateCDROMs = 1 Then Label37.Text = " (Found: AllocateCDROMs)" Else Label37.Text = " (Not Found: AllocateCDROMs)" End If If intAllocateFloppies = 1 Then Label38.Text = " (Found: AllocateFloppies)" Else Label38.Text = " (Not Found: AllocateFloppies) (Initial: )" End If If intDontDisplayLastUserName = 1 Then Label39.Text = " (Found: " & strDontDisplayLastUserName & ")" Else Label39.Text = " (Not Found: " & strDontDisplayLastUserName & ") (Initial: )" End If If intLSASAM = 1 Then Label43.Text = " (Found: " & strLSASAM & ")" Else Label43.Text = " (Not Found: " & strLSASAM & ") (Initial: )" End If If intLSASAM = 1 And intDontDisplayLastUserName = 1 And intAllocateCDROMs = 1 And intAllocateFloppies = 1 And intLegalNoticeText = 1 And intLegalNoticeCap = 1 Then chk4_8.Checked = True chk4_8.Text = chk4_8.Text & " (Found: All settings)" Else chk4_8.Text = chk4_8.Text & " (Not Found: Missing settings)" End If 'Server Specific If intBootTimeOutCheck = 1 Then Label50.Text = " (Found: 10 seconds)" Else Label50.Text = " (Not Found: 10 seconds) (Initial: )" End If If intKernelMemDump = 1 Then Label52.Text = " (Found: Kernel Memory Dump)" Else Label52.Text = " (Not Found: Kernel Memory Dump) (Initial: )" End If If intAutoRestartOn = 1 Then Label51.Text = " (Found: Auto Restart on Failure)" Else Label51.Text = " (Not Found: Auto Restart on Failure) (Initial: )" End If If intBootTimeOutCheck = 1 And intKernelMemDump = 1 And intAutoRestartOn = 1 Then Label49.Text = " (Found: All settings)" Else Label49.Text = " (Not Found: Missing settings)" End If If intServernameMatches = 1 Then Label44.Text = " (Found: Server name match)" Else Label44.Text = " (Not Found: Server name does not match) (Initial: )" End If ' Net ID Info If intNetIDShowNetIcon = 1 Then chk2_6.Checked = True chk2_6.Text = chk2_6.Text & " (Found: Icon displayed)" Else chk2_6.Text = chk2_6.Text & " (Not Found: Icon not found) (Initial: )" End If If intDuplexSettingCheck = 1 Then chk2_5.Checked = True chk2_5.Text = chk2_5.Text & " (Found: 100 Full Duplex setting)" Else chk2_5.Text = chk2_5.Text & " (Not Found: 100 Full Duplex setting) (Initial: )" End If If chk2_5.Checked = True And chk2_6.Checked = True And chk2_7.Checked = True And chk2_8.Checked = True Then chk2_4.Checked = True chk2_4.Text = chk2_4.Text & " (Found: All settings)" Else chk2_4.Text = chk2_4.Text & " (Not Found: Missing settings)" End If If intPageFileSizeChecked = 1 Then Label48.Text = " 
(Found: Pagefile:" & ActualPageFileSize & "GB/Memory:" & ActualMemorySize & "GB (" & Decimal.Round((ActualPageFileSize / ActualMemorySize), 2) & " >= 1.5))" Else Label48.Text = " 
(Not Found: Pagefile:" & ActualPageFileSize & "GB/Memory:" & ActualMemorySize & "GB (" & Decimal.Round((ActualPageFileSize / ActualMemorySize), 2) & " < 1.5)) (Initial: )" End If If strCreateAdminLabel <> "" Then chk4_3.Checked = True chk4_3.Text = chk4_3.Text & "
Found:" & strCreateAdminLabel Else chk4_3.Text = chk4_3.Text & " (Not Found: Admin Group) (Initial: )" End If If strTSMBackupSchedState <> "" Or intFileNameTSMOpFile = 1 Then chk3_9.Checked = True chk3_9.Text = chk3_9.Text & " (Found: TSM: " & strTSMBackupSchedState & "/" & strTSMBackupSchedStartMode & ")" & strTSMOpLabel Else If intFileNameBackupExec = 1 Then chk3_9.Checked = True chk3_9.Text = chk3_9.Text & " (Found: Backup Exec)" Else chk3_9.Text = chk3_9.Text & " (Not Found: TSM or Backup Exec) (Initial: )" End If End If Catch ex As Exception Response.Write("Error on output") End Try lbl_error.Text = lbl_error.Text & "(AutoScan Completed.)" End Sub Public Sub ResetCheckBoxText() chk1_1.Text = strChk1_1 chk1_2.Text = strChk1_2 chk1_3.Text = strChk1_3 chk1_4.Text = strChk1_4 chk1_5.Text = strChk1_5 chk1_6.Text = strChk1_6 chk1_7.Text = strChk1_7 chk1_8.Text = strChk1_8 chk2_1.Text = strChk2_1 chk2_2.Text = strChk2_2 chk2_3.Text = strChk2_3 chk2_4.Text = strChk2_4 chk2_5.Text = strChk2_5 chk2_6.Text = strChk2_6 chk2_7.Text = strChk2_7 chk2_8.Text = strChk2_8 chk2_9.Text = strChk2_9 chk2_10.Text = strChk2_10 chk2_11.Text = strChk2_11 chk3_1.Text = strChk3_1 chk3_2.Text = strChk3_2 chk3_3.Text = strChk3_3 chk3_4.Text = strChk3_4 chk3_5.Text = strChk3_5 chk3_7.Text = strChk3_7 chk3_8.Text = strChk3_8 chk3_9.Text = strChk3_9 chk4_1.Text = strChk4_1 chk4_2.Text = strChk4_2 chk4_3.Text = strChk4_3 chk4_4.Text = strChk4_4 chk4_5.Text = strChk4_5 chk4_6.Text = strChk4_6 chk4_7.Text = strChk4_7 chk4_8.Text = strChk4_8 chk5_1.Text = strChk5_1 chk5_2.Text = strChk5_2 chk5_3.Text = strChk5_3 chk5_4.Text = strChk5_4 chk5_5.Text = strChk5_5 chk5_6.Text = strChk5_6 chk5_7.Text = strChk5_7 chk5_8.Text = strChk5_8 chk5_9.Text = strChk5_9 chk5_10.Text = strChk5_10 lbl_error.Text = "" Label1.Text = "" Label2.Text = "" Label3.Text = "" Label4.Text = "" Label5.Text = "" Label6.Text = "" Label7.Text = "" Label8.Text = "" Label9.Text = "" Label10.Text = "" Label11.Text = "" Label12.Text = "" Label13.Text = "" Label14.Text = "" Label15.Text = "" Label16.Text = "" Label17.Text = "" Label18.Text = "" Label19.Text = "" Label20.Text = "" Label21.Text = "" Label22.Text = "" Label23.Text = "" Label24.Text = "" Label25.Text = "" Label26.Text = "" Label27.Text = "" Label28.Text = "" Label29.Text = "" Label30.Text = "" Label31.Text = "" Label32.Text = "" Label33.Text = "" Label34.Text = "" Label35.Text = "" Label36.Text = "" Label37.Text = "" Label38.Text = "" Label39.Text = "" Label40.Text = "" Label41.Text = "" Label42.Text = "" Label43.Text = "" Label44.Text = "" Label45.Text = "" Label46.Text = "" Label47.Text = "" Label48.Text = "" Label49.Text = "" Label50.Text = "" Label51.Text = "" Label52.Text = "" Label53.Text = "" Label54.Text = "" Label55.Text = "" Label56.Text = "" Label57.Text = "" Label58.Text = "" Label59.Text = "" Label60.Text = "" Label61.Text = "" Label62.Text = "" Label63.Text = "" Label64.Text = "" Label65.Text = "" Label66.Text = "" Label67.Text = "" Label68.Text = "" Label69.Text = "" Label70.Text = "" Label71.Text = "" Label72.Text = "" Label73.Text = "" Label74.Text = "" Label75.Text = "" Label76.Text = "" Label77.Text = "" Label78.Text = "" Label79.Text = "" Label80.Text = "" Label81.Text = "" Label82.Text = "" Label83.Text = "" Label84.Text = "" Label85.Text = "" End Sub Public Sub ClearCheckBoxes() chk1_1.Checked = False chk1_2.Checked = False chk1_3.Checked = False chk1_4.Checked = False chk1_5.Checked = False chk1_6.Checked = False chk1_7.Checked = False chk1_8.Checked = False chk2_1.Checked = False chk2_2.Checked = False chk2_3.Checked = False chk2_4.Checked = False chk2_5.Checked = False chk2_6.Checked = False chk2_7.Checked = False chk2_8.Checked = False chk2_9.Checked = False chk2_10.Checked = False chk2_11.Checked = False chk3_1.Checked = False chk3_2.Checked = False chk3_3.Checked = False chk3_4.Checked = False chk3_5.Checked = False chk3_7.Checked = False chk3_8.Checked = False chk3_9.Checked = False chk4_1.Checked = False chk4_2.Checked = False chk4_3.Checked = False chk4_4.Checked = False chk4_5.Checked = False chk4_6.Checked = False chk4_7.Checked = False chk4_8.Checked = False chk5_1.Checked = False chk5_2.Checked = False chk5_3.Checked = False chk5_4.Checked = False chk5_5.Checked = False chk5_6.Checked = False chk5_7.Checked = False chk5_8.Checked = False chk5_9.Checked = False chk5_10.Checked = False End Sub Public Sub EnableCheckBoxes() chk1_1.Enabled = True chk1_2.Enabled = True chk1_3.Enabled = True chk1_4.Enabled = True chk1_5.Enabled = True chk1_6.Enabled = True chk1_7.Enabled = True chk1_8.Enabled = True chk2_1.Enabled = True chk2_2.Enabled = True chk2_3.Enabled = True chk2_4.Enabled = True chk2_5.Enabled = True chk2_6.Enabled = True chk2_7.Enabled = True chk2_8.Enabled = True chk2_9.Enabled = True chk2_10.Enabled = True chk2_11.Enabled = True chk3_1.Enabled = True chk3_2.Enabled = True chk3_3.Enabled = True chk3_4.Enabled = True chk3_5.Enabled = True chk3_7.Enabled = True chk3_8.Enabled = True chk3_9.Enabled = True chk4_1.Enabled = True chk4_2.Enabled = True chk4_3.Enabled = True chk4_4.Enabled = True chk4_5.Enabled = True chk4_6.Enabled = True chk4_7.Enabled = True chk4_8.Enabled = True chk5_1.Enabled = True chk5_2.Enabled = True chk5_3.Enabled = True chk5_4.Enabled = True chk5_5.Enabled = True chk5_6.Enabled = True chk5_7.Enabled = True chk5_8.Enabled = True chk5_9.Enabled = True chk5_10.Enabled = True End Sub Public Sub DisableCheckBoxes() chk1_1.Enabled = False chk1_2.Enabled = False chk1_3.Enabled = False chk1_4.Enabled = False chk1_5.Enabled = False chk1_6.Enabled = False chk1_7.Enabled = False chk1_8.Enabled = False chk2_1.Enabled = False chk2_2.Enabled = False chk2_3.Enabled = False chk2_4.Enabled = False chk2_5.Enabled = False chk2_6.Enabled = False chk2_7.Enabled = False chk2_8.Enabled = False chk2_9.Enabled = False chk2_10.Enabled = False chk2_11.Enabled = False chk3_1.Enabled = False chk3_2.Enabled = False chk3_3.Enabled = False chk3_4.Enabled = False chk3_5.Enabled = False chk3_7.Enabled = False chk3_8.Enabled = False chk3_9.Enabled = False chk4_1.Enabled = False chk4_2.Enabled = False chk4_3.Enabled = False chk4_4.Enabled = False chk4_5.Enabled = False chk4_6.Enabled = False chk4_7.Enabled = False chk4_8.Enabled = False chk5_1.Enabled = False chk5_2.Enabled = False chk5_3.Enabled = False chk5_4.Enabled = False chk5_5.Enabled = False chk5_6.Enabled = False chk5_7.Enabled = False chk5_8.Enabled = False chk5_9.Enabled = False chk5_10.Enabled = False End Sub Public Sub SetCheckedData(ByVal x As String) Dim QryValues As String ' This is a GNDN subroutine for now (goes nowhere/does nothing) 'Previous functionality: 'If IsNumeric(x) Then 'qry = "SELECT * FROM tbl_svrbuild_chkbuild WHERE svrid = " & func.CheckString(x, "") 'qry = "SELECT * FROM tbl_svrbuild_chkbuild WHERE svrid = " & x 'da.SelectCommand = New SqlClient.SqlCommand(qry) 'da.SelectCommand.Connection = conn 'ds.Clear() 'da.Fill(ds) ' If ds.Tables(0).Rows.Count > 0 Then ' If ds.Tables(0).Rows(0).Item("chk1_1") = 1 Then ' chk1_1.Checked = True ' Else ' chk1_1.Checked = False ' End If ' If ds.Tables(0).Rows(0).Item("chk1_2") = 1 Then ' chk1_2.Checked = True ' Else ' chk1_2.Checked = False ' End If ' etc... ' End If End Sub Public Sub SubmitEnableVerify() 'sdf If chk1_1.Checked Then intFormComplete = intFormComplete + 1 End If If chk1_2.Checked Then intFormComplete = intFormComplete + 1 End If If chk1_3.Checked Then intFormComplete = intFormComplete + 1 End If If chk1_4.Checked Then intFormComplete = intFormComplete + 1 End If If chk1_5.Checked Then intFormComplete = intFormComplete + 1 End If If chk1_6.Checked Then intFormComplete = intFormComplete + 1 End If If chk1_7.Checked Then intFormComplete = intFormComplete + 1 End If If chk1_8.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_1.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_2.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_3.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_4.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_5.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_6.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_7.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_8.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_9.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_10.Checked Then intFormComplete = intFormComplete + 1 End If If chk2_11.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_1.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_2.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_3.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_4.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_5.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_7.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_8.Checked Then intFormComplete = intFormComplete + 1 End If If chk3_9.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_1.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_2.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_3.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_4.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_5.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_6.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_7.Checked Then intFormComplete = intFormComplete + 1 End If If chk4_8.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_1.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_2.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_3.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_4.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_5.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_6.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_7.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_8.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_9.Checked Then intFormComplete = intFormComplete + 1 End If If chk5_10.Checked Then intFormComplete = intFormComplete + 1 End If Response.Write(intFormComplete) If intFormComplete = 45 Then 'Server.Transfer("pg_Confirm.aspx?id=" & Request.Form.Item("lst_servers") & "&action=BUILD") Response.Write("
Found all checks") Else lbl_error.Text = "[ Please correct the errors below. ]" End If End Sub Public Function qryStringUpdate(ByVal x As String) Dim QryValues As String If chk1_1.Checked Then QryValues = "chk1_1=1," Else QryValues = "chk1_1=0," End If If chk1_2.Checked Then QryValues = QryValues & "chk1_2=1," Else QryValues = QryValues & "chk1_2=0," End If If chk1_3.Checked Then QryValues = QryValues & "chk1_3=1," Else QryValues = QryValues & "chk1_3=0," End If If chk1_4.Checked Then QryValues = QryValues & "chk1_4=1," Else QryValues = QryValues & "chk1_4=0," End If If chk1_5.Checked Then QryValues = QryValues & "chk1_5=1," Else QryValues = QryValues & "chk1_5=0," End If If chk1_6.Checked Then QryValues = QryValues & "chk1_6=1," Else QryValues = QryValues & "chk1_6=0," End If If chk1_7.Checked Then QryValues = QryValues & "chk1_7=1," Else QryValues = QryValues & "chk1_7=0," End If If chk1_8.Checked Then QryValues = QryValues & "chk1_8=1," Else QryValues = QryValues & "chk1_8=0," End If If chk2_1.Checked Then QryValues = QryValues & "chk2_1=1," Else QryValues = QryValues & "chk2_1=0," End If If chk2_2.Checked Then QryValues = QryValues & "chk2_2=1," Else QryValues = QryValues & "chk2_2=0," End If If chk2_3.Checked Then QryValues = QryValues & "chk2_3=1," Else QryValues = QryValues & "chk2_3=0," End If If chk2_4.Checked Then QryValues = QryValues & "chk2_4=1," Else QryValues = QryValues & "chk2_4=0," End If If chk2_5.Checked Then QryValues = QryValues & "chk2_5=1," Else QryValues = QryValues & "chk2_5=0," End If If chk2_6.Checked Then QryValues = QryValues & "chk2_6=1," Else QryValues = QryValues & "chk2_6=0," End If If chk2_7.Checked Then QryValues = QryValues & "chk2_7=1," Else QryValues = QryValues & "chk2_7=0," End If If chk2_8.Checked Then QryValues = QryValues & "chk2_8=1," Else QryValues = QryValues & "chk2_8=0," End If If chk2_9.Checked Then QryValues = QryValues & "chk2_9=1," Else QryValues = QryValues & "chk2_9=0," End If If chk2_10.Checked Then QryValues = QryValues & "chk2_10=1," Else QryValues = QryValues & "chk2_10=0," End If If chk2_11.Checked Then QryValues = QryValues & "chk2_11=1," Else QryValues = QryValues & "chk2_11=0," End If If chk3_1.Checked Then QryValues = QryValues & "chk3_1=1," Else QryValues = QryValues & "chk3_1=0," End If If chk3_2.Checked Then QryValues = QryValues & "chk3_2=1," Else QryValues = QryValues & "chk3_2=0," End If If chk3_3.Checked Then QryValues = QryValues & "chk3_3=1," Else QryValues = QryValues & "chk3_3=0," End If If chk3_4.Checked Then QryValues = QryValues & "chk3_4=1," Else QryValues = QryValues & "chk3_4=0," End If If chk3_5.Checked Then QryValues = QryValues & "chk3_5=1," Else QryValues = QryValues & "chk3_5=0," End If If chk3_7.Checked Then QryValues = QryValues & "chk3_7=1," Else QryValues = QryValues & "chk3_7=0," End If If chk3_8.Checked Then QryValues = QryValues & "chk3_8=1," Else QryValues = QryValues & "chk3_8=0," End If If chk3_9.Checked Then QryValues = QryValues & "chk3_9=1," Else QryValues = QryValues & "chk3_9=0," End If If chk4_1.Checked Then QryValues = QryValues & "chk4_1=1," Else QryValues = QryValues & "chk4_1=0," End If If chk4_2.Checked Then QryValues = QryValues & "chk4_2=1," Else QryValues = QryValues & "chk4_2=0," End If If chk4_3.Checked Then QryValues = QryValues & "chk4_3=1," Else QryValues = QryValues & "chk4_3=0," End If If chk4_4.Checked Then QryValues = QryValues & "chk4_4=1," Else QryValues = QryValues & "chk4_4=0," End If If chk4_5.Checked Then QryValues = QryValues & "chk4_5=1," Else QryValues = QryValues & "chk4_5=0," End If If chk4_6.Checked Then QryValues = QryValues & "chk4_6=1," Else QryValues = QryValues & "chk4_6=0," End If If chk4_7.Checked Then QryValues = QryValues & "chk4_7=1," Else QryValues = QryValues & "chk4_7=0," End If If chk4_8.Checked Then QryValues = QryValues & "chk4_8=1," Else QryValues = QryValues & "chk4_8=0," End If If chk5_1.Checked Then QryValues = QryValues & "chk5_1=1," Else QryValues = QryValues & "chk5_1=0," End If If chk5_2.Checked Then QryValues = QryValues & "chk5_2=1," Else QryValues = QryValues & "chk5_2=0," End If If chk5_3.Checked Then QryValues = QryValues & "chk5_3=1," Else QryValues = QryValues & "chk5_3=0," End If If chk5_4.Checked Then QryValues = QryValues & "chk5_4=1," Else QryValues = QryValues & "chk5_4=0," End If If chk5_5.Checked Then QryValues = QryValues & "chk5_5=1," Else QryValues = QryValues & "chk5_5=0," End If If chk5_6.Checked Then QryValues = QryValues & "chk5_6=1," Else QryValues = QryValues & "chk5_6=0," End If If chk5_7.Checked Then QryValues = QryValues & "chk5_7=1," Else QryValues = QryValues & "chk5_7=0," End If If chk5_8.Checked Then QryValues = QryValues & "chk5_8=1," Else QryValues = QryValues & "chk5_8=0," End If If chk5_9.Checked Then QryValues = QryValues & "chk5_9=1," Else QryValues = QryValues & "chk5_9=0," End If If chk5_10.Checked Then QryValues = QryValues & "chk5_10=1" Else QryValues = QryValues & "chk5_10=0" End If QryValues = "UPDATE tbl_svrbuild_autochk SET " & QryValues & " WHERE svrid = " & x Return QryValues End Function Public Function qryStringInsert(ByVal x As String) Dim QryValues As String If chk1_1.Checked Then QryValues = "1," Else QryValues = "0," End If If chk1_2.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk1_3.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk1_4.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk1_5.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk1_6.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk1_7.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk1_8.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_1.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_2.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_3.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_4.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_5.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_6.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_7.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_8.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_9.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_10.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk2_11.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_1.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_2.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_3.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_4.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_5.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_7.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_8.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk3_9.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_1.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_2.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_3.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_4.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_5.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_6.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_7.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk4_8.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_1.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_2.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_3.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_4.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_5.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_6.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_7.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_8.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_9.Checked Then QryValues = QryValues & "1," Else QryValues = QryValues & "0," End If If chk5_10.Checked Then QryValues = QryValues & "1" Else QryValues = QryValues & "0" End If QryValues = "INSERT INTO tbl_svrbuild_autochk (svrid,chk1_1,chk1_2,chk1_3,chk1_4,chk1_5,chk1_6,chk1_7,chk1_8," _ & "chk2_1,chk2_2,chk2_3,chk2_4,chk2_5,chk2_6,chk2_7,chk2_8,chk2_9,chk2_10,chk2_11,chk3_1,chk3_2,chk3_3,chk3_4," _ & "chk3_5,chk3_7,chk3_8,chk3_9,chk4_1,chk4_2,chk4_3,chk4_4,chk4_5,chk4_6,chk4_7,chk4_8,chk5_1," _ & "chk5_2,chk5_3,chk5_4,chk5_5,chk5_6,chk5_7,chk5_8,chk5_9,chk5_10) VALUES(" & Request.Form.Item("lst_servers") & "," & QryValues & ")" Return QryValues End Function Private Sub btn_Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Submit.Click Dim intCountChecks As Integer = 0 Response.Write("Server ID:") If chk1_1.Checked Then chk1_1.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_1.ForeColor = System.Drawing.Color.Red End If If chk1_2.Checked Then chk1_2.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_2.ForeColor = System.Drawing.Color.Red End If If chk1_3.Checked Then chk1_3.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_3.ForeColor = System.Drawing.Color.Red End If If chk1_4.Checked Then chk1_4.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_4.ForeColor = System.Drawing.Color.Red End If If chk1_5.Checked Then chk1_5.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_5.ForeColor = System.Drawing.Color.Red End If If chk1_6.Checked Then chk1_6.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_6.ForeColor = System.Drawing.Color.Red End If If chk1_7.Checked Then chk1_7.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_7.ForeColor = System.Drawing.Color.Red End If If chk1_8.Checked Then chk1_8.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk1_8.ForeColor = System.Drawing.Color.Red End If If chk2_1.Checked Then chk2_1.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_1.ForeColor = System.Drawing.Color.Red End If If chk2_2.Checked Then chk2_2.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_2.ForeColor = System.Drawing.Color.Red End If If chk2_3.Checked Then chk2_3.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_3.ForeColor = System.Drawing.Color.Red End If If chk2_4.Checked Then chk2_4.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_4.ForeColor = System.Drawing.Color.Red End If If chk2_5.Checked Then chk2_5.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_5.ForeColor = System.Drawing.Color.Red End If If chk2_6.Checked Then chk2_6.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_6.ForeColor = System.Drawing.Color.Red End If If chk2_7.Checked Then chk2_7.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_7.ForeColor = System.Drawing.Color.Red End If If chk2_8.Checked Then chk2_8.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_8.ForeColor = System.Drawing.Color.Red End If If chk2_9.Checked Then chk2_9.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_9.ForeColor = System.Drawing.Color.Red End If If chk2_10.Checked Then chk2_10.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_10.ForeColor = System.Drawing.Color.Red End If If chk2_11.Checked Then chk2_11.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk2_11.ForeColor = System.Drawing.Color.Red End If If chk3_1.Checked Then chk3_1.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_1.ForeColor = System.Drawing.Color.Red End If If chk3_2.Checked Then chk3_2.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_2.ForeColor = System.Drawing.Color.Red End If If chk3_3.Checked Then chk3_3.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_3.ForeColor = System.Drawing.Color.Red End If If chk3_4.Checked Then chk3_4.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_4.ForeColor = System.Drawing.Color.Red End If If chk3_5.Checked Then chk3_5.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_5.ForeColor = System.Drawing.Color.Red End If If chk3_7.Checked Then chk3_7.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_7.ForeColor = System.Drawing.Color.Red End If If chk3_8.Checked Then chk3_8.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_8.ForeColor = System.Drawing.Color.Red End If If chk3_9.Checked Then chk3_9.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk3_9.ForeColor = System.Drawing.Color.Red End If If chk4_1.Checked Then chk4_1.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_1.ForeColor = System.Drawing.Color.Red End If If chk4_2.Checked Then chk4_2.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_2.ForeColor = System.Drawing.Color.Red End If If chk4_3.Checked Then chk4_3.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_3.ForeColor = System.Drawing.Color.Red End If If chk4_4.Checked Then chk4_4.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_4.ForeColor = System.Drawing.Color.Red End If If chk4_5.Checked Then chk4_5.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_5.ForeColor = System.Drawing.Color.Red End If If chk4_6.Checked Then chk4_6.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_6.ForeColor = System.Drawing.Color.Red End If If chk4_7.Checked Then chk4_7.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_7.ForeColor = System.Drawing.Color.Red End If If chk4_8.Checked Then chk4_8.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk4_8.ForeColor = System.Drawing.Color.Red End If If chk5_1.Checked Then chk5_1.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_1.ForeColor = System.Drawing.Color.Red End If If chk5_2.Checked Then chk5_2.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_2.ForeColor = System.Drawing.Color.Red End If If chk5_3.Checked Then chk5_3.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_3.ForeColor = System.Drawing.Color.Red End If If chk5_4.Checked Then chk5_4.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_4.ForeColor = System.Drawing.Color.Red End If If chk5_5.Checked Then chk5_5.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_5.ForeColor = System.Drawing.Color.Red End If If chk5_6.Checked Then chk5_6.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_6.ForeColor = System.Drawing.Color.Red End If If chk5_7.Checked Then chk5_7.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_7.ForeColor = System.Drawing.Color.Red End If If chk5_8.Checked Then chk5_8.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_8.ForeColor = System.Drawing.Color.Red End If If chk5_9.Checked Then chk5_9.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_9.ForeColor = System.Drawing.Color.Red End If If chk5_10.Checked Then chk5_10.ForeColor = System.Drawing.Color.Black intCountChecks = intCountChecks + 1 Else chk5_10.ForeColor = System.Drawing.Color.Red End If Response.Write(intCountChecks) If intCountChecks = 45 Then 'Server.Transfer("pg_Confirm.aspx?id=" & Request.Form.Item("lst_servers") & "&action=BUILD") Else lbl_error.Text = "[ Please correct the errors below. ]" End If End Sub Private Sub btn_Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Cancel.Click Server.Transfer("pg_Main.aspx") End Sub Private Sub btn_Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Save.Click If lst_servers.SelectedValue <> "" Then conn.ConnectionString = "Data Source=;Initial Catalog=;User Id=; Password=" conn.Open() qry = "SELECT * FROM tbl_svrbuild_autochk WHERE svrid = " & func.CheckString(Trim(Request.Form.Item("lst_servers")), "") 'qry = "SELECT * FROM tbl_svrbuild_autochk WHERE svrid = " & (Trim(Request.Form.Item("lst_servers"))) da.SelectCommand = New SqlClient.SqlCommand(qry) da.SelectCommand.Connection = conn ds.Clear() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then qry = qryStringUpdate(Request.Form.Item("lst_servers")) 'Response.Write(qry) 'Response.End() da.UpdateCommand = New SqlClient.SqlCommand(qry) da.UpdateCommand.Connection = conn da.UpdateCommand.ExecuteNonQuery() Else qry = qryStringInsert(Request.Form.Item("lst_servers")) 'Response.Write(qry) 'Response.End() da.InsertCommand = New SqlClient.SqlCommand(qry) da.InsertCommand.Connection = conn da.InsertCommand.ExecuteNonQuery() End If End If End Sub End Class