Forum Discussion

OfficeKundig's avatar
OfficeKundig
Copper Contributor
Dec 21, 2022

Sharepoint subsite(s) not visible running PnP powershell command

Using commands like:
  • Get-PnPTenantSite
  • Get-PnPSubWeb -Recurse -Connection $SubSiteUrl

>> Only the collections are visible but returns NO subsites.

Reason, I want to be sure the subsite is created before continuing making adjustments to something not existing -;)
The subsite(s) are available when I open the SharePoint collection!
(I am a global admin on the tenant)
Even after updating the online pnp powershell had no positive affect.
Please inform me how to check if there are subsites using PnP Powershell
 
Kind Regards,
Jan Sleeboom | OfficeKundig
 
$SubSiteUrl = "https://officekundigdev.sharepoint.com/sites/OfficeKundigTest/TestTemplate06"
$Title = "TestTemplate/06"

# Check if the SubSite is succesfully created
     $Site = Get-PnPTenantSite -Url $SubSiteUrl -ErrorAction SilentlyContinue

  If ($Site -eq $null)
     {
         Write-host -f Red "SubSite $Title failed to created! "
     }
     Else
     {
Write-Host -f Green "SubSite $Title succesfully created! "   

}

 
 
No RepliesBe the first to reply

Resources