Paylinks for BLOCKS
Knowledgebase
Bulk Delete items from Teamviewer
Posted by Dan Mansfield on 14 March 2020 03:05 PM

$token = ""
$bearer = "Bearer",$token

$header = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$header.Add("authorization", $bearer)

$devices = (Invoke-RestMethod -Uri "Https://webapi.teamviewer.com/api/v1/devices" -Method Get -Headers $header).devices

$30Days = ((Get-Date).AddDays(-60)).GetDateTimeFormats()[5]

ForEach($device in $devices)
{

$ID = $device.device_id

$Alias = $device.alias

if ($Alias -like '*word*')
{

Invoke-WebRequest -Uri "Https://webapi.teamviewer.com/api/v1/devices/$ID" -Method Delete -Headers $header
Write-Host "Deleted device:"$device.alias -ForegroundColor Yellow

$Alias = $null
}

}

(0 vote(s))
Helpful
Not helpful

ERROR: This domain name (powertoolreview.co.uk), does not match the domain name in the license key file.

For assistance with your license, please contact the Kayako support team: https://support.kayako.com