about Import Users problem from CVS file

Hi: I am not very clear that the following content needs to fill; $clientId = "Which ID" For example...... $clientSecret = "Which Secret" For example...... $authorizationCode = I visited https://webapi.teamviewer.com/api/v1/oauth2/authorize?response_type=code&client_id I entered my TeamViewer ID, but showed an invalid ID. Does anyone konw about it? Whisht.z

Comments

  • Whisht
    Whisht Posts: 2

    I have get the $clientId, $clientSecret and $authorizationCode.

    but, when I run the ImportUserCSV.ps1, i get the following error message:

     +         return $result1
    +         ~~~~~~~~~~~~~~~
    Flow of control cannot leave a Finally block.
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : ControlLeavingFinally

    Does anyone konw what it is problem? How can i fix it?

    Thanks,

    Whisht.Z

     

  • ameunier
    ameunier Posts: 6

    Same problem...

    I guess their is a stream leaving open but Power Shell is new for me so I can't debug.

  • ameunier
    ameunier Posts: 6

    I found this in an other forum and it works better (I still have problem because of a new error but I progress...) :

    "to anyone who has the same issue.. I found the problem and a few more. I was trying to run the script using powershell v4. This script from Teamviewer is only supported in version 2. 

    To execute powershell on version 2, execute the command on CMD

    Text
    powershell.exe - version 2
  • ameunier
    ameunier Posts: 6

    Si je saisi l'URL "https://webapi.teamviewer.com/api/v1/ping" dans un naviguateur, le serveur répond mais retourne une erreur "token_valid>false</token_valid>". C'est normal car la saisie dans la barre d'adresse du navigateur ne permet pas de préciser le token.

    En revanche, le script PowerShell fournit par TeamViewer contient une méthode "Ping" qui permet de construire l'appel à serveur Web en précisant le token.

    Le problème est que cette commande retourne une erreur : "Ping: Request failed! The error was 'Exception lors de l'appel de « Create » avec « 1 » argument(s) : « Échec de l'initialisation du système de configuration »'."

    Le code erreur ne vient pas du serveur Web, c'est le code PowerShell qui semble ne pas accepter la ligne de code. Pourtant, j'ai utilisé le même code pour appeler un autre serveur Web sans authentification et cela a fonctionné sans problème.

    Je ne comprend rien... quelqu'un peut m'aider ?

    (d'une manière générale, ça serait bien TeamViewer corrige ses scripts PowerShell datant de 2004 en premier lieu pour qu'il fonctionne en PowerShell v4...)