Skip to content

[BUG] Set-PnPTenantSite - Managed path is not a managed path in this tenant #549

@Deweyoxberg

Description

@Deweyoxberg

Reporting an Issue or Missing Feature

I am reporting a bug.

Through troubleshooting I found the cmdlet Get-PNPUserProfileProperty returns a trailing slash for the variable PersonalURL. Without this trailing slash, consuming the value later in Set-PNPTenantSite works as intended.

Expected behavior

Set-PNPTenantSite -URL "https://contoso-my.sharepoint.com/personal/TargetUser/ -Owners "AdminUser@contoso.com" should correctly set AdminUser to be an Owner of the OneDrive for TargetUser.

Actual behavior

Set-PNPTenantSite -URL "https://contoso-my.sharepoint.com/personal/TargetUser/ -Owners "AdminUser@contoso.com" instead returns:

Set-PNPTenantSite : The managed path <urlremoved> is not a managed path in this tenant.
At line:1 char:1
Set-PNPTenantSite -URL $OneDriveURL -Owners $SiteCollAdmin
CategoryInfo : WriteError: (:) [Set-PNPTenantSite], ServerException
FullyQualifiedErrorID : Exception,PNP.Powershell.Commands.SetTenantSite

Steps to reproduce behavior

$AdminURL = "https://contoso.sharepoint.com"
Connect-PNPOnline -URL $AdminURL
$UserID = "TargetUser@contoso.com"
$SiteCollAdmin = "AdminUser@contoso.com"
$OneDriveURL = Get-PNPUserProfileProperty -Account $UserID | Select PersonalURL -ExpandProperty PersonalURL
If ($OneDriveURL -eq $Null){
Write-Host "OneDrive account does not exist for $UserID"}
Else {
Set-PNPTenantSite -URL $OneDriveURL -Owners $SiteCollAdmin}

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

1.5.0

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

  • Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions