Code Monkey home page Code Monkey logo

teamviewerps's Introduction

TeamViewerPS

CI

TeamViewerPS allows to interact with the TeamViewer Web API as well as a locally installed TeamViewer client.

Installation & Update

Downloads and installs TeamViewerPS from the Powershell Gallery using the following command:

Install-Module TeamViewerPS

Execute the following command to update an existing installation of TeamViewerPS:

Update-Module TeamViewerPS

Usage

The following example code shows how to interact with the TeamViewer Web API functions by retrieving the list of users of a TeamViewer company:

# Stores API token for Powershell session
# 1. Create a TeamViewer API access token in the Management Console: https://login.teamviewer.com
# 2. Enter the API token in the shown dialog
Connect-TeamViewerApi

# Retrieves users of a TeamViewer company
Get-TeamViewerUser

Another example below shows how to display the TeamViewer ID as well as the version of the locally installed TeamViewer client:

# Returns the TeamViewer Id of the locally installed TeamViewer client
Get-TeamViewerId

# Returns the version of the locally installed TeamViewer client
Get-TeamViewerVersion

The documentation and help can be accessed using the following commands:

# Starting point of the documentation
Get-Help TeamViewerPS

# List of available commands of this module
Get-Command -Module TeamViewerPS

# Help for specific module functions
Get-Help -Full Get-TeamViewerUser # ... or any other command

Commands

The module provides functions for the following categories:

  • Computers & Contacts list
  • User management
  • User groups
  • Roles
  • Managed groups
  • Policy management
  • Single Sign-On (SSO) management
  • Local TeamViewer utilities

Please see the TeamViewerPS article for a more detailed list.

Prerequisites

TeamViewerPS requires one of the following environments to run:

  • PowerShell 5.1 (Windows)
  • PowerShell Core 6 (Windows, Linux)
  • PowerShell 7 (Windows, Linux)

License

Please see the file LICENSE.md.

Links

teamviewerps's People

Contributors

alexandrosalexiou avatar christianj-tv avatar danieljoos avatar karthickgandhitv avatar koutsop avatar otterkring avatar skeller-tv avatar stefanhubertus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teamviewerps's Issues

[Feature] Detect Host or Full Installation

Summary
When deploying TeamViewer we need to ensure the installed version is host or full. Due to there being no difference in Registry name or locally installed file names, the only way to detect this is with string checks on the registry to look for HC in the version number. The use of HC in the version number in the registry also prevents checks against the version number in Intune from completing successfully. We need an easy way to retrieve this.

Expected Solution
Move the 'type' or 'mode' of the installation to a separate registry key and stop using HC in the 'Version' field. Concurrently store the property in the device object. Return the property for Get-TeamViewerManagedDevice, Get-TeamViewerDevice and add a new command 'Get-TeamViewerType' or 'Get-TeamViewerMode' as appropriate.

Considerations
The registry changed would be sufficient but the addition to the API and PS module would benefit more people.

Add various properties to Get-TeamViewerManagedDevice

Summary
It would be great to get more detailed information about a device when using Get-TeamViewerManagedDevice, for example membership in managed groups, applied policy, last time seen, custom config, etc...

Expected Solution
Add a properties to Get-TeamViewerManagedDevice for the added information

Considerations

Attachments

How to assign a TeamViewer host to an account?

Currently I have to find the TeamViewer installation path and run the TeamViewer.exe with the assignment parameter and assignment ID (rel. assign-a-device-to-your-company). It would be great to be able to use the COM interface for the assignment instead. I tried to find a way to assign it through the powershell COM API, but it seems that this is not support (and MachineSettings as well as UserSettings are not implement atm).

Is there a way to use the COM interface to assign a machine to an account automatically?

Add-TeamViewerCustomization , not working?

Hello,

In the docs, there is a mention of the command Add-TeamViewerCustomization , however when trying to run the command on a machine it reports an error 👍

Add-TeamViewerCustomization : Le terme «Add-TeamViewerCustomization» n'est pas reconnu comme nom d'applet de commande, fonction, 
fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin 
d'accès est correct et réessayez.
Au caractère Ligne:1 : 1
+ Add-TeamViewerCustomization -Id 'xxxxx' -RestartGUI -RemoveExisting
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-TeamViewerCustomization:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Is this expected ?

thanks!

Version 2.0.0 - PSGallery Release Date?

Summary
Is there an ETA for the Version 2.0.0 release within the PSGallery?

I see the changelog shows the 2.0.0 release was dated 9-13-2023, but the PSGallery only has 1.5.2.

Test-TeamViewerConnectivity gives no output, no timeout, unable to abort

I have a working TeamViewer installation. GUI works, ready for connection (secure connection). Remoting to many partners during the day.

Get-TeamViewerId with no arguments returns my ID.
Test-TeamViewerConnectivity with no arguments only gives a static cursor.

