Add managed RustDesk enrollment for Linux clients
This commit is contained in:
@@ -353,7 +353,9 @@ foreach ($requiredPath in @(
|
||||
(Join-Path $scriptsRoot 'Enable-SguServerRemoteManagement.ps1'),
|
||||
(Join-Path $scriptsRoot 'Install-SguDomainMonitoring.ps1'),
|
||||
(Join-Path $scriptsRoot 'Install-SguRustDeskClient.ps1'),
|
||||
(Join-Path $scriptsRoot 'Install-SguRustDeskLinuxEnrollment.ps1'),
|
||||
(Join-Path $scriptsRoot 'Install-SguRustDeskServer.ps1'),
|
||||
(Join-Path $scriptsRoot 'Invoke-SguRustDeskLinuxRegistrationProcessor.ps1'),
|
||||
(Join-Path $scriptsRoot 'Invoke-SguMonitoringMaintenance.ps1'),
|
||||
(Join-Path $scriptsRoot 'Get-SguRustDeskDevice.ps1'),
|
||||
(Join-Path $scriptsRoot 'Get-SguUsageReport.ps1'),
|
||||
@@ -643,10 +645,19 @@ $rustDeskServer = & (Join-Path $scriptsRoot 'Install-SguRustDeskServer.ps1') `
|
||||
-FirewallRemoteAddress $privateSubnet
|
||||
$rustDeskManagementRoot = Join-Path $env:ProgramData 'SGU\RustDesk'
|
||||
New-Item -ItemType Directory -Path $rustDeskManagementRoot -Force | Out-Null
|
||||
foreach ($scriptName in @('Register-SguRustDeskDevice.ps1', 'Get-SguRustDeskDevice.ps1')) {
|
||||
foreach ($scriptName in @(
|
||||
'Register-SguRustDeskDevice.ps1',
|
||||
'Get-SguRustDeskDevice.ps1',
|
||||
'Install-SguRustDeskLinuxEnrollment.ps1',
|
||||
'Invoke-SguRustDeskLinuxRegistrationProcessor.ps1')) {
|
||||
Copy-Item -LiteralPath (Join-Path $scriptsRoot $scriptName) `
|
||||
-Destination (Join-Path $rustDeskManagementRoot $scriptName) -Force
|
||||
}
|
||||
$rustDeskLinuxEnrollment = & (Join-Path $rustDeskManagementRoot 'Install-SguRustDeskLinuxEnrollment.ps1') `
|
||||
-DomainName $DomainName `
|
||||
-ServerAddress $rustDeskDnsName `
|
||||
-ServerPublicKey $rustDeskServer.PublicKey `
|
||||
-ProcessorScriptPath (Join-Path $rustDeskManagementRoot 'Invoke-SguRustDeskLinuxRegistrationProcessor.ps1')
|
||||
$rustDeskServerClient = & (Join-Path $scriptsRoot 'Install-SguRustDeskClient.ps1') `
|
||||
-ServerAddress $rustDeskDnsName `
|
||||
-ServerPublicKey $rustDeskServer.PublicKey
|
||||
@@ -680,6 +691,7 @@ $validation = [ordered]@{
|
||||
RustDeskHbbrTask = $rustDeskServer.HbbrTask
|
||||
RustDeskHbbsListening = $rustDeskServer.HbbsListening
|
||||
RustDeskHbbrListening = $rustDeskServer.HbbrListening
|
||||
RustDeskLinuxRegistrationTask = (Get-ScheduledTask -TaskName $rustDeskLinuxEnrollment.RegistrationTask).State.ToString()
|
||||
RustDeskServerClientId = $rustDeskServerClient.RustDeskId
|
||||
EventCollector = (Get-Service Wecsvc).Status.ToString()
|
||||
EventSubscription = @(& wecutil.exe enum-subscription) -contains 'SGU-Lab-Monitoring'
|
||||
@@ -698,6 +710,7 @@ if ($validation.BrokerService -ne 'Running' -or
|
||||
$validation.RemoteDesktop -ne 'Running' -or
|
||||
$validation.RustDeskHbbsTask -ne 'Running' -or
|
||||
$validation.RustDeskHbbrTask -ne 'Running' -or
|
||||
$validation.RustDeskLinuxRegistrationTask -notin @('Ready', 'Running') -or
|
||||
-not $validation.RustDeskHbbsListening -or
|
||||
-not $validation.RustDeskHbbrListening -or
|
||||
$validation.EventCollector -ne 'Running' -or
|
||||
|
||||
Reference in New Issue
Block a user