-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #931 from dataplat/moreinstancechecks
Moreinstancechecks
- Loading branch information
Showing
6 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
$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' | ||
$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' | ||
|
||
$Checks = 'XESessionRunningAllowed','XESessionRunning','XESessionRunningAllowed','XESessionExists','XESessionStopped','XpCmdShellDisabled' | ||
$Checks = 'TraceFlagsNotExpected','TraceFlagsExpected' | ||
$Checks = 'XESessionRunningAllowed', 'XESessionRunning', 'XESessionRunningAllowed', 'XESessionExists', 'XESessionStopped', 'XpCmdShellDisabled' | ||
$Checks = 'TraceFlagsNotExpected', 'TraceFlagsExpected' | ||
|
||
Invoke-PerfAndValidateCheck -Checks $Checks | ||
Invoke-PerfAndValidateCheck -Checks $Checks -PerfDetail | ||
|
||
$containers = $SQLInstances = $dbachecks1, $dbachecks2, $dbachecks3 = 'dbachecks1', 'dbachecks2', 'dbachecks3' | ||
$password = ConvertTo-SecureString "dbatools.IO" -AsPlainText -Force | ||
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "sqladmin", $password | ||
$show = 'All' | ||
|
||
$v4code = Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check $Checks -legacy $true -Show $show -PassThru | ||
# Run v5 checks | ||
$v5code = Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check $Checks -legacy $false -Show $show -PassThru -Verbose | ||
$v5code = Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check $Checks -legacy $false -Show $show -PassThru -Verbose | ||
|
||
Set-DbcConfig -Name policy.xevent.requiredrunningsession -Value system_health | ||
Set-DbcConfig -Name policy.xevent.requiredrunningsession -Value system_health ,AlwaysOn_health | ||
Set-DbcConfig -Name policy.xevent.requiredrunningsession -Value system_health ,AlwaysOn_health,QuickSessionStandard | ||
Set-DbcConfig -Name policy.xevent.requiredrunningsession -Value system_health | ||
Set-DbcConfig -Name policy.xevent.requiredrunningsession -Value system_health , AlwaysOn_health | ||
Set-DbcConfig -Name policy.xevent.requiredrunningsession -Value system_health , AlwaysOn_health, QuickSessionStandard | ||
|
||
Set-DbcConfig -Name policy.xevent.validrunningsession -Value system_health ,AlwaysOn_health | ||
Set-DbcConfig -Name policy.xevent.validrunningsession -Value system_health , AlwaysOn_health | ||
Set-DbcConfig -Name policy.xevent.validrunningsession -Value AlwaysOn_health | ||
|
||
$traci = Trace-Script -ScriptBlock { | ||
$v5code = Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check $Checks -legacy $false -Show $show -PassThru | ||
$v5code = Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check $Checks -legacy $false -Show $show -PassThru | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters