How to export your computers using the TeamViewer API

Step 1: Create an api token in the Management Console

1) Click on your Username on the top right corner and click Edit Profile

2021-07-02 12_56_04-TeamViewer Management Console.png

2) Go to Apps and click Create script token

2021-01-15 11_56_00-TeamViewer Management Console.png

3) Give the token a name and select the parameter Computers & Contacts with the setting View entries and click Save.

2021-01-15 11_59_11-TeamViewer Management Console.png

4) This will generate the token. Please copy this token and save it for later.

2021-01-15 11_59_59-TeamViewer Management Console.png

Step 2: Run the export script in PowerShell ISE

1) Open PowerShell ISE as administrator and type the following code and press Enter

$jsonFile = "YOURPATH\Computers export.json"
$csvFile = "YOURPATH\Computers export.csv"
$tvAccessToken = read-host "Please type your token "​
$devicesResponse = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/devices?full_list=true" -Method Get -Headers @{authorization = "Bearer $tvAccessToken"}
$devicesResponse.devices | ConvertTo-Json | Out-File $jsonFile
$devicesResponse.devices | Export-Csv -Path $csvFile -Delimiter ',' -NoTypeInformation

📌Note: Don’t forget to replace YOURPATH with the path you want the export to be generated to.

2) It will ask you to enter your token. Please paste your token you have saved earlier and press Enter

2021-01-15 12_49_22-Windows PowerShell ISE (x86).png

3) You are done. The script will automatically generate the export in the folder you have selected as [YOURPATH].

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