teamviewer.com link icon
or
Ask The Community

Do you want to enjoy the new TeamViewer user interface for Windows?


Download the new version and let us know what you think about it! 👉 Please click here 👈

how to import users with csv files in powershell

how to import users with csv files in powershell ?

Answers

  • RyanMaeng
    RyanMaeng Posts: 3 ✭✭
    edited September 9

    I exported a list of users and i'd like to import a list of users (about 400users) with csv file in powershell.

    how can i import it ?

    below is the code that i exported a list of users

    $csvFile = "C:\...\test.csv"

    $accessToken = "...."

    $usersResponse = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/users?full_list=true" -Method Get -Headers @{authorization = "Bearer $AccessToken"}

    $usersResponse.users | Export-Csv -Path $csvFile -Delimiter ',' -NoTypeInformation -Encoding UTF8