@@ -9,28 +9,47 @@ $cred = New-Object -TypeName System.Management.Automation.PSCredential -Argument
9
9
$show = ' All'
10
10
# endregion
11
11
12
+ # region What do we have?
13
+
14
+ Get-DbaDatabase - SqlInstance $Sqlinstances - SqlCredential $cred - ExcludeSystem | Select-Object Sqlinstance, DatabaseName, Status
15
+
16
+ Get-DbaAgentJob - SqlInstance $Sqlinstances - SqlCredential $cred | Select-Object Sqlinstance, Name, Enabled
17
+ # end region
18
+
19
+ Get-DbaLastBackup - SqlInstance $Sqlinstances - SqlCredential $cred | Select-Object Sqlinstance, Database, LastFullBackup | Format-Table
20
+
12
21
# lets run a couple of tests
13
22
14
- Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check InstanceConnection, DatabaseStatus - legacy $true - Show $show
23
+ # this one shows that the old existing code will work
24
+ # the legacy switch is set to true by default
25
+
26
+ Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check InstanceConnection, DatabaseStatus - Show $show
15
27
16
- # that failed but shouldnt have - set config
28
+ # So lets show the shiny new faster code - legacy switch set to false
29
+
30
+ Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check InstanceConnection, DatabaseStatus - Show $show - legacy $false
31
+
32
+
33
+ # The Authentication check failed but we would like to pass - lets set config
17
34
Set-DbcConfig - Name policy.connection.authscheme - Value SQL
18
35
19
36
# run again
20
37
21
- # what about skips?
38
+ Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check InstanceConnection, DatabaseStatus - Show $show - legacy $false
39
+
40
+ # Hmmm, we know that we will never be able to remote onto these containers so let talk about skipping. No Claudio not that sort of skipping!!
22
41
Set-DbcConfig - Name skip.connection.remoting - Value $true
23
42
24
43
# run again
25
44
26
- # ok now in v5 mode
27
- Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check InstanceConnection, DatabaseStatus - legacy $false - Show $show
45
+ Invoke-DbcCheck - SqlInstance $Sqlinstances - SqlCredential $cred - Check InstanceConnection, DatabaseStatus - Show $show - legacy $false
28
46
29
- # So much quicker !!!
47
+ # So much quicker !!! OK for one check it will be slower. For two it will probably be about the same but for 3 or more it will be quicker. Much quicket. Exrapolate that to 100 checks and a 1000 instances you can see the difference.
30
48
31
- # show our perf test ????
49
+ # This is how we know - We perf test our PowerShell code
50
+ # This will take about 80-100 seconds to run so run first then talk!
32
51
33
- $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 ' , ' PublicPermission'
52
+ $Checks = ' ErrorLogCount' , ' 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' , ' PublicPermission'
34
53
35
54
Invoke-PerfAndValidateCheck - Checks $Checks
36
55
0 commit comments