From fbe57c2a7f3c63ac665a77292ef8331317bb8cb2 Mon Sep 17 00:00:00 2001 From: Blake Drumm Date: Thu, 7 Sep 2023 15:57:29 -0400 Subject: [PATCH] Add version 3.0.0.0 :star: :sparkler: --- SCOM-DW-GroomingGUI.ps1 | 1428 +++++++++++++++++++++------------------ 1 file changed, 761 insertions(+), 667 deletions(-) diff --git a/SCOM-DW-GroomingGUI.ps1 b/SCOM-DW-GroomingGUI.ps1 index c4f1a7a..9bb8275 100644 --- a/SCOM-DW-GroomingGUI.ps1 +++ b/SCOM-DW-GroomingGUI.ps1 @@ -7,7 +7,7 @@ .NOTES -------------------------------------------------------------------------------- Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2023 v5.8.224 - Generated on: 9/7/2023 3:21 PM + Generated on: 9/7/2023 3:57 PM Generated by: blakedrumm -------------------------------------------------------------------------------- .DESCRIPTION @@ -1510,65 +1510,68 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy { $script:DontRemoveGridviewOutput = $false } - Add-JobTracker -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_RetentionDataFunction, $ServerInstance, $Database, $onstartupUser, $textboxCurrentUser.Text -Name 'GetCurrentSettings_Job' ` - -JobScript { - Param ($script, - $DWDBServer, - $DWDBName, - $onstartupUser, - $textboxCurrentUser) #Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - . ([ScriptBlock]::Create($script)) - Run-SQLQuery_RetentionData -Database $DWDBName -ServerInstance $DWDBServer - }` - -CompletedScript { - Param ($Job) - $script:mainGridViewResults = Receive-Job -Job $Job - $progressBarTop.Visible = $false - $buttonConnect.Enabled = $true - if ($script:mainGridViewResults) - { - Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 3 -Message "Results received! - Top Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_RetentionDataFunction" - $buttonImportOverrideMP.Enabled = $true - $buttonRemoveOverrideMP.Enabled = $true - $buttonStagingTables.Enabled = $true - $timer1.Enabled = $true - $labelLastUpdatedTop.Visible = $true - $currentDate = Get-Date - $labelLastUpdatedTop.Text = "Last Updated: $($currentDate.ToShortDateString()) $($currentDate.ToLongTimeString())" - $labelLastUpdatedTop.Tag = $labelLastUpdatedTop.Text - $labelCurrentUTCTime.Visible = $true - $clockImageLabel.Visible = $true - #$mainGridView.Refresh() - $AggregationType_textbox.Enabled = $true - $DaysSelector.Enabled = $true - $buttonResetToDefaults.Enabled = $true - $buttonRunGroomingManually.Enabled = $true - $buttonGroomingHistory.Enabled = $true - $buttonFullHistory.Enabled = $true - $DataSetName_textbox.Enabled = $true - $buttonRefreshDataTop.Enabled = $true - - #Create Columns for Datatable - $gatherNewTable = New-Object System.Data.DataTable - $gatherNewTable.Columns.Add("Dataset Name", "System.String") | Out-Null - $gatherNewTable.Columns.Add("Aggregation Type", "System.String") | Out-Null - $gatherNewTable.Columns.Add("Current Retention (Days)", "System.Int32") | Out-Null - $gatherNewTable.Columns.Add("Is Default Value?", "System.String") | Out-Null - #$gatherNewTable.Columns.Add("Grooming Interval (Minutes)", "System.Int32") | Out-Null - $gatherNewTable.Columns.Add("Current Size (GB)", "System.String") | Out-Null - $gatherNewTable.Columns.Add("Percent of Database (%)", "System.Int32") | Out-Null - foreach ($result in $mainGridViewResults) + $Error.Clear() + try + { + Add-JobTracker -ErrorAction Stop -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_RetentionDataFunction, $ServerInstance, $Database, $onstartupUser, $textboxCurrentUser.Text -Name 'GetCurrentSettings_Job' ` + -JobScript { + Param ($script, + $DWDBServer, + $DWDBName, + $onstartupUser, + $textboxCurrentUser) #Pass any arguments using the ArgumentList parameter + #Important: Do not access form controls from this script block. + . ([ScriptBlock]::Create($script)) + Run-SQLQuery_RetentionData -Database $DWDBName -ServerInstance $DWDBServer + }` + -CompletedScript { + Param ($Job) + $script:mainGridViewResults = Receive-Job -Job $Job + $progressBarTop.Visible = $false + $buttonConnect.Enabled = $true + if ($script:mainGridViewResults) { - if ($result) + Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 3 -Message "Results received! - Top Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_RetentionDataFunction" + $buttonImportOverrideMP.Enabled = $true + $buttonRemoveOverrideMP.Enabled = $true + $buttonStagingTables.Enabled = $true + $timer1.Enabled = $true + $labelLastUpdatedTop.Visible = $true + $currentDate = Get-Date + $labelLastUpdatedTop.Text = "Last Updated: $($currentDate.ToShortDateString()) $($currentDate.ToLongTimeString())" + $labelLastUpdatedTop.Tag = $labelLastUpdatedTop.Text + $labelCurrentUTCTime.Visible = $true + $clockImageLabel.Visible = $true + #$mainGridView.Refresh() + $AggregationType_textbox.Enabled = $true + $DaysSelector.Enabled = $true + $buttonResetToDefaults.Enabled = $true + $buttonRunGroomingManually.Enabled = $true + $buttonGroomingHistory.Enabled = $true + $buttonFullHistory.Enabled = $true + $DataSetName_textbox.Enabled = $true + $buttonRefreshDataTop.Enabled = $true + + #Create Columns for Datatable + $gatherNewTable = New-Object System.Data.DataTable + $gatherNewTable.Columns.Add("Dataset Name", "System.String") | Out-Null + $gatherNewTable.Columns.Add("Aggregation Type", "System.String") | Out-Null + $gatherNewTable.Columns.Add("Current Retention (Days)", "System.Int32") | Out-Null + $gatherNewTable.Columns.Add("Is Default Value?", "System.String") | Out-Null + #$gatherNewTable.Columns.Add("Grooming Interval (Minutes)", "System.Int32") | Out-Null + $gatherNewTable.Columns.Add("Current Size (GB)", "System.String") | Out-Null + $gatherNewTable.Columns.Add("Percent of Database (%)", "System.Int32") | Out-Null + foreach ($result in $mainGridViewResults) { - $datasetName = $result | Select-Object DatasetName -ExpandProperty DatasetName - $aggregationTypeName = $result | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName - [int]$retentionDays = $result | Select-Object MaxDataAgeDays -ExpandProperty MaxDataAgeDays - $row = $gatherNewTable.NewRow(); - $row["Dataset Name"] = $datasetName; - $row["Aggregation Type"] = $aggregationTypeName; - $row["Current Retention (Days)"] = $retentionDays; + if ($result) + { + $datasetName = $result | Select-Object DatasetName -ExpandProperty DatasetName + $aggregationTypeName = $result | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName + [int]$retentionDays = $result | Select-Object MaxDataAgeDays -ExpandProperty MaxDataAgeDays + $row = $gatherNewTable.NewRow(); + $row["Dataset Name"] = $datasetName; + $row["Aggregation Type"] = $aggregationTypeName; + $row["Current Retention (Days)"] = $retentionDays; <# try { @@ -1579,217 +1582,227 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy $row["Grooming Interval (Minutes)"] = 0; } #> - # Check if defaults are set - switch ($datasetName) - { - 'Alert data set' { - switch ($aggregationTypeName) - { - 'Raw data' { - switch ($retentionDays) - { - '400' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + # Check if defaults are set + switch ($datasetName) + { + 'Alert data set' { + switch ($aggregationTypeName) + { + 'Raw data' { + switch ($retentionDays) + { + '400' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } } } - } - 'Client Monitoring data set' { - switch ($aggregationTypeName) - { - 'Daily aggregations' { - switch ($retentionDays) - { - '400' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Client Monitoring data set' { + switch ($aggregationTypeName) + { + 'Daily aggregations' { + switch ($retentionDays) + { + '400' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } - } - 'Raw data' { - switch ($retentionDays) - { - '30' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Raw data' { + switch ($retentionDays) + { + '30' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } } } - } - 'Configuration data set' { - switch ($aggregationTypeName) - { - 'Raw data' { - switch ($retentionDays) - { - '400' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Configuration data set' { + switch ($aggregationTypeName) + { + 'Raw data' { + switch ($retentionDays) + { + '400' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } } } - } - 'Event data set' { - switch ($aggregationTypeName) - { - 'Raw data' { - switch ($retentionDays) - { - '100' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Event data set' { + switch ($aggregationTypeName) + { + 'Raw data' { + switch ($retentionDays) + { + '100' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } } } - } - 'Performance data set' { - switch ($aggregationTypeName) - { - 'Daily aggregations' { - switch ($retentionDays) - { - '400' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Performance data set' { + switch ($aggregationTypeName) + { + 'Daily aggregations' { + switch ($retentionDays) + { + '400' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } - } - 'Hourly aggregations' { - switch ($retentionDays) - { - '400' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Hourly aggregations' { + switch ($retentionDays) + { + '400' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } - } - 'Raw data' { - switch ($retentionDays) - { - '10' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Raw data' { + switch ($retentionDays) + { + '10' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } } } - } - 'State data set' { - switch ($aggregationTypeName) - { - 'Daily aggregations' { - switch ($retentionDays) - { - '400' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'State data set' { + switch ($aggregationTypeName) + { + 'Daily aggregations' { + switch ($retentionDays) + { + '400' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } - } - 'Hourly aggregations' { - switch ($retentionDays) - { - '400' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Hourly aggregations' { + switch ($retentionDays) + { + '400' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } - } - 'Raw data' { - switch ($retentionDays) - { - '180' { - $row["Is Default Value?"] = 'Default'; - } - default { - $row["Is Default Value?"] = 'Non-Default'; + 'Raw data' { + switch ($retentionDays) + { + '180' { + $row["Is Default Value?"] = 'Default'; + } + default { + $row["Is Default Value?"] = 'Non-Default'; + } } } } } + default { + $row["Is Default Value?"] = 'Unknown'; + } } - default { - $row["Is Default Value?"] = 'Unknown'; - } + + $row["Current Size (GB)"] = "$($result | Select-Object SizeGB -ExpandProperty SizeGB) GB"; + $row["Percent of Database (%)"] = [int]$($result | Select-Object PercentOfDW -ExpandProperty PercentOfDW); + $gatherNewTable.Rows.Add($row); } - $row["Current Size (GB)"] = "$($result | Select-Object SizeGB -ExpandProperty SizeGB) GB"; - $row["Percent of Database (%)"] = [int]$($result | Select-Object PercentOfDW -ExpandProperty PercentOfDW); - $gatherNewTable.Rows.Add($row); } + ## - Save changes to the table: + $gatherNewTable.AcceptChanges(); + ## - Display custom data created: + $mainGridView.DataSource = $gatherNewTable; + $mainGridView.Sort($($mainGridView.Columns['Percent of Database (%)']), 'Descending') + $buttonExportCurrentConfiguration.Enabled = $true + $buttonSet.Enabled = $false + #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) + #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + } + else + { + Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! - Top Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_RetentionDataFunction" + Write-Warning "No results received! - Top Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_RetentionDataFunction" + $labelLastUpdatedTop.Visible = $false + $buttonImportOverrideMP.Enabled = $false + $buttonRemoveOverrideMP.Enabled = $false + $buttonGroomingHistory.Enabled = $false + $buttonFullHistory.Enabled = $false } - ## - Save changes to the table: - $gatherNewTable.AcceptChanges(); - ## - Display custom data created: - $mainGridView.DataSource = $gatherNewTable; - $mainGridView.Sort($($mainGridView.Columns['Percent of Database (%)']), 'Descending') - $buttonExportCurrentConfiguration.Enabled = $true + }` + -UpdateScript { + Param ($Job) + #$results = Receive-Job -Job $Job -Keep + $progressBarTop.Visible = $true + $buttonExportCurrentConfiguration.Enabled = $false + $AggregationType_textbox.Enabled = $false + $DaysSelector.Enabled = $false + $buttonResetToDefaults.Enabled = $false $buttonSet.Enabled = $false - #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) - #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) - } - else - { - Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! - Top Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_RetentionDataFunction" - Write-Warning "No results received! - Top Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_RetentionDataFunction" - $labelLastUpdatedTop.Visible = $false - $buttonImportOverrideMP.Enabled = $false - $buttonRemoveOverrideMP.Enabled = $false + $buttonRunGroomingManually.Enabled = $false $buttonGroomingHistory.Enabled = $false $buttonFullHistory.Enabled = $false + $DataSetName_textbox.Enabled = $false + $buttonConnect.Enabled = $false + $buttonImportOverrideMP.Enabled = $false + $buttonRemoveOverrideMP.Enabled = $false + $buttonStagingTables.Enabled = $false + if (!$script:DontRemoveGridviewOutput) + { + $mainGridView.DataSource = $null + } + + $buttonRefreshDataTop.Enabled = $false } - - }` - -UpdateScript { - Param ($Job) - #$results = Receive-Job -Job $Job -Keep - $progressBarTop.Visible = $true - $buttonExportCurrentConfiguration.Enabled = $false - $AggregationType_textbox.Enabled = $false - $DaysSelector.Enabled = $false - $buttonResetToDefaults.Enabled = $false - $buttonSet.Enabled = $false - $buttonRunGroomingManually.Enabled = $false - $buttonGroomingHistory.Enabled = $false - $buttonFullHistory.Enabled = $false - $DataSetName_textbox.Enabled = $false - $buttonConnect.Enabled = $false - $buttonImportOverrideMP.Enabled = $false - $buttonRemoveOverrideMP.Enabled = $false - $buttonStagingTables.Enabled = $false - if (!$script:DontRemoveGridviewOutput) - { - $mainGridView.DataSource = $null - } - - $buttonRefreshDataTop.Enabled = $false + } + catch + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error retrieving current Data Warehouse SQL Data" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) } } @@ -1805,67 +1818,79 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy [string]$Database ) $buttonRefreshDataBottom.Enabled = $false - Add-JobTracker -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_ActualRetentionDaysFunction, $ServerInstance, $Database -Name 'RefreshActualRetentionDays_Job' ` - -JobScript { - Param ($script, - $DWDBServer, - $DWDBName) #Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - . ([ScriptBlock]::Create($script)) - Run-SQLQuery_ActualRetentionDays -Database $DWDBName -ServerInstance $DWDBServer - }` - -CompletedScript { - Param ($Job) - $results = Receive-Job -Job $Job - $currentDate = Get-Date - $labelLastUpdatedBottom.Text = "Last Updated: $($currentDate.ToShortDateString()) $($currentDate.ToLongTimeString())" - $labelLastUpdatedBottom.Tag = $labelLastUpdatedBottom.Text - $labelLastUpdatedBottom.Visible = $true - $progressBarBottom.Visible = $false - if ($results) - { - $buttonRefreshDataBottom.Enabled = $true - Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 3 -Message "Results received! - Bottom Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_ActualRetentionDaysFunction" - $retentionDaysTable = New-Object System.Data.DataTable - $retentionDaysTable.Columns.Add("Aggregation Type", "System.String") | Out-Null - $retentionDaysTable.Columns.Add("Total Days of Data", "System.Int32") | Out-Null - $retentionDaysTable.Columns.Add("Min Date (UTC)", "System.String") | Out-Null - $retentionDaysTable.Columns.Add("Max Date (UTC)", "System.String") | Out-Null - foreach ($result in $results) + try + { + Add-JobTracker -ErrorAction Stop $script:setUserCredentials -ArgumentList $RunSQLQuery_ActualRetentionDaysFunction, $ServerInstance, $Database -Name 'RefreshActualRetentionDays_Job' ` + -JobScript { + Param ($script, + $DWDBServer, + $DWDBName) #Pass any arguments using the ArgumentList parameter + #Important: Do not access form controls from this script block. + . ([ScriptBlock]::Create($script)) + Run-SQLQuery_ActualRetentionDays -Database $DWDBName -ServerInstance $DWDBServer + }` + -CompletedScript { + Param ($Job) + $results = Receive-Job -Job $Job + $currentDate = Get-Date + $labelLastUpdatedBottom.Text = "Last Updated: $($currentDate.ToShortDateString()) $($currentDate.ToLongTimeString())" + $labelLastUpdatedBottom.Tag = $labelLastUpdatedBottom.Text + $labelLastUpdatedBottom.Visible = $true + $progressBarBottom.Visible = $false + if ($results) { - if ($result) + $buttonRefreshDataBottom.Enabled = $true + Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 3 -Message "Results received! - Bottom Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_ActualRetentionDaysFunction" + $retentionDaysTable = New-Object System.Data.DataTable + $retentionDaysTable.Columns.Add("Aggregation Type", "System.String") | Out-Null + $retentionDaysTable.Columns.Add("Total Days of Data", "System.Int32") | Out-Null + $retentionDaysTable.Columns.Add("Min Date (UTC)", "System.String") | Out-Null + $retentionDaysTable.Columns.Add("Max Date (UTC)", "System.String") | Out-Null + foreach ($result in $results) { - $row = $retentionDaysTable.NewRow(); - $row["Aggregation Type"] = $($result | Select-Object 'Type' -ExpandProperty 'Type'); - $row["Total Days of Data"] = [int]$($result | Select-Object DaysOfData -ExpandProperty DaysOfData); - $row["Min Date (UTC)"] = [string]$($result | Select-Object MinDate -ExpandProperty MinDate); - $row["Max Date (UTC)"] = [string]$($result | Select-Object MaxDate -ExpandProperty MaxDate); - $retentionDaysTable.Rows.Add($row); + if ($result) + { + $row = $retentionDaysTable.NewRow(); + $row["Aggregation Type"] = $($result | Select-Object 'Type' -ExpandProperty 'Type'); + $row["Total Days of Data"] = [int]$($result | Select-Object DaysOfData -ExpandProperty DaysOfData); + $row["Min Date (UTC)"] = [string]$($result | Select-Object MinDate -ExpandProperty MinDate); + $row["Max Date (UTC)"] = [string]$($result | Select-Object MaxDate -ExpandProperty MaxDate); + $retentionDaysTable.Rows.Add($row); + } + } + ## - Save changes to the table: + $retentionDaysTable.AcceptChanges(); + ## - Display custom data created: + $actualRetentionDays_GridView.DataSource = $retentionDaysTable; + $actualRetentionDays_GridView.Sort($actualRetentionDays_GridView.Columns['Total Days of Data'], 'Descending') + #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) + #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) } - ## - Save changes to the table: - $retentionDaysTable.AcceptChanges(); - - ## - Display custom data created: - $actualRetentionDays_GridView.DataSource = $retentionDaysTable; - $actualRetentionDays_GridView.Sort($actualRetentionDays_GridView.Columns['Total Days of Data'], 'Descending') - #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) - #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) - } - else - { - Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! - Bottom Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_ActualRetentionDaysFunction" - Write-Warning "No results received! - Bottom Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_ActualRetentionDaysFunction" - $labelLastUpdatedBottom.Visible = $false + else + { + Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! - Bottom Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_ActualRetentionDaysFunction" + Write-Warning "No results received! - Bottom Data Grid`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_ActualRetentionDaysFunction" + $labelLastUpdatedBottom.Visible = $false + } + }` + -UpdateScript { + Param ($Job) + #$results = Receive-Job -Job $Job -Keep + $actualRetentionDays_GridView.DataSource = $null + $progressBarBottom.Visible = $true + $buttonRefreshDataBottom.Enabled = $false } - }` - -UpdateScript { - Param ($Job) - #$results = Receive-Job -Job $Job -Keep - $actualRetentionDays_GridView.DataSource = $null - $progressBarBottom.Visible = $true - $buttonRefreshDataBottom.Enabled = $false + } + catch + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error gathering Data Warehouse SQL Data" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) } } @@ -1880,83 +1905,96 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy Position = 1)] [string]$Database ) - Add-JobTracker -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_GroomingHistoryFunction, $ServerInstance, $Database -Name 'GetGroomingHistory_Job' ` - -JobScript { - Param ($script, - $DWDBServer, - $DWDBName) #Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - . ([ScriptBlock]::Create($script)) - Run-SQLQuery_GroomingHistory -Database $DWDBName -ServerInstance $DWDBServer - }` - -CompletedScript { - Param ($Job) - $buttonFullHistory.Enabled = $true - $labelLastUpdatedGrooming.Visible = $true - $labelLastUpdatedGrooming.Text = "Last Updated: $(Get-Date -Format "MM/dd/yyyy hh:mm:ss tt")" - $timer1.Enabled = $true - $labelLastUpdatedGrooming.Tag = $labelLastUpdatedGrooming.Text - $progressBarGrooming.Visible = $false - $results = Receive-Job -Job $Job - $buttonRefreshGrooming.Enabled = $true - if ($results) - { - $gatherGroomingHistoryTable = New-Object System.Data.DataTable - $gatherGroomingHistoryTable.Columns.Add("Dataset Name", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Aggregation Type", "System.String") | Out-Null - #$gatherGroomingHistoryTable.Columns.Add("Next Aggregation Time (UTC)", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Outstanding Aggregation Count", "System.Int32") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Count Aggregations", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Max Data Age (Days)", "System.Int32") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Last Grooming Time (UTC)", "System.String") | Out-Null - - - foreach ($result in $results) + $Error.Clear() + try + { + Add-JobTracker -ErrorAction Stop -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_GroomingHistoryFunction, $ServerInstance, $Database -Name 'GetGroomingHistory_Job' ` + -JobScript { + Param ($script, + $DWDBServer, + $DWDBName) #Pass any arguments using the ArgumentList parameter + #Important: Do not access form controls from this script block. + . ([ScriptBlock]::Create($script)) + Run-SQLQuery_GroomingHistory -Database $DWDBName -ServerInstance $DWDBServer + }` + -CompletedScript { + Param ($Job) + $buttonFullHistory.Enabled = $true + $labelLastUpdatedGrooming.Visible = $true + $labelLastUpdatedGrooming.Text = "Last Updated: $(Get-Date -Format "MM/dd/yyyy hh:mm:ss tt")" + $timer1.Enabled = $true + $labelLastUpdatedGrooming.Tag = $labelLastUpdatedGrooming.Text + $progressBarGrooming.Visible = $false + $results = Receive-Job -Job $Job + $buttonRefreshGrooming.Enabled = $true + if ($results) { - if ($result) + $gatherGroomingHistoryTable = New-Object System.Data.DataTable + $gatherGroomingHistoryTable.Columns.Add("Dataset Name", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Aggregation Type", "System.String") | Out-Null + #$gatherGroomingHistoryTable.Columns.Add("Next Aggregation Time (UTC)", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Outstanding Aggregation Count", "System.Int32") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Count Aggregations", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Max Data Age (Days)", "System.Int32") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Last Grooming Time (UTC)", "System.String") | Out-Null + + + foreach ($result in $results) { - $row = $gatherGroomingHistoryTable.NewRow(); + if ($result) + { + $row = $gatherGroomingHistoryTable.NewRow(); + + $row["Dataset Name"] = [string]$($result | Select-Object DatasetDefaultName -ExpandProperty DatasetDefaultName); + $row["Aggregation Type"] = [string]$($result | Select-Object AggregationType -ExpandProperty AggregationType); + #$row["Next Aggregation Time (UTC)"] = $($result | Select-Object TimeUTC_NextToAggregate -ExpandProperty TimeUTC_NextToAggregate); + $row["Outstanding Aggregation Count"] = [int]$($result | Select-Object Count_OutstandingAggregations -ExpandProperty Count_OutstandingAggregations); + $row["Count Aggregations"] = [int]$($result | Select-Object Count_Aggregations -ExpandProperty Count_Aggregations); + $row["Max Data Age (Days)"] = [int]$($result | Select-Object MaxDataAgeDays -ExpandProperty MaxDataAgeDays); + $row["Last Grooming Time (UTC)"] = [string]$($result | Select-Object LastGroomingDateTime -ExpandProperty LastGroomingDateTime); + $gatherGroomingHistoryTable.Rows.Add($row); + } - $row["Dataset Name"] = [string]$($result | Select-Object DatasetDefaultName -ExpandProperty DatasetDefaultName); - $row["Aggregation Type"] = [string]$($result | Select-Object AggregationType -ExpandProperty AggregationType); - #$row["Next Aggregation Time (UTC)"] = $($result | Select-Object TimeUTC_NextToAggregate -ExpandProperty TimeUTC_NextToAggregate); - $row["Outstanding Aggregation Count"] = [int]$($result | Select-Object Count_OutstandingAggregations -ExpandProperty Count_OutstandingAggregations); - $row["Count Aggregations"] = [int]$($result | Select-Object Count_Aggregations -ExpandProperty Count_Aggregations); - $row["Max Data Age (Days)"] = [int]$($result | Select-Object MaxDataAgeDays -ExpandProperty MaxDataAgeDays); - $row["Last Grooming Time (UTC)"] = [string]$($result | Select-Object LastGroomingDateTime -ExpandProperty LastGroomingDateTime); - $gatherGroomingHistoryTable.Rows.Add($row); } + ## - Save changes to the table: + $gatherGroomingHistoryTable.AcceptChanges(); + ## - Display custom data created: + $groomingHistoryGridView.DataSource = $gatherGroomingHistoryTable; + $groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Last Grooming Time (UTC)'], 'Descending') + + #$groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Data Last Received Date / Time'], 'Descending') + $labelScreenFrozen.Visible = $false + $labelRowsReturned.Visible = $true + $labelRowsReturned.Text = "Rows Returned: $($results.Count)" + #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) + #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + } + else + { + Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! {3}`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_GroomingHistoryFunction" + Write-Warning "No results received! {3}`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_GroomingHistoryFunction" } - ## - Save changes to the table: - $gatherGroomingHistoryTable.AcceptChanges(); - - ## - Display custom data created: - $groomingHistoryGridView.DataSource = $gatherGroomingHistoryTable; - $groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Last Grooming Time (UTC)'], 'Descending') - #$groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Data Last Received Date / Time'], 'Descending') - $labelScreenFrozen.Visible = $false - $labelRowsReturned.Visible = $true - $labelRowsReturned.Text = "Rows Returned: $($results.Count)" - #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) - #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + }` + -UpdateScript { + Param ($Job) + #$results = Receive-Job -Job $Job -Keep + $labelScreenFrozen.Visible = $true + $labelRowsReturned.Visible = $false + $progressBarGrooming.Visible = $true + $groomingHistoryGridView.DataSource = $null + $buttonRefreshGrooming.Enabled = $false } - else - { - Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! {3}`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_GroomingHistoryFunction" - Write-Warning "No results received! {3}`n User: $($textboxCurrentUser.Text)`n`nPowershell Function:`n$RunSQLQuery_GroomingHistoryFunction" - } - - }` - -UpdateScript { - Param ($Job) - #$results = Receive-Job -Job $Job -Keep - $labelScreenFrozen.Visible = $true - $labelRowsReturned.Visible = $false - $progressBarGrooming.Visible = $true - $groomingHistoryGridView.DataSource = $null - $buttonRefreshGrooming.Enabled = $false + } + catch + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error retrieving Grooming History" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) } } @@ -1971,153 +2009,167 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy Position = 1)] [string]$Database ) - Add-JobTracker -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_GroomingHistoryFullFunction, $ServerInstance, $Database -Name 'GetGroomingHistoryFull_Job' ` - -JobScript { - Param ($script, - $DWDBServer, - $DWDBName) #Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - . ([ScriptBlock]::Create($script)) - Run-SQLQuery_GroomingHistoryFull -Database $DWDBName -ServerInstance $DWDBServer - }` - -CompletedScript { - Param ($Job) - if ($initialRun.count -eq 3) - { - $initialRun = $false - } - $buttonExportCurrentOutput.Enabled = $true - $labelLastUpdatedGrooming.Visible = $true - $labelLastUpdatedGrooming.Text = "Last Updated: $(Get-Date -Format "MM/dd/yyyy hh:mm:ss tt")" - $timer1.Enabled = $true - $labelLastUpdatedGrooming.Tag = $labelLastUpdatedGrooming.Text - $progressBarGrooming.Visible = $false - $results = Receive-Job -Job $Job - $script:groomingHistoryFullGridViewResults = $results - $buttonRefreshGrooming.Enabled = $true - if ($results -and (-not $initialRun)) - { - $data = $results | Select-Object 'Dataset Name' -ExpandProperty 'Dataset Name' -Unique - $array = @() - $array += 'No filter' - foreach ($item in $data) - { - $array += $item - } - Update-ComboBox -ComboBox $comboboxDatasetName -Items $array - $comboboxDatasetName.SelectedIndex = 0 - - $data = $results | Select-Object 'Aggregation Type' -ExpandProperty 'Aggregation Type' -Unique - $array = @() - $array += 'No filter' - foreach ($item in $data) + $Error.clear() + try + { + Add-JobTracker -ErrorAction Stop -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_GroomingHistoryFullFunction, $ServerInstance, $Database -Name 'GetGroomingHistoryFull_Job' ` + -JobScript { + Param ($script, + $DWDBServer, + $DWDBName) #Pass any arguments using the ArgumentList parameter + #Important: Do not access form controls from this script block. + . ([ScriptBlock]::Create($script)) + Run-SQLQuery_GroomingHistoryFull -Database $DWDBName -ServerInstance $DWDBServer + }` + -CompletedScript { + Param ($Job) + if ($initialRun.count -eq 3) { - $array += $item + $initialRun = $false } - Update-ComboBox -ComboBox $comboboxAggregationType -Items $array - $comboboxAggregationType.Text = 'No filter' - - $gatherGroomingHistoryTable = New-Object System.Data.DataTable - $gatherGroomingHistoryTable.Columns.Add("Dataset Name", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Aggregation Type", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Aggregation Date/Time", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Outstanding Aggregation Count", "System.Int32") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Count Aggregations", "System.Int32") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Aggregation Start Time", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Aggregation Duration Seconds", "System.Int32") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Last Aggregation Start Time", "System.String") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Last Aggregation Duration Seconds", "System.Int32") | Out-Null - $gatherGroomingHistoryTable.Columns.Add("Data Last Received Date/Time", "System.String") | Out-Null - - foreach ($result in $results) + $buttonExportCurrentOutput.Enabled = $true + $labelLastUpdatedGrooming.Visible = $true + $labelLastUpdatedGrooming.Text = "Last Updated: $(Get-Date -Format "MM/dd/yyyy hh:mm:ss tt")" + $timer1.Enabled = $true + $labelLastUpdatedGrooming.Tag = $labelLastUpdatedGrooming.Text + $progressBarGrooming.Visible = $false + $results = Receive-Job -Job $Job + $script:groomingHistoryFullGridViewResults = $results + $buttonRefreshGrooming.Enabled = $true + if ($results -and (-not $initialRun)) { - if ($result) + $data = $results | Select-Object 'Dataset Name' -ExpandProperty 'Dataset Name' -Unique + $array = @() + $array += 'No filter' + foreach ($item in $data) { - $ErrorActionPreference = 'Stop' - $row = $gatherGroomingHistoryTable.NewRow(); - - $row["Dataset Name"] = [string]$($result | Select-Object 'Dataset Name' -ExpandProperty 'Dataset Name'); - try { $row["Aggregation Type"] = [string]$($result | Select-Object 'Aggregation Type' -ExpandProperty 'Aggregation Type') } - catch { [DBNull]::Value }; - try - { - $row["Aggregation Date/Time"] = [string]$($result | Select-Object 'Aggregation Date/Time' -ExpandProperty 'Aggregation Date/Time') - } - catch { [DBNull]::Value }; - try - { - $row["Outstanding Aggregation Count"] = [int]$($result | Select-Object 'Outstanding Aggregation Count' -ExpandProperty 'Outstanding Aggregation Count') - } - catch { [DBNull]::Value }; - try - { - $row["Count Aggregations"] = [int]$($result | Select-Object 'Count Aggregations' -ExpandProperty 'Count Aggregations') - } - catch { [DBNull]::Value }; - try - { - $row["Aggregation Start Time"] = [string]$($result | Select-Object 'Aggregation Start Time' -ExpandProperty 'Aggregation Start Time') - } - catch { [DBNull]::Value }; - try - { - $row["Aggregation Duration Seconds"] = [int]$($result | Select-Object 'Aggregation Duration Seconds' -ExpandProperty 'Aggregation Duration Seconds') - } - catch { [DBNull]::Value }; - try - { - $row["Last Aggregation Start Time"] = [string]$($result | Select-Object 'Last Aggregation Start Time' -ExpandProperty 'Last Aggregation Start Time') - } - catch { [DBNull]::Value }; - try - { - $row["Last Aggregation Duration Seconds"] = [string]$($result | Select-Object 'Last Aggregation Duration Seconds' -ExpandProperty 'Last Aggregation Duration Seconds') - } - catch { [DBNull]::Value }; - try + $array += $item + } + Update-ComboBox -ComboBox $comboboxDatasetName -Items $array + $comboboxDatasetName.SelectedIndex = 0 + + $data = $results | Select-Object 'Aggregation Type' -ExpandProperty 'Aggregation Type' -Unique + $array = @() + $array += 'No filter' + foreach ($item in $data) + { + $array += $item + } + Update-ComboBox -ComboBox $comboboxAggregationType -Items $array + $comboboxAggregationType.Text = 'No filter' + + $gatherGroomingHistoryTable = New-Object System.Data.DataTable + $gatherGroomingHistoryTable.Columns.Add("Dataset Name", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Aggregation Type", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Aggregation Date/Time", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Outstanding Aggregation Count", "System.Int32") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Count Aggregations", "System.Int32") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Aggregation Start Time", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Aggregation Duration Seconds", "System.Int32") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Last Aggregation Start Time", "System.String") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Last Aggregation Duration Seconds", "System.Int32") | Out-Null + $gatherGroomingHistoryTable.Columns.Add("Data Last Received Date/Time", "System.String") | Out-Null + + foreach ($result in $results) + { + if ($result) { - $row["Data Last Received Date/Time"] = [string]$($result | Select-Object 'Data Last Received Date/Time' -ExpandProperty 'Data Last Received Date/Time') + $ErrorActionPreference = 'Stop' + $row = $gatherGroomingHistoryTable.NewRow(); + + $row["Dataset Name"] = [string]$($result | Select-Object 'Dataset Name' -ExpandProperty 'Dataset Name'); + try { $row["Aggregation Type"] = [string]$($result | Select-Object 'Aggregation Type' -ExpandProperty 'Aggregation Type') } + catch { [DBNull]::Value }; + try + { + $row["Aggregation Date/Time"] = [string]$($result | Select-Object 'Aggregation Date/Time' -ExpandProperty 'Aggregation Date/Time') + } + catch { [DBNull]::Value }; + try + { + $row["Outstanding Aggregation Count"] = [int]$($result | Select-Object 'Outstanding Aggregation Count' -ExpandProperty 'Outstanding Aggregation Count') + } + catch { [DBNull]::Value }; + try + { + $row["Count Aggregations"] = [int]$($result | Select-Object 'Count Aggregations' -ExpandProperty 'Count Aggregations') + } + catch { [DBNull]::Value }; + try + { + $row["Aggregation Start Time"] = [string]$($result | Select-Object 'Aggregation Start Time' -ExpandProperty 'Aggregation Start Time') + } + catch { [DBNull]::Value }; + try + { + $row["Aggregation Duration Seconds"] = [int]$($result | Select-Object 'Aggregation Duration Seconds' -ExpandProperty 'Aggregation Duration Seconds') + } + catch { [DBNull]::Value }; + try + { + $row["Last Aggregation Start Time"] = [string]$($result | Select-Object 'Last Aggregation Start Time' -ExpandProperty 'Last Aggregation Start Time') + } + catch { [DBNull]::Value }; + try + { + $row["Last Aggregation Duration Seconds"] = [string]$($result | Select-Object 'Last Aggregation Duration Seconds' -ExpandProperty 'Last Aggregation Duration Seconds') + } + catch { [DBNull]::Value }; + try + { + $row["Data Last Received Date/Time"] = [string]$($result | Select-Object 'Data Last Received Date/Time' -ExpandProperty 'Data Last Received Date/Time') + } + catch { [DBNull]::Value }; + $gatherGroomingHistoryTable.Rows.Add($row); + $ErrorActionPreference = 'Continue' } - catch { [DBNull]::Value }; - $gatherGroomingHistoryTable.Rows.Add($row); - $ErrorActionPreference = 'Continue' + } + ## - Save changes to the table: + $gatherGroomingHistoryTable.AcceptChanges(); + ## - Display custom data created: + $groomingHistoryGridView.DataSource = $gatherGroomingHistoryTable; + $groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Aggregation Date/Time'], 'Descending') + + #$groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Data Last Received Date / Time'], 'Descending') + $comboboxDatasetName.Enabled = $true + $comboboxAggregationType.Enabled = $true + $labelScreenFrozen.Visible = $false + $labelRowsReturned.Visible = $true + $labelRowsReturned.Text = "Rows Returned: $($results.Count)" + $datetimepicker1.MinDate = $($script:groomingHistoryFullGridViewResults | Sort-Object 'Aggregation Date/Time' -Descending | Select-Object -Last 1 -Property 'Aggregation Date/Time' -ExpandProperty 'Aggregation Date/Time') + #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) + #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + } + else + { + #Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! {3}" + #Write-Warning "No results received!" + $initialRun += 1 } - ## - Save changes to the table: - $gatherGroomingHistoryTable.AcceptChanges(); - - ## - Display custom data created: - $groomingHistoryGridView.DataSource = $gatherGroomingHistoryTable; - $groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Aggregation Date/Time'], 'Descending') - #$groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Data Last Received Date / Time'], 'Descending') - $comboboxDatasetName.Enabled = $true - $comboboxAggregationType.Enabled = $true - $labelScreenFrozen.Visible = $false - $labelRowsReturned.Visible = $true - $labelRowsReturned.Text = "Rows Returned: $($results.Count)" - $datetimepicker1.MinDate = $($script:groomingHistoryFullGridViewResults | Sort-Object 'Aggregation Date/Time' -Descending | Select-Object -Last 1 -Property 'Aggregation Date/Time' -ExpandProperty 'Aggregation Date/Time') - #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) - #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + }` + -UpdateScript { + Param ($Job) + #$results = Receive-Job -Job $Job -Keep + $labelScreenFrozen.Visible = $true + $labelRowsReturned.Visible = $false + $progressBarGrooming.Visible = $true + $groomingHistoryGridView.DataSource = $null + $buttonRefreshGrooming.Enabled = $false } - else - { - #Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "No results received! {3}" - #Write-Warning "No results received!" - $initialRun += 1 - } - - }` - -UpdateScript { - Param ($Job) - #$results = Receive-Job -Job $Job -Keep - $labelScreenFrozen.Visible = $true - $labelRowsReturned.Visible = $false - $progressBarGrooming.Visible = $true - $groomingHistoryGridView.DataSource = $null - $buttonRefreshGrooming.Enabled = $false } + catch + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error retrieving Full Grooming History" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) + } + } function Get-GroomingStaging @@ -2132,95 +2184,107 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy [string]$Database, [string]$ChartType ) - - Add-JobTracker -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_GroomingStagingFunction, $ServerInstance, $Database -Name 'GetGroomingStaging_Job' ` - -JobScript { - Param ($script, - $DWDBServer, - $DWDBName) #Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - . ([ScriptBlock]::Create($script)) - Run-SQLQuery_GroomingStaging -Database $DWDBName -ServerInstance $DWDBServer - }` - -CompletedScript { - Param ($Job) - $labelLastUpdatedGrooming.Visible = $true - $labelLastUpdatedGrooming.Text = "Last Updated: $(Get-Date -Format "MM/dd/yyyy hh:mm:ss tt")" - $timer1.Enabled = $true - $labelLastUpdatedGrooming.Tag = $labelLastUpdatedGrooming.Text - $progressBarGrooming.Visible = $false - $results = Receive-Job -Job $Job - $buttonRefreshGrooming.Enabled = $true - if ($results) - { - $gatherGroomingStagingTable = New-Object System.Data.DataTable - $gatherGroomingStagingTable.Columns.Add("Table Name", "System.String") | Out-Null - $gatherGroomingStagingTable.Columns.Add("Count", "System.Int32") | Out-Null - - foreach ($result in $results) + $Error.Clear() + try + { + Add-JobTracker -ErrorAction Stop -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_GroomingStagingFunction, $ServerInstance, $Database -Name 'GetGroomingStaging_Job' ` + -JobScript { + Param ($script, + $DWDBServer, + $DWDBName) #Pass any arguments using the ArgumentList parameter + #Important: Do not access form controls from this script block. + . ([ScriptBlock]::Create($script)) + Run-SQLQuery_GroomingStaging -Database $DWDBName -ServerInstance $DWDBServer + }` + -CompletedScript { + Param ($Job) + $labelLastUpdatedGrooming.Visible = $true + $labelLastUpdatedGrooming.Text = "Last Updated: $(Get-Date -Format "MM/dd/yyyy hh:mm:ss tt")" + $timer1.Enabled = $true + $labelLastUpdatedGrooming.Tag = $labelLastUpdatedGrooming.Text + $progressBarGrooming.Visible = $false + $results = Receive-Job -Job $Job + $buttonRefreshGrooming.Enabled = $true + if ($results) { - if ($result) + $gatherGroomingStagingTable = New-Object System.Data.DataTable + $gatherGroomingStagingTable.Columns.Add("Table Name", "System.String") | Out-Null + $gatherGroomingStagingTable.Columns.Add("Count", "System.Int32") | Out-Null + + foreach ($result in $results) + { + if ($result) + { + $row = $gatherGroomingStagingTable.NewRow(); + $tableName = [string]$($result | Select-Object TableName -ExpandProperty TableName) + $row["Table Name"] = $tableName; + $row["Count"] = [int32]$($result | Select-Object Count -ExpandProperty Count); + $gatherGroomingStagingTable.Rows.Add($row); + } + + } + ## - Save changes to the table: + $gatherGroomingStagingTable.AcceptChanges(); + + ## - Display custom data created: + $groomingStagingGridView.DataSource = $gatherGroomingStagingTable; + $groomingStagingGridView.Sort($groomingStagingGridView.Columns['Table Name'], 'Ascending') + + #$groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Data Last Received Date / Time'], 'Descending') + $labelRowsReturned.Visible = $true + $labelRowsReturned.Text = "Rows Returned: $($results.Count)" + #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) + #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + $script:overallCount = @() + + if (-NOT $script:tableList) { - $row = $gatherGroomingStagingTable.NewRow(); - $tableName = [string]$($result | Select-Object TableName -ExpandProperty TableName) - $row["Table Name"] = $tableName; - $row["Count"] = [int32]$($result | Select-Object Count -ExpandProperty Count); - $gatherGroomingStagingTable.Rows.Add($row); + $script:tableList = @() } + $groomingStagingGridView.Rows | ForEach-Object { + $lastTable = $groomingStagingGridView.Rows[$_.Index].Cells['Table Name'].Value + $lastCount = $groomingStagingGridView.Rows[$_.Index].Cells['Count'].Value + $script:tableList += "$lastTable" + $script:overallCount += $lastCount + #Update-Chart -ChartControl $chartCount -XPoints (Get-Date).ToLongTimeString().ToString() -YPoints $lastCount -ChartType 'Line' -XTitle 'Table Name' -YTitle 'Count' -Title 'Staging Count History' + } + #Update-Chart -ChartControl $chartCount -XPoints "$((Get-Date).ToLongTimeString().ToString())" -YPoints $overallCount + $error.Clear() + try + { + Update-Chart -ChartControl $chartCount -XPoints $script:tableList -YPoints $script:overallCount -ChartType $ChartType -ErrorAction Stop + } + catch + { + #Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "Error occurred while updating Staging Table chart:`n$error" + Write-Verbose "Error occurred while updating Staging Table chart:`n$error" + } } - ## - Save changes to the table: - $gatherGroomingStagingTable.AcceptChanges(); - - ## - Display custom data created: - $groomingStagingGridView.DataSource = $gatherGroomingStagingTable; - $groomingStagingGridView.Sort($groomingStagingGridView.Columns['Table Name'], 'Ascending') - - #$groomingHistoryGridView.Sort($groomingHistoryGridView.Columns['Data Last Received Date / Time'], 'Descending') - $labelRowsReturned.Visible = $true - $labelRowsReturned.Text = "Rows Returned: $($results.Count)" - #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) - #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) - $script:overallCount = @() - - if (-NOT $script:tableList) + else { - $script:tableList = @() + Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "Unable to load chart in Grooming Staging window" + Write-Warning "Unable to load chart in Grooming Staging window" } - $groomingStagingGridView.Rows | ForEach-Object { - $lastTable = $groomingStagingGridView.Rows[$_.Index].Cells['Table Name'].Value - $lastCount = $groomingStagingGridView.Rows[$_.Index].Cells['Count'].Value - $script:tableList += "$lastTable" - $script:overallCount += $lastCount - #Update-Chart -ChartControl $chartCount -XPoints (Get-Date).ToLongTimeString().ToString() -YPoints $lastCount -ChartType 'Line' -XTitle 'Table Name' -YTitle 'Count' -Title 'Staging Count History' - } - #Update-Chart -ChartControl $chartCount -XPoints "$((Get-Date).ToLongTimeString().ToString())" -YPoints $overallCount - $error.Clear() - try - { - Update-Chart -ChartControl $chartCount -XPoints $script:tableList -YPoints $script:overallCount -ChartType $ChartType -ErrorAction Stop - } - catch - { - #Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "Error occurred while updating Staging Table chart:`n$error" - Write-Verbose "Error occurred while updating Staging Table chart:`n$error" - } + }` + -UpdateScript { + Param ($Job) + #$results = Receive-Job -Job $Job -Keep + $labelRowsReturned.Visible = $false + $progressBarGrooming.Visible = $true + #$groomingStagingGridView.DataSource = $null + $buttonRefreshGrooming.Enabled = $false } - else - { - Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "Unable to load chart in Grooming Staging window" - Write-Warning "Unable to load chart in Grooming Staging window" - } - - }` - -UpdateScript { - Param ($Job) - #$results = Receive-Job -Job $Job -Keep - $labelRowsReturned.Visible = $false - $progressBarGrooming.Visible = $true - #$groomingStagingGridView.DataSource = $null - $buttonRefreshGrooming.Enabled = $false + } + catch + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error retreiving Grooming Staging" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) } } @@ -2238,38 +2302,50 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy Position = 2)] [string]$DatasetId ) - - Add-JobTracker -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_ManualGroomingFunction, $ServerInstance, $Database, $DatasetId -Name 'RunGroomingManually_Job' ` - -JobScript { - Param ($script, - $DWDBServer, - $DWDBName, - $DatasetId) #Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - . ([ScriptBlock]::Create($script)) - Run-SQLQuery_ManualGrooming -Database $DWDBName -ServerInstance $DWDBServer -DatasetId $DatasetId - }` - -CompletedScript { - Param ($Job) - $results = Receive-Job -Job $Job - $buttonRunGroomingManually.Enabled = $true - if ($results) - { - Write-Host $results - #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) - #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) - } - else - { - Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "Manual Grooming has been executed for the $($DataSetName_textbox.Text) - $($AggregationType_textbox.Text)!" - Write-Output "Manual Grooming has been executed for the $($DataSetName_textbox.Text)!" + $Error.clear() + try + { + Add-JobTracker -ErrorAction Stop -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_ManualGroomingFunction, $ServerInstance, $Database, $DatasetId -Name 'RunGroomingManually_Job' ` + -JobScript { + Param ($script, + $DWDBServer, + $DWDBName, + $DatasetId) #Pass any arguments using the ArgumentList parameter + #Important: Do not access form controls from this script block. + . ([ScriptBlock]::Create($script)) + Run-SQLQuery_ManualGrooming -Database $DWDBName -ServerInstance $DWDBServer -DatasetId $DatasetId + }` + -CompletedScript { + Param ($Job) + $results = Receive-Job -Job $Job + $buttonRunGroomingManually.Enabled = $true + if ($results) + { + Write-Host $results + #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) + #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + } + else + { + Write-EventLog -LogName Application -Source "SCOMDWTool" -EventID 2 -Message "Manual Grooming has been executed for the $($DataSetName_textbox.Text) - $($AggregationType_textbox.Text)!" + Write-Output "Manual Grooming has been executed for the $($DataSetName_textbox.Text)!" + } + + }` + -UpdateScript { + Param ($Job) + #$results = Receive-Job -Job $Job -Keep + $buttonRunGroomingManually.Enabled = $false } - - }` - -UpdateScript { - Param ($Job) - #$results = Receive-Job -Job $Job -Keep - $buttonRunGroomingManually.Enabled = $false + } + catch + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error Running Manual Grooming" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) } } @@ -2292,40 +2368,52 @@ WHERE GroomStoredProcedureName = `'$GroomStoredProcedureName`' AND AggregationTy Position = 4)] [string]$Days ) - - Add-JobTracker -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_SetRetentionDaysFunction, $ServerInstance, $Database, $GroomStoredProcedureName, $AggregationId, $Days -Name 'RunSetRetentionDays_Job' ` - -JobScript { - Param ($script, - $DWDBServer, - $DWDBName, - $GroomStoredProcedureName, - $AggregationId, - $Days) #Pass any arguments using the ArgumentList parameter - #Important: Do not access form controls from this script block. - . ([ScriptBlock]::Create($script)) - Run-SQLQuery_SetRetentionDays -Database $DWDBName -ServerInstance $DWDBServer -GroomStoredProcedureName $GroomStoredProcedureName -AggregationId $AggregationId -Days $Days - }` - -CompletedScript { - Param ($Job) - $results = Receive-Job -Job $Job - $buttonRunGroomingManually.Enabled = $true - if ($results) - { - Add-Type -AssemblyName PresentationCore, PresentationFramework - $ButtonType = [System.Windows.MessageBoxButton]::OK - $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk - $MessageBody = "$results" - $MessageTitle = "Something has happened" - $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) - #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) - #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + $Error.Clear() + try + { + Add-JobTracker -ErrorAction Stop -Credential:$script:setUserCredentials -ArgumentList $RunSQLQuery_SetRetentionDaysFunction, $ServerInstance, $Database, $GroomStoredProcedureName, $AggregationId, $Days -Name 'RunSetRetentionDays_Job' ` + -JobScript { + Param ($script, + $DWDBServer, + $DWDBName, + $GroomStoredProcedureName, + $AggregationId, + $Days) #Pass any arguments using the ArgumentList parameter + #Important: Do not access form controls from this script block. + . ([ScriptBlock]::Create($script)) + Run-SQLQuery_SetRetentionDays -Database $DWDBName -ServerInstance $DWDBServer -GroomStoredProcedureName $GroomStoredProcedureName -AggregationId $AggregationId -Days $Days + }` + -CompletedScript { + Param ($Job) + $results = Receive-Job -Job $Job + $buttonRunGroomingManually.Enabled = $true + if ($results) + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$results" + $MessageTitle = "Something has happened" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) + #Update-ComboBox -ComboBox $DataSetName_textbox -Items $($results | Select-Object DatasetName -ExpandProperty DatasetName -Unique) + #Update-ComboBox -ComboBox $AggregationType_textbox -Items $($results | Select-Object AggregationTypeName -ExpandProperty AggregationTypeName -Unique) + } + + }` + -UpdateScript { + Param ($Job) + #$results = Receive-Job -Job $Job -Keep + $buttonRunGroomingManually.Enabled = $false } - - }` - -UpdateScript { - Param ($Job) - #$results = Receive-Job -Job $Job -Keep - $buttonRunGroomingManually.Enabled = $false + } + catch + { + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error setting retention days" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) } } @@ -4217,7 +4305,12 @@ function Show-MainForm_psf } catch { - Write-Verbose $error + Add-Type -AssemblyName PresentationCore, PresentationFramework + $ButtonType = [System.Windows.MessageBoxButton]::OK + $MessageIcon = [System.Windows.MessageBoxImage]::Asterisk + $MessageBody = "$error" + $MessageTitle = "Experienced error while switching to another user" + $Result = [System.Windows.MessageBox]::Show($MessageBody, $MessageTitle, $ButtonType, $MessageIcon) } } @@ -4383,7 +4476,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBD dWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABNTeXN0 ZW0uRHJhd2luZy5JY29uAgAAAAhJY29uRGF0YQhJY29uU2l6ZQcEAhNTeXN0ZW0uRHJhd2luZy5T aXplAgAAAAIAAAAJAwAAAAX8////E1N5c3RlbS5EcmF3aW5nLlNpemUCAAAABXdpZHRoBmhlaWdo -dAAACAgCAAAAAAAAAAAAAAAPAwAAAHBPAAACAAABAAEAAAAAAAEAIABaTwAAFgAAAIlQTkcNChoK +dAAACAgCAAAAAAEAAAABAAAPAwAAAHBPAAACAAABAAEAAAAAAAEAIABaTwAAFgAAAIlQTkcNChoK AAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAAAFvck5UAc+id5oAAE8USURBVHja7X0HeFzllfZQ AiQUAw6Q3U12/+xmd5OQyLY0mlFxkdVnRjMa1WnSaIqqm+Re5AaWMd2ATTHdGEyz6cbgjhu2wRQD pgmyKYQOoYWafP855xbdmbnTVHxH0vc9z3nGliVZmvu97+nn6HT88MMPP/zwww8//PDDDz/88MMP @@ -4747,6 +4840,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $System_IO_MemoryStream = $null $mainForm.MinimumSize = New-Object System.Drawing.Size(1048, 630) $mainForm.Name = 'mainForm' + $mainForm.Padding = '1, 1, 1, 1' $mainForm.StartPosition = 'CenterScreen' $mainForm.Text = 'System Center Operations Manager - Data Warehouse Grooming Tool' $mainForm.add_FormClosing($mainForm_FormClosing) @@ -4761,7 +4855,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonSetOptimizedDefaults.Enabled = $False $buttonSetOptimizedDefaults.ImageAlign = 'MiddleLeft' $buttonSetOptimizedDefaults.ImageIndex = 5 - $buttonSetOptimizedDefaults.Location = New-Object System.Drawing.Point(774, 403) + $buttonSetOptimizedDefaults.Location = New-Object System.Drawing.Point(775, 402) $buttonSetOptimizedDefaults.Name = 'buttonSetOptimizedDefaults' $buttonSetOptimizedDefaults.Size = New-Object System.Drawing.Size(130, 24) $buttonSetOptimizedDefaults.TabIndex = 40 @@ -4796,7 +4890,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 # $labelConnectingAsUser.AutoSize = $True $labelConnectingAsUser.Font = [System.Drawing.Font]::new('Microsoft Sans Serif', '8.25', [System.Drawing.FontStyle]'Bold') - $labelConnectingAsUser.Location = New-Object System.Drawing.Point(489, 53) + $labelConnectingAsUser.Location = New-Object System.Drawing.Point(490, 54) $labelConnectingAsUser.Name = 'labelConnectingAsUser' $labelConnectingAsUser.Size = New-Object System.Drawing.Size(122, 13) $labelConnectingAsUser.TabIndex = 36 @@ -4811,7 +4905,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonStagingTables.ImageAlign = 'MiddleLeft' $buttonStagingTables.ImageIndex = 10 $buttonStagingTables.ImageList = $imagelist1 - $buttonStagingTables.Location = New-Object System.Drawing.Point(553, 472) + $buttonStagingTables.Location = New-Object System.Drawing.Point(554, 471) $buttonStagingTables.Name = 'buttonStagingTables' $buttonStagingTables.Size = New-Object System.Drawing.Size(106, 53) $buttonStagingTables.TabIndex = 16 @@ -4829,7 +4923,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonRemoveOverrideMP.ImageAlign = 'MiddleLeft' $buttonRemoveOverrideMP.ImageIndex = 11 $buttonRemoveOverrideMP.ImageList = $imagelist1 - $buttonRemoveOverrideMP.Location = New-Object System.Drawing.Point(172, 501) + $buttonRemoveOverrideMP.Location = New-Object System.Drawing.Point(173, 500) $buttonRemoveOverrideMP.Name = 'buttonRemoveOverrideMP' $buttonRemoveOverrideMP.Size = New-Object System.Drawing.Size(152, 24) $buttonRemoveOverrideMP.TabIndex = 13 @@ -4848,7 +4942,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonImportOverrideMP.ImageAlign = 'MiddleLeft' $buttonImportOverrideMP.ImageIndex = 12 $buttonImportOverrideMP.ImageList = $imagelist1 - $buttonImportOverrideMP.Location = New-Object System.Drawing.Point(172, 472) + $buttonImportOverrideMP.Location = New-Object System.Drawing.Point(173, 471) $buttonImportOverrideMP.Name = 'buttonImportOverrideMP' $buttonImportOverrideMP.Size = New-Object System.Drawing.Size(152, 24) $buttonImportOverrideMP.TabIndex = 12 @@ -4860,9 +4954,9 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 # # splitter2 # - $splitter2.Location = New-Object System.Drawing.Point(0, 0) + $splitter2.Location = New-Object System.Drawing.Point(1, 1) $splitter2.Name = 'splitter2' - $splitter2.Size = New-Object System.Drawing.Size(3, 531) + $splitter2.Size = New-Object System.Drawing.Size(3, 529) $splitter2.TabIndex = 0 $splitter2.TabStop = $False # @@ -4874,7 +4968,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonFullHistory.ImageAlign = 'MiddleLeft' $buttonFullHistory.ImageIndex = 9 $buttonFullHistory.ImageList = $imagelist1 - $buttonFullHistory.Location = New-Object System.Drawing.Point(455, 472) + $buttonFullHistory.Location = New-Object System.Drawing.Point(456, 471) $buttonFullHistory.Name = 'buttonFullHistory' $buttonFullHistory.Size = New-Object System.Drawing.Size(92, 53) $buttonFullHistory.TabIndex = 15 @@ -4893,7 +4987,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonExportCurrentConfiguration.ImageAlign = 'MiddleLeft' $buttonExportCurrentConfiguration.ImageIndex = 7 $buttonExportCurrentConfiguration.ImageList = $imagelist1 - $buttonExportCurrentConfiguration.Location = New-Object System.Drawing.Point(849, 63) + $buttonExportCurrentConfiguration.Location = New-Object System.Drawing.Point(848, 64) $buttonExportCurrentConfiguration.MinimumSize = New-Object System.Drawing.Size(165, 23) $buttonExportCurrentConfiguration.Name = 'buttonExportCurrentConfiguration' $buttonExportCurrentConfiguration.Size = New-Object System.Drawing.Size(171, 23) @@ -4907,7 +5001,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 # $labelCurrentUTCTime.AutoSize = $True $labelCurrentUTCTime.ImageIndex = 8 - $labelCurrentUTCTime.Location = New-Object System.Drawing.Point(506, 5) + $labelCurrentUTCTime.Location = New-Object System.Drawing.Point(507, 6) $labelCurrentUTCTime.Name = 'labelCurrentUTCTime' $labelCurrentUTCTime.Size = New-Object System.Drawing.Size(95, 13) $labelCurrentUTCTime.TabIndex = 31 @@ -4917,7 +5011,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 # labelLastUpdatedTop # $labelLastUpdatedTop.AutoSize = $True - $labelLastUpdatedTop.Location = New-Object System.Drawing.Point(126, 73) + $labelLastUpdatedTop.Location = New-Object System.Drawing.Point(127, 74) $labelLastUpdatedTop.Name = 'labelLastUpdatedTop' $labelLastUpdatedTop.Size = New-Object System.Drawing.Size(74, 13) $labelLastUpdatedTop.TabIndex = 29 @@ -4941,7 +5035,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonRefreshDataTop.Enabled = $False $buttonRefreshDataTop.ImageIndex = 0 $buttonRefreshDataTop.ImageList = $imagelist1 - $buttonRefreshDataTop.Location = New-Object System.Drawing.Point(12, 68) + $buttonRefreshDataTop.Location = New-Object System.Drawing.Point(13, 69) $buttonRefreshDataTop.Name = 'buttonRefreshDataTop' $buttonRefreshDataTop.Size = New-Object System.Drawing.Size(108, 23) $buttonRefreshDataTop.TabIndex = 4 @@ -4960,7 +5054,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonGroomingHistory.ImageAlign = 'MiddleLeft' $buttonGroomingHistory.ImageIndex = 5 $buttonGroomingHistory.ImageList = $imagelist1 - $buttonGroomingHistory.Location = New-Object System.Drawing.Point(330, 472) + $buttonGroomingHistory.Location = New-Object System.Drawing.Point(331, 471) $buttonGroomingHistory.Name = 'buttonGroomingHistory' $buttonGroomingHistory.Size = New-Object System.Drawing.Size(119, 53) $buttonGroomingHistory.TabIndex = 14 @@ -4974,7 +5068,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 # $labelLastUpdatedBottom.Anchor = 'Bottom, Left' $labelLastUpdatedBottom.AutoSize = $True - $labelLastUpdatedBottom.Location = New-Object System.Drawing.Point(125, 559) + $labelLastUpdatedBottom.Location = New-Object System.Drawing.Point(126, 558) $labelLastUpdatedBottom.Name = 'labelLastUpdatedBottom' $labelLastUpdatedBottom.Size = New-Object System.Drawing.Size(74, 13) $labelLastUpdatedBottom.TabIndex = 25 @@ -4985,7 +5079,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 # $progressBarBottom.Anchor = 'Bottom, Left' $progressBarBottom.Cursor = 'AppStarting' - $progressBarBottom.Location = New-Object System.Drawing.Point(12, 538) + $progressBarBottom.Location = New-Object System.Drawing.Point(13, 537) $progressBarBottom.Name = 'progressBarBottom' $progressBarBottom.Size = New-Object System.Drawing.Size(108, 10) $progressBarBottom.Style = 'Marquee' @@ -5001,13 +5095,13 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $actualRetentionDays_GridView.AutoSizeColumnsMode = 'Fill' $actualRetentionDays_GridView.ColumnHeadersHeightSizeMode = 'AutoSize' $actualRetentionDays_GridView.EditMode = 'EditProgrammatically' - $actualRetentionDays_GridView.Location = New-Object System.Drawing.Point(11, 583) + $actualRetentionDays_GridView.Location = New-Object System.Drawing.Point(12, 582) $actualRetentionDays_GridView.Name = 'actualRetentionDays_GridView' $actualRetentionDays_GridView.ReadOnly = $True $actualRetentionDays_GridView.RowHeadersWidth = 4 $actualRetentionDays_GridView.SelectionMode = 'FullRowSelect' $actualRetentionDays_GridView.ShowEditingIcon = $False - $actualRetentionDays_GridView.Size = New-Object System.Drawing.Size(1009, 214) + $actualRetentionDays_GridView.Size = New-Object System.Drawing.Size(1007, 214) $actualRetentionDays_GridView.TabIndex = 20 $actualRetentionDays_GridView.add_KeyUp($actualRetentionDays_GridView_KeyUp) # @@ -5019,7 +5113,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonRefreshDataBottom.Enabled = $False $buttonRefreshDataBottom.ImageIndex = 0 $buttonRefreshDataBottom.ImageList = $imagelist1 - $buttonRefreshDataBottom.Location = New-Object System.Drawing.Point(11, 554) + $buttonRefreshDataBottom.Location = New-Object System.Drawing.Point(12, 553) $buttonRefreshDataBottom.Name = 'buttonRefreshDataBottom' $buttonRefreshDataBottom.Size = New-Object System.Drawing.Size(108, 23) $buttonRefreshDataBottom.TabIndex = 21 @@ -5038,7 +5132,7 @@ BBdlP9p1jMRJc/TS8+r4ymx++OGHH3744Ycffvjhhx9++OGHH3744Ycffvjhh5+UO/8f8pssaRO6 $buttonRunGroomingManually.ImageAlign = 'MiddleLeft' $buttonRunGroomingManually.ImageIndex = 6 $buttonRunGroomingManually.ImageList = $imagelist1 - $buttonRunGroomingManually.Location = New-Object System.Drawing.Point(11, 472) + $buttonRunGroomingManually.Location = New-Object System.Drawing.Point(12, 471) $buttonRunGroomingManually.Name = 'buttonRunGroomingManually' $buttonRunGroomingManually.Size = New-Object System.Drawing.Size(155, 53) $buttonRunGroomingManually.TabIndex = 11 @@ -5650,7 +5744,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $buttonDisclaimer.ImageAlign = 'MiddleLeft' $buttonDisclaimer.ImageIndex = 4 $buttonDisclaimer.ImageList = $imagelist1 - $buttonDisclaimer.Location = New-Object System.Drawing.Point(937, 3) + $buttonDisclaimer.Location = New-Object System.Drawing.Point(936, 4) $buttonDisclaimer.Name = 'buttonDisclaimer' $buttonDisclaimer.Size = New-Object System.Drawing.Size(83, 28) $buttonDisclaimer.TabIndex = 3 @@ -5664,7 +5758,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $labelDays.Anchor = 'Bottom, Left' $labelDays.AutoSize = $True $labelDays.Font = [System.Drawing.Font]::new('Microsoft Sans Serif', '8.25', [System.Drawing.FontStyle]'Bold') - $labelDays.Location = New-Object System.Drawing.Point(501, 388) + $labelDays.Location = New-Object System.Drawing.Point(502, 387) $labelDays.Name = 'labelDays' $labelDays.Size = New-Object System.Drawing.Size(39, 13) $labelDays.TabIndex = 14 @@ -5674,7 +5768,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) # $DaysSelector.Anchor = 'Bottom, Left' $DaysSelector.Enabled = $False - $DaysSelector.Location = New-Object System.Drawing.Point(501, 407) + $DaysSelector.Location = New-Object System.Drawing.Point(502, 406) $DaysSelector.Maximum = 99999 $DaysSelector.Name = 'DaysSelector' $DaysSelector.Size = New-Object System.Drawing.Size(120, 20) @@ -5688,7 +5782,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $buttonResetToDefaults.AutoSize = $True $buttonResetToDefaults.Cursor = 'Hand' $buttonResetToDefaults.Enabled = $False - $buttonResetToDefaults.Location = New-Object System.Drawing.Point(627, 405) + $buttonResetToDefaults.Location = New-Object System.Drawing.Point(628, 404) $buttonResetToDefaults.Name = 'buttonResetToDefaults' $buttonResetToDefaults.Size = New-Object System.Drawing.Size(111, 23) $buttonResetToDefaults.TabIndex = 10 @@ -5704,7 +5798,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $buttonExit.ImageAlign = 'MiddleLeft' $buttonExit.ImageKey = 'exit.png' $buttonExit.ImageList = $imagelist1 - $buttonExit.Location = New-Object System.Drawing.Point(927, 486) + $buttonExit.Location = New-Object System.Drawing.Point(926, 485) $buttonExit.Name = 'buttonExit' $buttonExit.Size = New-Object System.Drawing.Size(93, 39) $buttonExit.TabIndex = 20 @@ -5717,7 +5811,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $labelAggregationType.Anchor = 'Bottom, Left' $labelAggregationType.AutoSize = $True $labelAggregationType.Font = [System.Drawing.Font]::new('Microsoft Sans Serif', '8.25', [System.Drawing.FontStyle]'Bold') - $labelAggregationType.Location = New-Object System.Drawing.Point(369, 388) + $labelAggregationType.Location = New-Object System.Drawing.Point(370, 387) $labelAggregationType.Name = 'labelAggregationType' $labelAggregationType.Size = New-Object System.Drawing.Size(111, 13) $labelAggregationType.TabIndex = 10 @@ -5728,7 +5822,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $labelDatasetName.Anchor = 'Bottom, Left' $labelDatasetName.AutoSize = $True $labelDatasetName.Font = [System.Drawing.Font]::new('Microsoft Sans Serif', '8.25', [System.Drawing.FontStyle]'Bold') - $labelDatasetName.Location = New-Object System.Drawing.Point(11, 388) + $labelDatasetName.Location = New-Object System.Drawing.Point(12, 387) $labelDatasetName.Name = 'labelDatasetName' $labelDatasetName.Size = New-Object System.Drawing.Size(91, 13) $labelDatasetName.TabIndex = 8 @@ -5760,13 +5854,13 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $mainGridView.AutoSizeColumnsMode = 'Fill' $mainGridView.ColumnHeadersHeightSizeMode = 'AutoSize' $mainGridView.EditMode = 'EditProgrammatically' - $mainGridView.Location = New-Object System.Drawing.Point(12, 97) + $mainGridView.Location = New-Object System.Drawing.Point(13, 98) $mainGridView.Name = 'mainGridView' $mainGridView.ReadOnly = $True $mainGridView.RowHeadersWidth = 4 $mainGridView.SelectionMode = 'FullRowSelect' $mainGridView.ShowEditingIcon = $False - $mainGridView.Size = New-Object System.Drawing.Size(1008, 281) + $mainGridView.Size = New-Object System.Drawing.Size(1006, 279) $mainGridView.TabIndex = 6 $mainGridView.add_SelectionChanged($mainGridView_SelectionChanged) $mainGridView.add_Click($mainGridView_Click) @@ -5791,7 +5885,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) # $labelDataWarehouseDatabas.AutoSize = $True $labelDataWarehouseDatabas.Font = [System.Drawing.Font]::new('Microsoft Sans Serif', '8.25', [System.Drawing.FontStyle]'Bold') - $labelDataWarehouseDatabas.Location = New-Object System.Drawing.Point(281, 6) + $labelDataWarehouseDatabas.Location = New-Object System.Drawing.Point(282, 7) $labelDataWarehouseDatabas.Name = 'labelDataWarehouseDatabas' $labelDataWarehouseDatabas.Size = New-Object System.Drawing.Size(200, 13) $labelDataWarehouseDatabas.TabIndex = 2 @@ -5801,7 +5895,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) # $labelDataWarehouseDBServe.AutoSize = $True $labelDataWarehouseDBServe.Font = [System.Drawing.Font]::new('Microsoft Sans Serif', '8.25', [System.Drawing.FontStyle]'Bold') - $labelDataWarehouseDBServe.Location = New-Object System.Drawing.Point(87, 6) + $labelDataWarehouseDBServe.Location = New-Object System.Drawing.Point(88, 7) $labelDataWarehouseDBServe.Name = 'labelDataWarehouseDBServe' $labelDataWarehouseDBServe.Size = New-Object System.Drawing.Size(168, 13) $labelDataWarehouseDBServe.TabIndex = 1 @@ -5816,7 +5910,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $buttonSet.ImageAlign = 'MiddleLeft' $buttonSet.ImageIndex = 2 $buttonSet.ImageList = $imagelist1 - $buttonSet.Location = New-Object System.Drawing.Point(667, 472) + $buttonSet.Location = New-Object System.Drawing.Point(666, 471) $buttonSet.Name = 'buttonSet' $buttonSet.Size = New-Object System.Drawing.Size(254, 53) $buttonSet.TabIndex = 19 @@ -5829,7 +5923,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) # $DataSetName_textbox.Anchor = 'Bottom, Left' $DataSetName_textbox.Enabled = $False - $DataSetName_textbox.Location = New-Object System.Drawing.Point(11, 408) + $DataSetName_textbox.Location = New-Object System.Drawing.Point(12, 407) $DataSetName_textbox.Name = 'DataSetName_textbox' $DataSetName_textbox.ReadOnly = $True $DataSetName_textbox.Size = New-Object System.Drawing.Size(351, 20) @@ -5840,7 +5934,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) # $AggregationType_textbox.Anchor = 'Bottom, Left' $AggregationType_textbox.Enabled = $False - $AggregationType_textbox.Location = New-Object System.Drawing.Point(368, 408) + $AggregationType_textbox.Location = New-Object System.Drawing.Point(369, 407) $AggregationType_textbox.Name = 'AggregationType_textbox' $AggregationType_textbox.ReadOnly = $True $AggregationType_textbox.Size = New-Object System.Drawing.Size(127, 20) @@ -5851,10 +5945,10 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $splitter1.BorderStyle = 'Fixed3D' $splitter1.Cursor = 'Default' $splitter1.Dock = 'Bottom' - $splitter1.Location = New-Object System.Drawing.Point(0, 531) + $splitter1.Location = New-Object System.Drawing.Point(1, 530) $splitter1.MinSize = 0 $splitter1.Name = 'splitter1' - $splitter1.Size = New-Object System.Drawing.Size(1033, 278) + $splitter1.Size = New-Object System.Drawing.Size(1031, 278) $splitter1.TabIndex = 33 $splitter1.TabStop = $False # @@ -5863,7 +5957,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $clockImageLabel.AutoSize = $True $clockImageLabel.ImageIndex = 8 $clockImageLabel.ImageList = $imagelist1 - $clockImageLabel.Location = New-Object System.Drawing.Point(489, 3) + $clockImageLabel.Location = New-Object System.Drawing.Point(490, 4) $clockImageLabel.MinimumSize = New-Object System.Drawing.Size(15, 15) $clockImageLabel.Name = 'clockImageLabel' $clockImageLabel.Size = New-Object System.Drawing.Size(15, 15) @@ -5876,7 +5970,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) $checkboxIgnoreWarning.Anchor = 'Bottom, Right' $checkboxIgnoreWarning.AutoSize = $True $checkboxIgnoreWarning.Cursor = 'Hand' - $checkboxIgnoreWarning.Location = New-Object System.Drawing.Point(669, 449) + $checkboxIgnoreWarning.Location = New-Object System.Drawing.Point(668, 448) $checkboxIgnoreWarning.Name = 'checkboxIgnoreWarning' $checkboxIgnoreWarning.Size = New-Object System.Drawing.Size(99, 17) $checkboxIgnoreWarning.TabIndex = 17 @@ -5889,7 +5983,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAChPfud3/n9vnXLrOeOsMAAAAABJRU5ErkJgggs=')) # $linklabelUnderstandingAndModi.Anchor = 'Top, Right' $linklabelUnderstandingAndModi.AutoSize = $True - $linklabelUnderstandingAndModi.Location = New-Object System.Drawing.Point(606, 31) + $linklabelUnderstandingAndModi.Location = New-Object System.Drawing.Point(605, 32) $linklabelUnderstandingAndModi.Name = 'linklabelUnderstandingAndModi' $linklabelUnderstandingAndModi.Size = New-Object System.Drawing.Size(414, 13) $linklabelUnderstandingAndModi.TabIndex = 39