Ctrl+C does not work.
Tested both PowerShell 7.3.2 and Windows PowerShell 5.1 on Windows 10.
TeamViewer version 15.38.3 (64-bit), Tensor Basic

Add-TeamviewerUserGroupMember - Adding only one Member - Error converting value 123456543 to type 'system.Collection.Generic.List`1[System.Uint32]'

Summary
It is not possible to add only one member to a userGroup in Teamviewer over the Powershell Module

Add-TeamviewerUserGroupMember -id 1234 -member @(12323523423)

We get the error message:

Add-TeamViewerUserGroupMember : Error converting value 123123123 to type 'System.Collections.Generic.List`1[System.UInt32]'. Path '', line 1, position 9. (invalid_request)
In Zeile:1 Zeichen:1

  • Add-TeamViewerUserGroupMember -Id 1234 -Member @(123123123)
  •   + CategoryInfo          : InvalidArgument: (:) [Add-TeamViewerUserGroupMember], RuntimeException
      + FullyQualifiedErrorId : TeamViewerRestError,Add-TeamViewerUserGroupMember
    
    

Expected Behavior
The user should be added. Interesstingly if you use two member in the Array it works:
Add-TeamviewerUserGroupMember -id 1234 -member @(123523423, 3012340)

inherit for Managed Device

Is it possilbe to add "inherit" like in Set-TeamViewerDevice.ps1 to Set-TeamViewerManagedDevice.ps1

inherit the group policy to the device in there group

Deactivating a user does not seem to work[Bug]

Summary
Tried to deactivate a user using the ID and i get the message : Set-TeamViewerUser: The given input does not change the user.
but activating it with $true is working. $false is not working.

Expected Behavior
The user to be deactivated like he is activated with $true

Setps To Reproduce
followed the example 3 from here. The user exist and i am using the API from https://login.teamviewer.com/nav/managecompany/apps with all rights.
(https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerUser.md)

Attachments
If applicable, provide files (e.g. configuration, log files, screenshots) to help explain your problem.

FeateureRequest: Allow MSI downloads with Invoke-TeamViewerPackageDownload

Hi,

As part of my Intune dployment script i have to keep supplying the latest MSIs and repackaging it, I use the custom parameters so need the MSI. It would be great if I could authenticate with the API token to enable access to the latest MSI versions. This would mean I could run the invoke command at the beginning of the sctipt and know it's always running the latest MSI on install.
If there's other ways to acheive this please let me know.

Thanks,
Lee

Device Information makes no sense

Steps to reproduce:
$Devices = Get-TeamViewerDevice
$Devices | Select-Object Id, Name, LastSeenAt, OnlineState

