'Phase 5, discover is CLR is loaded to SQL Server instance
Call DiscoverIsSqlClrLoaded()
'Phase 6, record the time
' NOTE: Temp workaround - We should update the Version Number below everytime we rev the MP Version.
dim mpVersion
mpVersion = "1.0.49.0"
oInst.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ManagementPackVersion$", mpVersion
'Begin: Edited by v-jobzha
'Phase 7, discover Max Workers Config
Call DiscoverMaxWorkersConfig()
'Begin: Edited by v-jobzha
'---------------------------------------------------------------------------
'Discovers the max workers config are AUTOMATIC/MANUAL
'---------------------------------------------------------------------------
Sub DiscoverMaxWorkersConfig()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
query = "SELECT [value_in_use] FROM sys.configurations WHERE [name] = N'max worker threads'"
Dim oResults
Set oResults = oConnection.Execute(query)
Dim strMaxWorkersConfig,intMaxWorkersConfig
If (oResults.State = 1) Then
intMaxWorkersConfig = CDbl(oResults("value_in_use"))
If intMaxWorkersConfig = 0 Then
strMaxWorkersConfig = "AUTOMATIC"
ElseIf intMaxWorkersConfig > 0 Then
strMaxWorkersConfig = "MANUAL"
End If
End If
oResults.Close()
oConnection.Close()
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MaxWorkersConfig$", strMaxWorkersConfig)
End Sub
'---------------------------------------------------------------------------
'Discovers the Scheduler Count value
'---------------------------------------------------------------------------
Sub DiscoverSchedulerCount()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
query = "SELECT [scheduler_count] FROM sys.dm_os_sys_info"
Dim oResults
Set oResults = oConnection.Execute(query)
Dim intSchedulerCount
If (oResults.State = 1) Then
intSchedulerCount = CDbl(oResults("scheduler_count"))
End If
oResults.Close()
oConnection.Close()
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/SchedulerCount$", intSchedulerCount)
End Sub
'End: Edited by v-jobzha
'Begin: Edited by v-taliu
'---------------------------------------------------------------------------
'Discovers the NUMA Nodes Total,Numa Nodes Used
'---------------------------------------------------------------------------
Sub DiscoverNUMANodesInfo()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
Dim oResults
Dim arrResults
query ="select count(node_id) as count from sys.dm_os_nodes where node_state_desc <> N'ONLINE DAC' union all select count(node_id) from sys.dm_os_nodes where node_state_desc NOT IN ( N'OFFLINE', N'ONLINE DAC')"
Set oResults = oConnection.Execute(query)
If Not oResults.EOF Then
arrResults= oResults.GetRows()
End If
Set oResults = Nothing
Set arrResults = Nothing
oConnection.Close()
End Sub
'---------------------------------------------------------------------------
'Discovers the Processor Groups
'---------------------------------------------------------------------------
Sub DiscoverProcessorGroupsInfo()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
Dim rowCount
Dim oResults
query = "select count(name) from syscolumns where id = OBJECT_ID('sys.dm_os_nodes') and name = 'processor_group'"
Set oResults = oConnection.Execute(query)
If Not oResults.EOF Then
rowCount = oResults(0)
End If
If rowCount = 1 Then
query = "select count(distinct processor_group) from sys.dm_os_nodes"
Set oResults = oConnection.Execute(query)
If Not oResults.EOF Then
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ProcessorGroupsTotal$", CInt(oResults(0)))
End If
End If
Set oResults = Nothing
oConnection.Close()
End Sub
'End: Edited by v-taliu
'---------------------------------------------------------------------------
'Discovers the list of trace flags that are enabled.
'---------------------------------------------------------------------------
Sub DiscoverTraceFlags()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
query = "DBCC TRACESTATUS ( -1 )"
Dim oResults
Set oResults = oConnection.Execute(query)
Dim traceFlags
' Check if the recordset is open. DBCC doesnt return a recordset if there are no results.
' State = 1 (adStateOpen) indicates that the recordset is open.
If (oResults.State = 1) Then
Do While NOT oResults.EOF
If (oResults("Status") = "1") AND (oResults("Global") = "1") Then
If NOT IsEmpty(traceFlags) Then
traceFlags = traceFlags & ", "
End If
traceFlags = traceFlags & oResults("TraceFlag")
End If
oResults.MoveNext
Loop
End If
'The following lines were modified by ericzha for new config point SQLMemoryModel
Dim SQLMemoryModel, int1, int2, colSum
SQLMemoryModel = "CONVENTIONAL"
If int1 >0 And InStr(1, traceFlags, "834", 1) >0 Then
SQLMemoryModel = "LARGE_PAGES"
ElseIf int2 >0 And InStr(1, traceFlags, "834", 1) = 0 Then
SQLMemoryModel = "LOCKED_PAGES"
End If
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/SQLMemoryModel$", SQLMemoryModel)
'End of modification by ericzha
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/TraceFlagsEnabled$", traceFlags)
End Sub
'--------------------------------------------------------------------------------------------
' Check if .NET CLR is loaded to SQL Server instance
'--------------------------------------------------------------------------------------------
Sub DiscoverIsSqlClrLoaded()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim clrLoaded
clrLoaded = False
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open(connString)
Dim query
query = "select COUNT(*) from sys.dm_os_loaded_modules where description like '%.NET Framework%'"
Dim oResults
Set oResults = oConnection.Execute(query)
If (oResults.State = 1) Then
Dim dotNetCount
If Not oResults.EOF Then
dotNetCount = oResults(0)
If (dotNetCount > 0) Then
clrLoaded = True
End If
End If
End If
' Add new property to discovery
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/IsSqlClrLoaded$", clrLoaded)
End Sub
'--------------------------------------------------------------------------------------------
' Get the current value used for memory_to_reserve: [Current -g value]
'--------------------------------------------------------------------------------------------
Sub GetMemoryReserveSize(startupParameters)
Dim s ' Prepared string with startup parameters
s = LCase(";" + startupParameters)
Dim sizeRes
sizeRes = 256 ' Default value is 256
Dim memoryParam
memoryParam = InStr(s, ";-g")
If (memoryParam > 0) Then
' Start and End position of memory reserver value
Dim startPos, endPos
startPos = memoryParam + 3
endPos = InStr(startPos, s, ";")
If Not (endPos > 0) Then endPos = Len(s) + 1
Dim size
size = Mid(s, startPos, (endPos - startPos))
If (Not IsNull(size)) And IsNumeric(size) Then
sizeRes = CInt(size)
End If
End If
'Add property to Discovery Data
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MemoryReserveSize$", sizeRes)
End Sub
'---------------------------------------------------------------------------
'Add a property to the discovery data if not null
'---------------------------------------------------------------------------
Sub AddPropertyIfNotNull(ByRef discData, prop, value)
if NOT isNull(value) Then
Call discData.AddProperty(prop, value)
End if
End Sub
'---------------------------------------------------------------------------
'This function discovers the InstanceId property
'---------------------------------------------------------------------------
Sub DiscoverInstanceId(dbPlatform, strInstanceName)
Dim oReg
Dim strSqlPath, strInstanceId
Const HKEY_LOCAL_MACHINE = &H80000002
strSqlPath = "SOFTWARE\Microsoft\Microsoft SQL Server"
If dbPlatform = "x86" Then
' Get the OS Architecture
Dim colOperatingSystems, objOS, osArchitecture, objWMIService
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOS In colOperatingSystems
If IsNull(objOS) = False Then
osArchitecture = objOS.OSArchitecture
Exit For
End If
Next
If osArchitecture = "64-bit" Then
strSqlPath = "SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server"
End If
End If
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
Call oReg.GetStringValue(HKEY_LOCAL_MACHINE, strSqlPath & "\Instance Names\SQL", strInstanceName, strInstanceId)
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/InstanceId$", strInstanceId)
' Discover the startup parameters.
Dim strParametersKeyPath, arrParameters, arrParameterTypes, strParameterName, strParameterValue
Dim strStartupParameters, i
strParametersKeyPath = strSqlPath & "\" & strInstanceId & "\MSSQLServer\Parameters"
' enum parameter values.
' 0 is success, non-zero is failure.
If oReg.EnumValues(HKEY_LOCAL_MACHINE, strParametersKeyPath, arrParameters, arrParameterTypes) = 0 Then
For i = 0 To UBound(arrParameters)
strParameterName = arrParameters(i)
Call oReg.GetStringValue(HKEY_LOCAL_MACHINE, strParametersKeyPath, strParameterName, strParameterValue)
strStartupParameters = strStartupParameters & strParameterValue & ";"
Next
' Discover MemoryReserverSize after startup parameters discovered
Call GetMemoryReserveSize(strStartupParameters)
End If
' Discover the protocols.
Dim strProtocolPath, strSqlProtocols
Dim dwEnabled, strPipeName
' Discover Named pipeline protocol
strProtocolPath = strSqlPath & "\" & strInstanceID & "\MSSQLServer\SuperSocketNetLib\Np"
Call oReg.GetDWORDValue(HKEY_LOCAL_MACHINE, strProtocolPath, "Enabled", dwEnabled)
Call oReg.GetStringValue(HKEY_LOCAL_MACHINE, strProtocolPath, "PipeName", strPipeName)
strSqlProtocols = "Named Pipes Enabled=" & dwEnabled & ",PipeName=" & strPipeName & ";"
' Discover Shared Memory protocol
strProtocolPath = strSqlPath & "\" & strInstanceID & "\MSSQLServer\SuperSocketNetLib\Sm"
Call oReg.GetDWORDValue(HKEY_LOCAL_MACHINE, strProtocolPath, "Enabled", dwEnabled)
strSqlProtocols = strSqlProtocols & "Shared Memory Enabled=" & dwEnabled & ";"
' Discover TCP/IP protocol
Dim dwKeepAlive, dwListenOnAllIPs
strProtocolPath = strSqlPath & "\" & strInstanceID & "\MSSQLServer\SuperSocketNetLib\TCP"
Call oReg.GetDWORDValue(HKEY_LOCAL_MACHINE, strProtocolPath, "Enabled", dwEnabled)
Call oReg.GetDWORDValue(HKEY_LOCAL_MACHINE, strProtocolPath, "KeepAlive", dwKeepAlive)
Call oReg.GetDWORDValue(HKEY_LOCAL_MACHINE, strProtocolPath, "ListenOnAllIPs", dwListenOnAllIPs)
strSqlProtocols = strSqlProtocols & "TCP/IP Enabled=" & dwEnabled & ",Keep Alive=" & dwKeepAlive & ",ListenOnAllIPs=" & dwListenOnAllIPs
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/SqlProtocols$", strSqlProtocols)
End Sub
'---------------------------------------------------------------------------
'This function discovers the server properties
'---------------------------------------------------------------------------
Sub DiscoverServerProperties()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
query = "SELECT " & _
"SERVERPROPERTY('BuildClrVersion') AS BuildClrVersion, " & _
"SERVERPROPERTY('Collation') AS Collation, " & _
"SERVERPROPERTY('ComparisonStyle') AS ComparisonStyle, " & _
"SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS ComputerNamePhysicalNetBIOS, " & _
"SERVERPROPERTY('EngineEdition') AS EngineEdition, " & _
"CAST(SERVERPROPERTY('IsClustered') AS bit) AS IsClustered, " & _
"CAST(SERVERPROPERTY('IsFullTextInstalled') AS bit) AS IsFullTextInstalled, " & _
"CAST(SERVERPROPERTY('IsIntegratedSecurityOnly') AS bit) AS IsIntegratedSecurityOnly, " & _
"CAST(SERVERPROPERTY('IsSingleUser') AS bit) AS IsSingleUser, " & _
"SERVERPROPERTY('LCID') AS LCID, " & _
"SERVERPROPERTY('NumLicenses') AS NumLicenses, " & _
"SERVERPROPERTY('ProcessID') AS ProcessID, " & _
"SERVERPROPERTY('ProductLevel') AS ProductLevel, " & _
"SERVERPROPERTY('ResourceLastUpdateDateTime') AS ResourceLastUpdateDateTime, " & _
"SERVERPROPERTY('SqlCharSetName') AS SqlCharSetName, " & _
"SERVERPROPERTY('SqlSortOrderName') AS SqlSortOrderName, " & _
"SERVERPROPERTY('FilestreamShareName') AS FilestreamShareName, " & _
"SERVERPROPERTY('FilestreamConfiguredLevel') AS FilestreamConfiguredLevel, " & _
"SERVERPROPERTY('FilestreamEffectiveLevel') AS FilestreamEffectiveLevel, " & _
"SERVERPROPERTY('ProductVersion') as ProductVersion "
Dim oResults
Set oResults = oConnection.Execute(query)
Dim productVersion
productVersion = oResults(19)
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ProductVersion$", productVersion)
Call DiscoverVersion(productVersion)
End If
' query for the list of databases which are not database snapshots
Set oResults = oConnection.Execute("select name, CAST(value as int) as Value, CAST(value_in_use as int) as ValueInUse from sys.configurations")
Do while Not oResults.EOF
Call AddProperties(oInst, oResults)
oResults.MoveNext
Loop
' query max_workers_count and SQLServer_Start_time
Set oResults = oConnection.Execute("SELECT[max_workers_count],[sqlserver_start_time] FROM sys.dm_os_sys_info")
If Not oResults.EOF Then
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MaxWorkersCount$", oResults(0))
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/SqlServerStartTime$", CDate(oResults(1)))
End If
' Query Linked_Servers_Count
Set oResults = oConnection.Execute("select COUNT(*) as linked_servers_count from sys.servers ss where ss.is_linked = 1 and name != @@ServerName")
If Not oResults.EOF Then
Call AddPropertyIfNotNull(oInst, "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/LinkedServersCount$", oResults(0))
End If
End Sub
'---------------------------------------------------------------------------
'This function discovers the version tokens
'Takes version parameter, writes to global oInst discovery instance
'---------------------------------------------------------------------------
Sub DiscoverVersion(Version)
Dim versionTokens, MajorVersion, MinorVersion, BuildNumber, BuildRevisionNumber
versionTokens = Split(Version, "." , -1, 1)
if UBound(versionTokens) >= 0 Then
MajorVersion = versionTokens(0)
End If
if UBound(versionTokens) >= 1 Then
MinorVersion = versionTokens(1)
End If
if UBound(versionTokens) >= 2 Then
BuildNumber = versionTokens(2)
End If
if UBound(versionTokens) >= 3 Then
BuildRevisionNumber = versionTokens(3)
End If
If objFSO.FileExists(strFileName) Then
strFileVersion = objFSO.GetFileVersion(strFileName)
If (Len(strFileVersion) > 0) Then
If (InStr(1, strFileVersion, ".") > 0) Then
arrVersionInfo = Split(strFileVersion, ".")
If UBound(arrVersionInfo) >= 0 Then
intMajor = arrVersionInfo(0)
End If
If UBound(arrVersionInfo) >= 1 Then
lngMinor = arrVersionInfo(1)
End If
If UBound(arrVersionInfo) >= 2 Then
lngBuild = arrVersionInfo(2)
End If
If UBound(arrVersionInfo) >= 3 Then
lngRevision = arrVersionInfo(3)
End If
End If
GetFileVersion = strFileVersion
End If
Else
GetFileVersion = ""
End If
End Function
'---------------------------------------------------------------------------
'This function discovers the platform information either x64 or x32
'it takes no parameters but will write to the global oInst discovery data
'---------------------------------------------------------------------------
Function DiscoverPlatform()
Dim connString
connString = "Provider=SQLOLEDB;Data Source=" + sqlInstance + "; Initial Catalog=master;Integrated Security=SSPI"
Dim oConnection
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open connString
Dim query
query = "exec xp_msver "
Dim oResults, instancePlatform, strPlatform
Set oResults = oConnection.Execute(query)
Do While Not oResults.EOF
If oResults("Name") = "Platform" Then
instancePlatform = oResults("Character_Value")
if InStrRev(instancePlatform,"64") Then
Call oInst.AddProperty("$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/Platform$", "x64")
strPlatform = "x64"
else
Call oInst.AddProperty("$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/Platform$", "x86")
strPlatform = "x86"
End If
Exit Do
End If
oResults.MoveNext
Loop
DiscoverPlatform = strPlatform
End Function
Sub AddProperties(ByRef instance, ByRef oRes)
Dim value, valueInUse, name
name = LCase(oRes(0))
value = oRes(1)
valueInUse = oRes(2)
If IsNull(value) = False Then
With instance
Select Case name
Case "affinity mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AffinityMaskUncommittedValue$", value
Case "affinity i/o mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AffinityIOMaskUncommittedValue$", value
Case "affinity64 mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/Affinity64MaskUncommittedValue$", value
Case "affinity64 i/o mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/Affinity64IOMaskUncommittedValue$", value
Case "network packet size (b)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/NetworkPacketSizeUncommittedValue$", value
Case Else
' Do nothing.
End Select
End With
End If
If IsNull(valueInUse) = False Then
With instance
Select Case name
Case "affinity mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AffinityMask$", valueInUse
Case "affinity i/o mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AffinityIOMask$", valueInUse
Case "affinity64 mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/Affinity64Mask$", valueInUse
Case "affinity64 i/o mask"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/Affinity64IOMask$", valueInUse
Case "recovery interval (min)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/RecoveryInterval$", valueInUse
Case "allow updates"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AllowUpdates$", Cbool(valueInUse)
Case "user connections"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/UserConnections$", valueInUse
Case "locks"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/Locks$", valueInUse
Case "open objects"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/OpenObjects$", valueInUse
Case "fill factor (%)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/FillFactor$", valueInUse
Case "disallow results from triggers"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/DisallowResultsFromTriggers$", Cbool(valueInUse)
Case "nested triggers"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/NestedTriggers$", Cbool(valueInUse)
Case "server trigger recursion"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ServerTriggerRecursionEnabled$", Cbool(valueInUse)
Case "remote access"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/RemoteAccess$", Cbool(valueInUse)
Case "default language"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/DefaultLanguage$", valueInUse
Case "cross db ownership chaining"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/CrossDBOwnershipChaining$", Cbool(valueInUse)
Case "max worker threads"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MaxWorkerThreads$", valueInUse
Case "network packet size (b)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/NetworkPacketSize$", valueInUse
Case "show advanced options"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ShowAdvancedOptions$", Cbool(valueInUse)
Case "remote proc trans"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/RemoteProcTrans$", Cbool(valueInUse)
Case "c2 audit mode"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/C2AuditMode$", Cbool(valueInUse)
Case "default full-text language"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/DefaultFullTextLanguage$", valueInUse
Case "two digit year cutoff"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/TwoDigitYearCutoff$", valueInUse
Case "index create memory (kb)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/IndexCreateMemory$", valueInUse
Case "priority boost"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/PriorityBoost$", Cbool(valueInUse)
Case "remote login timeout (s)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/RemoteLoginTimeout$", valueInUse
Case "remote query timeout (s)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/RemoteQueryTimeout$", valueInUse
Case "cursor threshold"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/CursorThreshold$", valueInUse
Case "set working set size"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/SetWorkingSetSize$", Cbool(valueInUse)
Case "user options"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/UserOptions$", valueInUse
Case "max text repl size (b)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ReplicationMaxTextSize$", valueInUse
Case "media retention"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MediaRetention$", valueInUse
Case "cost threshold for parallelism"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/CostThresholdForParallelism$", valueInUse
Case "max degree of parallelism"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MaxDegreeOfParallelism$", valueInUse
Case "min memory per query (kb)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MinMemoryPerQuery$", valueInUse
Case "query wait (s)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/QueryWait$", valueInUse
Case "min server memory (mb)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MinServerMemory$", valueInUse
Case "max server memory (mb)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/MaxServerMemory$", valueInUse
Case "query governor cost limit"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/QueryGovernorCostLimit$", valueInUse
Case "lightweight pooling"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/LightweightPooling$", Cbool(valueInUse)
Case "scan for startup procs"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ScanForStartupProcedures$", Cbool(valueInUse)
Case "awe enabled"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AweEnabled$", Cbool(valueInUse)
Case "transform noise words"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/TransformNoiseWords$", Cbool(valueInUse)
Case "precompute rank"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/PrecomputeRank$", Cbool(valueInUse)
Case "ph timeout (s)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ProtocolHandlerTimeout$", valueInUse
Case "clr enabled"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/IsSqlClrEnabled$", Cbool(valueInUse)
Case "max full-text crawl range"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/FullTextCrawlRangeMax$", valueInUse
Case "ft notify bandwidth (min)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/FullTextNotifyBandwidthMin$", valueInUse
Case "ft notify bandwidth (max)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/FullTextNotifyBandwidthMax$", valueInUse
Case "ft crawl bandwidth (min)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/FullTextCrawlBandwidthMin$", valueInUse
Case "ft crawl bandwidth (max)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/FullTextCrawlBandwidthMax$", valueInUse
Case "default trace enabled"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/DefaultTraceEnabled$", Cbool(valueInUse)
Case "blocked process threshold (s)"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/BlockedProcessThreshold$", valueInUse
Case "in-doubt xact resolution"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/InDoubtTransactionResolution$", valueInUse
Case "remote admin connections"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/RemoteAdminConnections$", Cbool(valueInUse)
Case "common criteria compliance enabled"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/CommonCriteriaComplianceEnabled$", Cbool(valueInUse)
Case "ekm provider enabled"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ExtensibleKeyManagementEnabled$", Cbool(valueInUse)
Case "backup compression default"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/DefaultBackupCompression$", Cbool(valueInUse)
Case "filestream access level"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/FilestreamAccessLevel$", valueInUse
Case "optimize for ad hoc workloads"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/OptimizeForAdHocWorkloads$", Cbool(valueInUse)
Case "access check cache bucket count"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AccessCheckCacheBucketCount$", valueInUse
Case "access check cache quota"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AccessCheckCacheQuota$", valueInUse
Case "agent xps"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AgentXPsEnabled$", Cbool(valueInUse)
Case "sql mail xps"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/SqlMailXPsEnabled$", Cbool(valueInUse)
Case "database mail xps"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/DatabaseMailEnabled$", Cbool(valueInUse)
Case "smo and dmo xps"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/SmoAndDmoXPsEnabled$", Cbool(valueInUse)
Case "ole automation procedures"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/OleAutomationProceduresEnabled$", Cbool(valueInUse)
Case "xp_cmdshell"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/XPCmdShellEnabled$", Cbool(valueInUse)
Case "ad hoc distributed queries"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/AdHocDistributedQueriesEnabled$", Cbool(valueInUse)
Case "replication xps"
.AddProperty "$MPElement[Name='KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.DBEngine']/ReplicationXPsEnabled$", Cbool(valueInUse)
Case Else
' Do nothing.
End Select
End With
End If
End Sub
'---------------------------------------------------------------------------
'This function returns the UTC time by looking at the time skew in registry
'and correcting for it.
'---------------------------------------------------------------------------
Function GetUTCNow()
Dim localTime, wScriptShell, registryKey, offsetMinutes, utcTime
localTime = now
set wScriptShell = CreateObject("WScript.Shell")
registryKey = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"
offsetMinutes = wScriptShell.RegRead(registryKey)
utcTime = dateadd("n", offsetMinutes, localTime)
GetUTCNow = utcTime
End Function </Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalInSeconds>15399</IntervalInSeconds>
</DataSource>
</Discovery>