Add Computers to Teamviewer with Intune

Andre1984
Andre1984 Posts: 1
edited January 2022 in Deployment & Integrations

Hello,

We have linked team viewer within Intune. Everywhere I read on the internet it is said that the user has to go to the company portal app if you want to watch via team viewer.

What we really want is that all our devices that are in Intune also come in the team viewer. Then we can look directly at the user from a team viewer.
You can now start a New Remote Assistance Session from Intune, the will go to team viewer and from there you can send an invitation (with a link) to the user. But we want to be able to take over the computers directly from Intune, and preferably without user intervention

How is this possible?

Tagged:

Comments

  • Cool, no response. I think I should give up too.

  • Nooo! Don't give up!!!

    Deploy your device using the method described here (sorry it's in German, but Google is your friend):

    https://community.teamviewer.com/German/kb/articles/39639-verbessertes-ausrollverfahren-fuer-teamviewer-mit-dem-neuen-msi-paket

    As an example we run this:

    msiexec.exe /i "\\dekizfs2\Service\General\Software pool\Teamviewer\TeamViewer_Host.msi" /qn CUSTOMCONFIGID=XXXX APITOKEN=XXXXXXX ASSIGNMENTOPTIONS="--reassign --alias %ComputerName%-[UserLastName.UserFirstName]"


    We are also about to deploy the following powershell script than will run after each logon, to update the name of the machine and make it easier for the first level support:


    $header = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"

    $header.Add("authorization", 'Bearer 11838925-HtDUambCScSuqeqLgJfJ')


    $rid = Get-ItemProperty "HKLM:\SOFTWARE\WOW6432Node\TeamViewer"


    $cid = "r"+$rid.ClientID



    #### This is time / resource consuming!


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

    #ForEach($item in $devices.devices)

    #  {

    #  If($item.remotecontrol_id -eq $cid)

    #    {

    #    $x = $item.device_id

    #    }

    #  }


    #### Instead, we go right to the proper device using the remotecontrol_id parameter

    $device = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/devices?parameters.remotecontrol_id=$cid" -Method Get -Headers $header


    ##Defensive code to make sure we update the right device!

    if($device.devices.Count -ne 1)

    {

      return

    }

      

    if($device.devices[0].remotecontrol_id -ne $cid)

    {

      return

    }



    $deviceId = $device.devices[0].device_id


    $cname = $env:COMPUTERNAME


    $userinfo = (net user $env:USERNAME /domain | Select-String "Full Name") -replace "\s\s+"," " -split " " -replace ",","."

    $userinfo = $userinfo[2] + '.'+ $userinfo[3]


    $body = (@{

          alias = "$cname-$userinfo"

         }) | ConvertTo-Json

    Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/devices/$deviceId" -Method Put -Headers $header -ContentType application/json -Body $body




    And if you can't make it work, just open a ticket with TV support: that's what I did for the first few steps - no shame in that ;-)

    Stephan