The output of this results in a list of Devices in my teamviewer account, however i would say about half of them have no "Last Seen At" date field at all. Others indicate that they were last seen ~ months ago (but also reflect them as "Online" currently.
We have about 500 systems online right now and seen to report the Last Seen At time correctly (shows today at various timestamps... but they all show their status as "Offline"

I don't know what do to with this information or how to interpret it properly

Data output of Get-TeamViewerConnectionReport

Summary
Hi All,

I'm currently trying to script daily connection reports for a service provider we use that uses one of our logons to service some of our estate.

The problem is that the output from Get-TeamViewerConnectionReport seems to not contain useful output, the output fields don't correlate to the output of the web ui connection reports it seems. In the web report, you can get the following fields.

image

However the commandlet outputs like the following:

Id : 123ab123-ab1a-1a11-1a12-1a12a1234567
UserName : AMS Support
BillingState : Bill
UserId : u1234567
DeviceName :
EndDate : 03/08/2023 12:23:22
Fee : 0.00
Notes :
GroupName :
StartDate : 03/08/2023 12:18:55
Currency : None
GroupId :
DeviceId : 1234567890
SessionCode :
SupportSessionType : RemoteConnection

The output does not contain the Teamviewer ID of the device for example, and in my instance the device name. I have been trying to look up the device name via the data that the commandlet outputs but to no avail.

All I really want to do is get a summary of the longest connection, average connection length and what device it was connected to for a week and month period to put in the report I'm building.

My current code looks like this:

#Function to check Basic AMS teamviewer statistics.
Function Get-AMSTeamViewerStats {
    param(
        [Parameter(Mandatory=$true)][int]$DaysToCheck,
        [Parameter(Mandatory=$true)][string]$ReportUser
        )

#Get the AMS Statistics.
$olrStats = Get-TeamViewerConnectionReport -ApiToken $apikeySS -UserName $ReportUser -days $DaysToCheck

#Cast the Lists to arrays.
$ConnectionList = @();
$ActiveConnectionList = @();
$global:connectionResults = @();

foreach ($connection in $olrStats){
        
        #Try and get a device name but if not, just get the API ID. 
        Try{
            if($null -ne (Get-TeamViewerDevice -ApiToken $apikeySS -TeamViewerId $connection.DeviceID)){
                $deviceID = Get-TeamViewerDevice -ApiToken $apikeySS -TeamViewerId $connection.DeviceID
            }elseif($null -ne (Get-TeamViewerManagedDevice -ApiToken $apikeySS -ID $Connectiom.ID)){
                $deviceID = Get-TeamViewerManagedDevice -ApiToken $apikeySS -ID $Connectiom.ID
            }else{
                $deviceID = Get-TeamViewerDevice -ApiToken $apikeySS -Id $connection.DeviceID
            }
        }catch{
            #F**k it, use the device ID.
            $Deviceid = "API Device ID: " + $connection.DeviceID
        }  
                if($null -eq $connection.Enddate){
                        $ActiveConnectionList += New-Object PSObject -Property @{
                                    DeviceName = $Deviceid
                                    ConnectionStartDate = get-date($connection.StartDate) -Format "dd/MM/yyyy"
                                    ConnectionStartTime = get-date($connection.StartDate) -Format "HH:mm"
                        }
                }else{
                        $ConnectionList += New-Object PSObject -Property @{
                                    DeviceName = $Deviceid
                                    ConnectionStartDate = get-date($connection.StartDate) -Format "dd/MM/yyyy"
                                    ConnectionStartTime = get-date($connection.StartDate) -Format "HH:mm"
                                    ConnectionLengthtotalMins = [int]("{0:0}" -f ((New-TimeSpan -Start $connection.StartDate -End $connection.Enddate -ErrorAction SilentlyContinue).TotalMinutes))
                        }
                }
}

#Add up all the connection time for average.
$totalConTime = 0
for each($_ in $ConnectionList){
    $totalContime += $_.ConnectionLengthtotalMins
}

$meanConnectionTime = [int]($totalContime / $ConnectionList.count)
$topConnectionTime = ($ConnectionList | Sort-Object -Property ConnectionLengthtotalMins -Descending | Select-Object -First 1).ConnectionLengthtotalMins
$numOfConnections = [int]($connectionList.Count)
$ActiveConnectionCount = [int]($ActiveConnectionList.Count)

    $global:connectionResults += New-Object PSObject -Property @{
        AdverageConnectionTime = $meanConnectionTime
        LongestConnectionTime = $topConnectionTime
        TotalConnectionsDuringPediod = $numOfConnections
        ReportPediodLengthDays = $DaysToCheck
        NumberOfActiveConnectionsDuringReport = $ActiveConnectionCount
        }
    "Call the connectionResults global variable to get values."

}

Perhaps I'm misunderstanding or being stupid? Any help would be much appreciated.

Scott

Attachments
If applicable, provide files (e.g. configuration, log files, screenshots) to help explain your question.

"Last_seen" for Managed Devices

Hey,

is it possible to add the "last_seen" properties from Get-TeamViewerDevice.ps1 in Get-TeamViewerManagedDevice.ps1 too?

Group

is there a way to overwrite a consistend group from an device?

Teamviewer is installed in Group "installed", now i wanna change it to group "changed"
currently my way is delete the current group and add the new one, exists a overwrite methode for this?

[Bug] (license_required) when executing Get-TeamViewerUserGroup

Summary
When I execute Get-TeamViewerUserGroup I get the following error message:
`PS C:\WINDOWS\system32> Get-TeamViewerUserGroup
Get-TeamViewerUserGroup : A license is required to perform this action (license_required)
In Zeile:1 Zeichen:1

  • Get-TeamViewerUserGroup
  •   + CategoryInfo          : NotSpecified: (:) [Get-TeamViewerUserGroup], RuntimeException
      + FullyQualifiedErrorId : TeamViewerRestError,Get-TeamViewerUserGroup`
    
    

Expected Behavior
I'd expect a list of all user groups with their properties

This is the only command in my script, that is currently not running.

License Required error

I am able to connect to our Corporate account and view users, groups, etc.

But when I try to add a user to a group I get an error that a license is required.

Command:

$api_token = ConvertTo-SecureString -String "REDACTED" -AsPlainText -Force`
Connect-TeamViewerApi -ApiToken $api_token
Add-TeamViewerUserGroupMember -id 123456 -Member @(654321)

Result:

At line:1 char:1
+ Add-TeamViewerUserGroupMember -id 123456 -Member @(654321)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-TeamViewerUserGroupMember], RuntimeException
    + FullyQualifiedErrorId : TeamViewerRestError,Add-TeamViewerUserGroupMember

Am I missing something?

Remove-TeamViewerManagedDevice Requires Group

HI,

I'm trying to remove a managed device from the portal as part of my uninstallation script. I can see there was a commit to force the group but it shouldn't apply to this command IMO. There should be Remove-TeamViewerManagedDeviceGroupMember and pass in the device ID to do that.

If you want to enforce this group property there need a Get-TeamViewerManageDeviceGroupMembers cmdlet or for Get-TeamViewerManagedDevice to return a list of groups it's a member of as well please. I'll need to get the managed device groups now and then iterate through them, ignoring errors when it's not a member for the time being I think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.