Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/Win_Teamviewer_Get_ID.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Retrieve Teamviewer ID from TRMM agent. This tests versions 6+ known Registry Paths.

$ErrorActionPreference = 'SilentlyContinue'

$TeamViewerVersionsNums = @('6', '7', '8', '9', '')
$RegPaths = @('HKLM:\SOFTWARE\TeamViewer', 'HKLM:\SOFTWARE\Wow6432Node\TeamViewer')
$Paths = @(foreach ($TeamViewerVersionsNum in $TeamViewerVersionsNums) {
Expand All @@ -8,6 +10,8 @@ $Paths = @(foreach ($TeamViewerVersionsNum in $TeamViewerVersionsNums) {
}
})

$GoodPath = @()

foreach ($Path in $Paths) {
If (Test-Path $Path) {
$GoodPath += $Path
Expand All @@ -17,7 +21,6 @@ foreach ($Path in $Paths) {
foreach ($FullPath in $GoodPath) {
If ($null -ne (Get-Item -Path $FullPath).GetValue('ClientID')) {
$TeamViewerID = (Get-Item -Path $FullPath).GetValue('ClientID')
$ErrorActionPreference = 'silentlycontinue'

}

Expand Down
Loading