Removes TeamViewer devices (MDv2) that didn't appear online for a given time.
The script fetches a list of TeamViewer devices (MDv2) of the TeamViewer company that corresponds to a given API token. The list will be filtered by devices being offline for a certain amount of time. These devices will be removed. The expiration can either be specified by a specific date or by interval.
This script requires the TeamViewerPS
powershell module to be installed in at least Version 1.5.0.
Install-Module TeamViewerPS
.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryDate 2018-12-18 -WhatIf
.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryDate '2018-12-17T17:00:00' -WhatIf
.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryInterval -Days 10 -WhatIf
.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryInterval -Days 30
.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryInterval -Hours 12 -Force
To get further help about the script and its parameters, execute the
Get-Help
PowerShell cmdlet:
Get-Help -Detailed .\Remove-TeamViewerOutdatedDeviceV2.ps1