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?
Reporting an Issue or Missing Feature
I am reporting a bug.
Through troubleshooting I found the cmdlet
Get-PNPUserProfilePropertyreturns a trailing slash for the variable PersonalURL. Without this trailing slash, consuming the value later inSet-PNPTenantSiteworks 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:Steps to reproduce behavior
What is the version of the Cmdlet module you are running?
1.5.0
Which operating system/environment are you running PnP PowerShell on?