Error exporting PLANNER data using Powershell

Hi all,

I am trying to export all PLANNER data due to a Tenant migration that is about to happen in the near future. So far I managed to export some users using the following Powershell code:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
Import-module "C:\PlannerUserContentExport\plannertenantadmin.psm1"
Export-PlannerUserContent -UserAadIdOrPrincipalName -ExportDirectory C:\PlannerExport


This last line repeats itself for all users. However, for some users I am getting the following error:

We couldn´t start your export. Error message: The remote server returned an error: (401)
Unauthorized. Support information: CorrelationId 02e15510-6d3e-4280-876b-424046f41335 At C:\PlannerUserContentExport\plannertenantadmin.psm1:164 char:9
+throw $exceptionToThrow
+CategoryInfo: NotSpecified:  (:) [], ParentContainsErrorRecordException


Any help is aprreciated.

Best regards,


Are you using Export user data from Microsoft Planner - Microsoft Planner | Microsoft Docs doc ?

From the error, it seems like a permission issue.