You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Test-OLAInstance.ps1
+37-4Lines changed: 37 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -44,11 +44,19 @@ function Test-OLAInstance
44
44
45
45
This will check that the SQL Agent is running on the servers returned from a query against the dbareports, That there are Ola Hallengren maintenance solution agent jobs on Server1,Server2 and Server3. That the
46
46
jobs are enabled and have a schedule but not that they succeeeded. It also checks for the Server1,Server2 and Server3 folders in the share and the existence of the Database Restore Text File
47
+
.EXAMPLE
48
+
$Servers = (Invoke-Sqlcmd -ServerInstance dbareports -Database dbareports -Query "Select Servername from dbo.InstanceList where Environment = 'Development' and Inactive = 0 and NotContactable = 0").ServerName
49
+
Test-OLAInstance -Instance $Servers -Report
50
+
51
+
This will check that the SQL Agent is running on the servers returned from a query against the dbareports, That there are Ola Hallengren maintenance solution agent jobs on Server1,Server2 and Server3. That the
52
+
jobs are enabled and have a schedule but not that they succeeeded. It also checks for the Server1,Server2 and Server3 folders in the share and the existence of the Database Restore Text File
53
+
It will also download the ReportUnit Exe if it doesnt exist and create an HTML Report
47
54
48
55
.NOTES
49
56
AUTHOR - Rob Sewell https://sqldbawithabeard.com @SQLDBAWithBeard
50
57
DATE - 07/09/2016
51
58
#>
59
+
#requires -Version5
52
60
#Requires -ModulesPester
53
61
#Requires -Modulessqlserver
54
62
[CmdletBinding()]
@@ -81,13 +89,13 @@ Param(
81
89
[switch]$NoDatabaseRestoreCheck,
82
90
# A switch to not perform the test if the Job succeeded
0 commit comments