mirror of
https://github.com/techahold/rustdeskinstall.git
synced 2024-07-04 11:36:05 +02:00
Create widnowsclientID.ps1
This commit is contained in:
parent
82646d587d
commit
83b1042292
24
widnowsclientID.ps1
Normal file
24
widnowsclientID.ps1
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
$ErrorActionPreference= 'silentlycontinue'
|
||||||
|
# Get RustDesk ID
|
||||||
|
|
||||||
|
If (!("C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml")) {
|
||||||
|
$username = ((Get-WMIObject -ClassName Win32_ComputerSystem).Username).Split('\')[1]
|
||||||
|
$rustid=(Get-content C:\Users\$username\AppData\Roaming\RustDesk\config\RustDesk.toml | Where-Object { $_.Contains("id") })
|
||||||
|
$rustid = $rustid.Split("'")[1]
|
||||||
|
|
||||||
|
$rustpword = (Get-content C:\Users\$username\AppData\Roaming\RustDesk\config\RustDesk.toml | Where-Object { $_.Contains("password") })
|
||||||
|
$rustpword = $rustpword.Split("'")[1]
|
||||||
|
Write-output "Config file found in user folder"
|
||||||
|
Write-output "$rustid"
|
||||||
|
Write-output "$rustpword"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$rustid=(Get-content C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml | Where-Object { $_.Contains("id") })
|
||||||
|
$rustid = $rustid.Split("'")[1]
|
||||||
|
|
||||||
|
$rustpword = (Get-content C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml | Where-Object { $_.Contains("password") })
|
||||||
|
$rustpword = $rustpword.Split("'")[1]
|
||||||
|
Write-output "Config file found in windows service folder"
|
||||||
|
Write-output "$rustid"
|
||||||
|
Write-output "$rustpword"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user