Add self-hosted RustDesk bootstrap management
This commit is contained in:
@@ -19,7 +19,9 @@ param(
|
||||
[ValidateRange(2, 90)]
|
||||
[int]$TimeoutSeconds = 90,
|
||||
[string]$RemoteDesktopPrincipal = 'LCI\SG-Laboratorio-Usuarios-RDP',
|
||||
[string]$DotNetRuntimeInstallerPath
|
||||
[string]$DotNetRuntimeInstallerPath,
|
||||
[string]$RustDeskServerAddress,
|
||||
[string]$RustDeskServerPublicKey
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
@@ -29,6 +31,7 @@ $sourceScripts = @(
|
||||
'Install-CredentialProvider.ps1',
|
||||
'Enable-LabRemoteAccess.ps1',
|
||||
'Enable-SguClientMonitoring.ps1',
|
||||
'Install-SguRustDeskClient.ps1',
|
||||
'Test-SguClientEnrollment.ps1',
|
||||
'Repair-SguClientEnrollment.ps1'
|
||||
)
|
||||
@@ -54,6 +57,10 @@ if ($DotNetRuntimeInstallerPath -and
|
||||
-not (Test-Path -LiteralPath $DotNetRuntimeInstallerPath -PathType Leaf)) {
|
||||
throw 'DotNetRuntimeInstallerPath does not exist.'
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($RustDeskServerAddress) -xor
|
||||
[string]::IsNullOrWhiteSpace($RustDeskServerPublicKey)) {
|
||||
throw 'RustDeskServerAddress and RustDeskServerPublicKey must be supplied together.'
|
||||
}
|
||||
|
||||
if ($PSCmdlet.ShouldProcess($enrollmentRoot, 'Install the SGU enrollment repair guard')) {
|
||||
New-Item -ItemType Directory -Path $enrollmentRoot -Force | Out-Null
|
||||
@@ -88,6 +95,8 @@ if ($PSCmdlet.ShouldProcess($enrollmentRoot, 'Install the SGU enrollment repair
|
||||
TimeoutSeconds = $TimeoutSeconds
|
||||
RemoteDesktopPrincipal = $RemoteDesktopPrincipal
|
||||
DotNetRuntimeInstallerPath = $guardRuntimeInstaller
|
||||
RustDeskServerAddress = $RustDeskServerAddress
|
||||
RustDeskServerPublicKey = $RustDeskServerPublicKey
|
||||
}
|
||||
$configurationPath = Join-Path $enrollmentRoot 'enrollment.json'
|
||||
[IO.File]::WriteAllText(
|
||||
|
||||
Reference in New Issue
Block a user