teamviewer / teamviewerps Goto Github PK
View Code? Open in Web Editor NEWTeamViewerPS allows to interact with the TeamViewer Web API as well as a locally installed TeamViewer client.
Home Page: https://www.teamviewer.com
License: MIT License
TeamViewerPS allows to interact with the TeamViewer Web API as well as a locally installed TeamViewer client.
Home Page: https://www.teamviewer.com
License: MIT License
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?
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!
Hey,
is it possible to add the "last_seen" properties from Get-TeamViewerDevice.ps1 in Get-TeamViewerManagedDevice.ps1 too?
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.
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.
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
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?
Summary
When using Add-TeamViewerAssignment -AssignmentId
on a Windows device with TeamViewerPS 2.0.0
Expected Behavior
I suppose it should have assigned the device
Steps To Reproduce
Add-TeamViewerAssignment -AssignmentId XYZ
)Misspelled or used a wrong command
in returnIs it possilbe to add "inherit" like in Set-TeamViewerDevice.ps1 to Set-TeamViewerManagedDevice.ps1
inherit the group policy to the device in there group
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
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?
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.
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
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
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
+ 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)
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.