Qualify tenant-scoped bootstrap rotation and fresh Windows scripting
This commit is contained in:
@@ -9,7 +9,10 @@ $from = Get-Image 'FROM_UUID'
|
||||
$to = Get-Image 'TO_UUID'
|
||||
$service = Get-CimInstance -ClassName Win32_Service -Filter "Name='RmmDiscoveryWindows'"
|
||||
$config = Get-Content -LiteralPath $configPath -Raw | ConvertFrom-Json
|
||||
if ($config.PSObject.Properties['enable_jobs'] -and $config.enable_jobs) { throw 'Job-enabled agent requires a coordinated handoff.' }
|
||||
if ($config.PSObject.Properties['enable_jobs'] -and $config.enable_jobs) {
|
||||
if (-not $config.PSObject.Properties['localservice_time_policy'] -or
|
||||
$config.localservice_time_policy -cne (Join-Path (Split-Path $configPath) 'job-time.json')) { throw 'Job-enabled pair requires a coordinated helper handoff.' }
|
||||
}
|
||||
if (-not $service -or $service.StartName -ine 'NT AUTHORITY\LocalService' -or
|
||||
$service.PathName -cnotin @($from,$to) -or (Get-Service 'RmmDiscoverySystemHelper' -ErrorAction SilentlyContinue)) { throw 'Unexpected service configuration.' }
|
||||
if ($service.PathName -cne $to) {
|
||||
|
||||
Reference in New Issue
Block a user