1
- $Checks = ' ErrorLogCount' , ' TraceFlagsNotExpected ' , ' TraceFlagsExpected ' , ' XESessionRunningAllowed ' , ' XESessionRunning ' , ' XESessionRunningAllowed ' , ' XESessionExists' , ' XESessionStopped' , ' XpCmdShellDisabled' , ' WhoIsActiveInstalled' , ' CLREnabled' , ' TwoDigitYearCutoff' , ' MaxDopInstance' , ' ErrorLogCount' , ' ModelDbGrowth' , ' DefaultBackupCompression' , ' SaExist' , ' SaDisabled' , ' SaRenamed' , ' DefaultFilePath' , ' AdHocDistributedQueriesEnabled' , ' AdHocWorkload' , ' DefaultTrace' , ' OleAutomationProceduresDisabled' , ' CrossDBOwnershipChaining' , ' ScanForStartupProceduresDisabled' , ' RemoteAccessDisabled' , ' SQLMailXPsDisabled' , ' DAC' , ' OLEAutomation'
1
+ $Checks = ' ErrorLogCount' , ' XESessionExists' , ' XESessionStopped' , ' XpCmdShellDisabled' , ' WhoIsActiveInstalled' , ' CLREnabled' , ' TwoDigitYearCutoff' , ' MaxDopInstance' , ' ErrorLogCount' , ' ModelDbGrowth' , ' DefaultBackupCompression' , ' SaExist' , ' SaDisabled' , ' SaRenamed' , ' DefaultFilePath' , ' AdHocDistributedQueriesEnabled' , ' AdHocWorkload' , ' DefaultTrace' , ' OleAutomationProceduresDisabled' , ' CrossDBOwnershipChaining' , ' ScanForStartupProceduresDisabled' , ' RemoteAccessDisabled' , ' SQLMailXPsDisabled' , ' DAC' , ' OLEAutomation' , ' ServerNameMatch ' , ' OrphanedFile ' , ' MaxMemory ' , ' NetworkLatency '
2
2
3
3
$Checks = ' XESessionRunningAllowed' , ' XESessionRunning' , ' XESessionRunningAllowed' , ' XESessionExists' , ' XESessionStopped' , ' XpCmdShellDisabled'
4
4
$Checks = ' TraceFlagsNotExpected' , ' TraceFlagsExpected'
5
+ $Checks = ' ServerNameMatch'
6
+ $Checks = ' BackupPathAccess'
7
+ $Checks = ' LatestBuild'
8
+ $Checks = ' NetworkLatency'
9
+ $Checks = ' LinkedServerConnection'
10
+ $Checks = ' MaxMemory'
11
+ $Checks = ' OrphanedFile'
5
12
6
13
Invoke-PerfAndValidateCheck - Checks $Checks
7
14
Invoke-PerfAndValidateCheck - Checks $Checks - PerfDetail
@@ -21,6 +28,18 @@ Set-DbcConfig -Name policy.xevent.requiredrunningsession -Value system_health ,
21
28
Set-DbcConfig - Name policy.xevent.validrunningsession - Value system_health , AlwaysOn_health
22
29
Set-DbcConfig - Name policy.xevent.validrunningsession - Value AlwaysOn_health
23
30
31
+
32
+ $SQLInstances = $dbachecks1 , $dbachecks2 , $dbachecks3 = ' dbachecks1' , ' dbachecks2' , ' dbachecks3'
33
+ $password = ConvertTo-SecureString " dbatools.IO" - AsPlainText - Force
34
+ $cred = New-Object - TypeName System.Management.Automation.PSCredential - ArgumentList " sqladmin" , $password
35
+ $show = ' All'
36
+
24
37
$traci = Trace-Script - ScriptBlock {
25
38
$v5code = Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check $Checks - legacy $false - Show $show - PassThru
26
- }
39
+ }
40
+ $traci1 = Trace-Script - ScriptBlock {
41
+ $v5code = Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check $Checks - legacy $false - Show $show - PassThru
42
+ }
43
+ $traci = Trace-Script - ScriptBlock {
44
+ $v4code = Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check $Checks - legacy $true - Show $show - PassThru
45
+ }
0 commit comments