In this guide, you will learn how to add users to the TeamViewer Single Sign-On (SSO) exclusion list using a CSV file. The script provided, Add-SsoExclusionsFromCSV.ps1, simplifies this process and allows you to efficiently manage user exclusions.

This article applies to TeamViewer Tensor license holders.

Prerequisites

Before you start, make sure you have the TeamViewerPS PowerShell module installed.

This script relies on the TeamViewerPS PowerShell module. If you haven't already installed it, you can do so using the following command:

Install-Module TeamViewerPS

Adding Users from a CSV File

Now that you have the TeamViewerPS PowerShell module installed, you can proceed to add users from a CSV file to the TeamViewer SSO exclusion list:

  1. Prepare Your CSV File: Create a CSV file that contains the list of users you want to exclude. Ensure that the CSV file has a column with the header name 'Email' (or as per your requirement) which contains the email addresses of the users you want to exclude.
  2. Run the Script: Open your PowerShell console and navigate to the directory where the Add-SsoExclusionsFromCSV.ps1 script is located. Use the following command to import users from the CSV file:
.\Add-SsoExclusionsFromCSV -Path 'c:\Example.csv' -HeaderName 'Email'

Replace 'c:\Example.csv' with the actual path to your CSV file if it's located in a different directory.

This command will read the CSV file and add the specified users to the TeamViewer SSO exclusion list.

Using an API Token (Optional)

If you wish to use an API token for authentication, you can provide it as follows:

Generate an API Token: Create a secure API token and convert it to a secure string. For example:

$apiToken = 'SecretToken123' | ConvertTo-SecureString -AsPlainText -Force

Run the Script with API Token: Run the script with the -ApiToken parameter:

.\Add-SsoExclusionsFromCSV -Path 'c:\Example.csv' -HeaderName 'Email' -ApiToken $apiToken

This will ensure that the script uses the provided API token for authentication.

Testing in "Test Mode"

You can run the import script in "Test Mode" to preview the changes that would be made without actually applying them. This is useful for ensuring that the CSV file and script parameters are set correctly:

.\Add-SsoExclusionsFromCSV -Path 'c:\Example.csv' -HeaderName 'Email' -WhatIf

This command will display a simulation of the changes without making any actual modifications.

Further Help

If you need additional information about the script and its parameters, you can use the Get-Help PowerShell cmdlet:

Get-Help -Detailed .\Add-SsoExclusionsFromCSV.ps1

This command will provide detailed information about how to use the script and its available parameters.

By following these instructions, you can easily add users to the TeamViewer SSO exclusion list via CSV import, helping you manage user access more efficiently.