Hello everyone,
I'm trying to export all my devices en groups. I workd with this code
$bearer = "Bearer",$token
$header = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$header.Add("authorization", $bearer)
#Export des devices dans un premier fichier CSV
$request = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/devices" -Method Get -Headers $header
$request.devices | Select-Object -Property "alias","remotecontrol_id","groupid","password","description" | Export-Csv "$env:userprofile\Desktop\TVDevicesListExport.csv"
#Export des groups dans un second fichier CSV
$grequest = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/groups" -Method Get -Headers $header
$grequest.groups | Select-Object -Property "name","id" | Export-Csv “$env:userprofile\Desktop\TVGroupsListExport.csv"
I can recover all the fields except the password. Would anyone have an idea of what is blocking or what could change in my approach?
Thanks for your help