Forum Discussion

Will_Hoch's avatar
Will_Hoch
Copper Contributor
Aug 22, 2022
Solved

Connect-SPOService Unexpected token error

Hello,   This is my first post ever so I apologize if I am missing obvious details.   I am writing a script in PowerShell that requires connecting SharePoint and I am doing so with the Connect-SP...
  • raindropsdev's avatar
    Aug 23, 2022

    Will_Hoch 

     

    A cursory search on google points to this:

    The most likely causes of the error are as follows:
    
        the UPN of the admin account used to connect to SharePoint Online contains special characters, for example - or _, or
        the admin account has abnormal/non-standard values defined in other properties.
    
    There are two known solutions to the problem:
    
        Use the UPN with the default onmicrosoft.com domain name (e.g. email address removed for privacy reasons) to connect to SharePoint Online in CodeTwo Backup.
        Use another global admin account (global admin or SharePoint admin) to configure a SharePoint connection in the program. Preferably, create a fresh account that does not include any problematic configuration or special characters in its UPN.

     

    https://www.codetwo.com/userguide/backup/troubleshooting-sharepoint.htm

Resources