Add six-month domain and broker monitoring
This commit is contained in:
@@ -348,6 +348,10 @@ foreach ($requiredPath in @(
|
||||
(Join-Path $scriptsRoot 'Set-SguDomainComputerPolicies.ps1'),
|
||||
(Join-Path $scriptsRoot 'Set-SguDomainUserPolicies.ps1'),
|
||||
(Join-Path $scriptsRoot 'Enable-SguServerRemoteManagement.ps1'),
|
||||
(Join-Path $scriptsRoot 'Install-SguDomainMonitoring.ps1'),
|
||||
(Join-Path $scriptsRoot 'Invoke-SguMonitoringMaintenance.ps1'),
|
||||
(Join-Path $scriptsRoot 'Get-SguUsageReport.ps1'),
|
||||
(Join-Path $scriptsRoot 'Get-SguBrokerLog.ps1'),
|
||||
(Join-Path $brokerPublishPath 'SGU.AuthBroker.exe'))) {
|
||||
if (-not (Test-Path -LiteralPath $requiredPath -PathType Leaf)) {
|
||||
throw "The server bootstrap package is incomplete: $requiredPath"
|
||||
@@ -606,8 +610,15 @@ else {
|
||||
-RemoteAddress $privateSubnet | Out-Null
|
||||
}
|
||||
|
||||
$collectorFqdn = "$env:COMPUTERNAME.$DomainName"
|
||||
& (Join-Path $scriptsRoot 'Set-SguDomainComputerPolicies.ps1') `
|
||||
-TargetOuDn $laboratoryOuDn -DomainController $env:COMPUTERNAME | Out-Null
|
||||
-TargetOuDn $laboratoryOuDn `
|
||||
-DomainController $env:COMPUTERNAME `
|
||||
-EventCollectorFqdn $collectorFqdn | Out-Null
|
||||
& (Join-Path $scriptsRoot 'Install-SguDomainMonitoring.ps1') `
|
||||
-CollectorFqdn $collectorFqdn `
|
||||
-ComputerOuDn $laboratoryOuDn `
|
||||
-RetentionDays 183 | Out-Null
|
||||
$userPolicyParameters = @{
|
||||
TargetOuDn = $usersOuDn
|
||||
DomainController = $env:COMPUTERNAME
|
||||
@@ -632,6 +643,9 @@ $validation = [ordered]@{
|
||||
BrokerPortListening = [bool](Get-NetTCPConnection -LocalPort 8443 -State Listen -ErrorAction SilentlyContinue)
|
||||
WinRM = (Get-Service WinRM).Status.ToString()
|
||||
RemoteDesktop = (Get-Service TermService).Status.ToString()
|
||||
EventCollector = (Get-Service Wecsvc).Status.ToString()
|
||||
EventSubscription = @(& wecutil.exe enum-subscription) -contains 'SGU-Lab-Monitoring'
|
||||
MonitoringRetentionDays = 183
|
||||
PackageShare = "\\$env:COMPUTERNAME\Packages"
|
||||
LaboratoryOu = $laboratoryOuDn
|
||||
UsersOu = $usersOuDn
|
||||
@@ -643,7 +657,9 @@ $validation = [ordered]@{
|
||||
if ($validation.BrokerService -ne 'Running' -or
|
||||
-not $validation.BrokerPortListening -or
|
||||
$validation.WinRM -ne 'Running' -or
|
||||
$validation.RemoteDesktop -ne 'Running') {
|
||||
$validation.RemoteDesktop -ne 'Running' -or
|
||||
$validation.EventCollector -ne 'Running' -or
|
||||
-not $validation.EventSubscription) {
|
||||
throw 'Server finalization did not pass service validation. Review bootstrap.log and re-run the bootstrap.'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user