Created
September 24, 2025 05:57
-
-
Save xasz/bef97c8ead4df4aee87c857f782dbe27 to your computer and use it in GitHub Desktop.
Set Splashtop Proxy settings via NinjaOne Automation Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = "Stop" | |
| ($proxyServer = Ninja-Property-Docs-Get-Single "Integrationen" "proxyserver") *> $null | |
| ($proxyPort = Ninja-Property-Docs-Get-Single "Integrationen" "proxyport") *> $null | |
| Write-Host "ProxyServer: $proxyServer" | |
| Write-Host "Port: $proxyPort" | |
| $base = "HKLM:\SOFTWARE\WOW6432Node\Splashtop Inc.\Splashtop Remote Server" | |
| # Prüfen ob $proxyServer leer ist, wenn ja Proxy deaktivieren | |
| if([string]::IsNullOrEmpty($proxyServer)) { | |
| try{ | |
| $key = Get-ItemProperty -Path $base -Name "CloudProxyEnable" -ErrorAction Stop | |
| if($key.CloudProxyEnable -ne 0) { | |
| Set-ItemProperty -Path $base -Name "CloudProxyEnable" -Value 0 | |
| Write-Host "Proxy deaktiviert" | |
| } else { | |
| Write-Host "Proxy bereits deaktiviert" | |
| } | |
| }catch{ | |
| Write-Host "Kein Splashtop Remote Server installiert" | |
| } | |
| return | |
| } | |
| # Proxy konfigurieren | |
| $proxy = "{0}:{1}" -f $proxyServer, $proxyPort | |
| $currentProxyManual = (Get-ItemProperty -Path $base -Name "CloudProxyManual" -ErrorAction SilentlyContinue).CloudProxyManual | |
| $currentProxyEnable = (Get-ItemProperty -Path $base -Name "CloudProxyEnable" -ErrorAction SilentlyContinue).CloudProxyEnable | |
| Set-ItemProperty -Path $base -Name "CloudProxyManual" -Value $proxy -Type String | |
| Set-ItemProperty -Path $base -Name "CloudProxyLastProxy" -Value $proxy | |
| Set-ItemProperty -Path $base -Name "CloudProxyLastPAC" -Value '' -Type String | |
| Set-ItemProperty -Path $base -Name "CloudProxyLastAutoDetect" -Value 0 -Type DWord | |
| Set-ItemProperty -Path $base -Name "CloudProxyAuth" -Value 0 -Type DWord | |
| Set-ItemProperty -Path $base -Name "CloudProxyEnable" -Value 2 -Type DWord | |
| Set-ItemProperty -Path $base -Name "CloudRegion" -Value 'US' | |
| Write-Host "Proxy konfiguriert: $proxy" | |
| if($currentProxyManual -notlike $proxy -or $currentProxyEnable -notlike 2){ | |
| Write-Host "Proxy Konfiguration hat sich geändert - Splashtop Dienst wird neu gestartet" | |
| Get-Service -Name SplashtopRemoteService | Restart-Service | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment