Skip to content

[BUG] Request-PnPPersonalSite - ERROR: The remote server returned an error: (403) Forbidden. #2553

@ITAndy23

Description

@ITAndy23

Reporting an Issue or Missing Feature

Error running command
Request-PnPPersonalSite -UserEmails $Upn

  • ERROR: The remote server returned an error: (403) Forbidden.

Expected behavior

Expect the command to provision the OneDrive site

Actual behavior

HResult : -2146233087CategoryInfo : InvalidOperation: (:) [Request-PnPPersonalSite], PSInvalidOperationExceptionFullyQualifiedErrorId : InvalidOperation,PnP.PowerShell.Commands.Admin.RequestPersonalSiteException: The remote server returned an error: (403) Forbidden.Stack:

Steps to reproduce behavior

Connect-PnPOnline -Url 'https://$Tenant-admin.sharepoint.com' -ClientId $ClientId -ClientSecret $ClientSecret
Request-PnPPersonalSite -UserEmails $Upn

ClientId and Secret were generated via SPO
ClientId was giving the following permission:
<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="FullControl" /> </AppPermissionRequests>

What is the version of the Cmdlet module you are running?

1.12.0

Which operating system/environment are you running PnP PowerShell on?

  • [] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • [ X] Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions