none
Copy-SPTaxonomyGroups : The remote server returned an error: (401) Unauthorized. RRS feed

  • Question

  • Hello,

    I tried to copy On-prem Taxonomy to Online. I used PowerShell command Copy-SPTaxonomyGroups.

    I get this response from PowerShell: 

    Copy-SPTaxonomyGroups : The remote server returned an error: (401) Unauthorized.
    At line:1 char:1
    + Copy-SPTaxonomyGroups -LocalTermStoreName "Managed Metadata Service"  ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (Microsoft.Share...PTaxonomyGroups:SPCmdletMigrateSPTaxonomyGroups) [Copy-SPTaxonomyGroups], WebException
        + FullyQualifiedErrorId : Microsoft.SharePoint.Taxonomy.Hybrid.Cmdlet.SPCmdletMigrateSPTaxonomyGroups

    I used both on-premises admin account or cloud-based global admin account, but with no luck. Two factor authentication disabled. Is somebody able to help me?

    Monday, July 22, 2019 11:22 AM

Answers

  • After some experimentation I found solution. In SharePoint Admin Center you have to allow access for apps that don't use modern authentication (if you disabled it before):

    https://<yourtenant>-admin.sharepoint.com/_layouts/15/online/AdminHome.aspx#/accessControl

    After this you have to wait a moment. PowerShell is probably using basic authentication, so this has to be enabled. Hopefully this helps someone.

    • Marked as answer by MARS(CZ) Tuesday, July 23, 2019 10:13 AM
    Tuesday, July 23, 2019 10:13 AM

All replies

  • After some experimentation I found solution. In SharePoint Admin Center you have to allow access for apps that don't use modern authentication (if you disabled it before):

    https://<yourtenant>-admin.sharepoint.com/_layouts/15/online/AdminHome.aspx#/accessControl

    After this you have to wait a moment. PowerShell is probably using basic authentication, so this has to be enabled. Hopefully this helps someone.

    • Marked as answer by MARS(CZ) Tuesday, July 23, 2019 10:13 AM
    Tuesday, July 23, 2019 10:13 AM
  • I faced similar problem. In my case I found that the account by which I logged on to the SharePoint Server was Term Store Administrator via an AD Group. The Copy-SPTaxonomyGroups command doesn't recognize the AD Groups. So I added that account explicitly in the on-prem Term Store Administrator and then my command ran successfully and the terms got copied to O365 successfully.

    Thanks,

    Ashish

    Thursday, August 29, 2019 12:43 PM