Update _index.en.md

This commit is contained in:
Mr-Update 2023-10-01 13:53:56 +02:00 committed by GitHub
parent 8a348732e9
commit 338a2519fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,8 +15,9 @@ weight: 100
```ps ```ps
$ErrorActionPreference= 'silentlycontinue' $ErrorActionPreference= 'silentlycontinue'
If (!(Test-Path C:\Temp)) { if (!(Test-Path C:\Temp))
New-Item -ItemType Directory -Force -Path C:\Temp > null {
New-Item -ItemType Directory -Force -Path C:\Temp > null
} }
cd C:\Temp cd C:\Temp
@ -62,44 +63,43 @@ cd $env:ProgramFiles\RustDesk\
## Create Script to be used as a Check ## Create Script to be used as a Check
``` ```ps
$ErrorActionPreference= 'silentlycontinue' $ErrorActionPreference= 'silentlycontinue'
$confirmation_file = "C:\program files\RustDesk\rdrunonce.txt" $confirmation_file = "C:\Program Files\RustDesk\rdrunonce.txt"
if ([System.IO.File]::Exists($confirmation_file)) { if ([System.IO.File]::Exists($confirmation_file))
{
echo "Confirmation file exists" echo "Confirmation file exists"
exit 0 exit 0
} }
else else
{ {
echo "Confirmation file doesn't exists" echo "Confirmation file doesn't exists"
exit 1 exit 1
} }
``` ```
## RustDesk Set and Get Password (Collector Script needs Custom Agent Field) to run on Check Failure ## RustDesk Set and Get Password (Collector Script needs Custom Agent Field) to run on Check Failure
``` ```ps
$ErrorActionPreference= 'silentlycontinue' $ErrorActionPreference= 'silentlycontinue'
$confirmation_file = "C:\program files\RustDesk\rdrunonce.txt" $confirmation_file = "C:\Program Files\RustDesk\rdrunonce.txt"
net stop rustdesk > null net stop rustdesk > null
$ProcessActive = Get-Process rustdesk -ErrorAction SilentlyContinue $ProcessActive = Get-Process rustdesk -ErrorAction SilentlyContinue
if($ProcessActive -ne $null) if($ProcessActive -ne $null)
{ {
stop-process -ProcessName rustdesk -Force stop-process -ProcessName rustdesk -Force
} }
$rustdesk_pw = (-join ((65..90) + (97..122) | Get-Random -Count 12 | % {[char]$_})) $rustdesk_pw = (-join ((65..90) + (97..122) | Get-Random -Count 12 | % {[char]$_}))
Start-Process "$env:ProgramFiles\RustDesk\RustDesk.exe" "--password $rustdesk_pw" -wait Start-Process "$env:ProgramFiles\RustDesk\RustDesk.exe" "--password $rustdesk_pw" -wait
Write-Output $rustdesk_pw Write-Output $rustdesk_pw
net start rustdesk > null net start rustdesk > null
New-Item $confirmation_file > null
New-Item $confirmation_file > null
``` ```
## RustDesk URL Action ## RustDesk URL Action