Skip to content

Latest commit

 

History

History

Remove-TeamViewerOutdatedDeviceV2

Remove-TeamViewerOutdatedDeviceV2

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.

Prerequisites

This script requires the TeamViewerPS powershell module to be installed in at least Version 1.5.0.

Install-Module TeamViewerPS

Examples

List removal candidate devices that have been offline since at least 2018-12-18 00:00:00

.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryDate 2018-12-18 -WhatIf

List removal candidate devices that have been offline since at least 2018-12-17 17:00:00

.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryDate '2018-12-17T17:00:00' -WhatIf

List removal candidate devices that have been offline since at least 10 days

.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryInterval -Days 10 -WhatIf

Remove devices that have been offline since at least 30 days. User needs to confirm

.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryInterval -Days 30

Remove devices that have been offline since at least 12 hours without further confirmation

.\Remove-TeamViewerOutdatedDeviceV2 -ExpiryInterval -Hours 12 -Force

More help

To get further help about the script and its parameters, execute the Get-Help PowerShell cmdlet:

Get-Help -Detailed .\Remove-TeamViewerOutdatedDeviceV2.ps1