Forum Discussion
Damien Flood
Apr 11, 2017Iron Contributor
Site Collection: Get all subwebs
Hi all, Looking in PnP PowerShell examples and I am able to get all the subwebs of a site collection. But some of these subwebs also have subwebs. Not being a PS expert wondering if there...
- Apr 11, 2017You need to use
Get-PnPSubWebs -Recurse
paulpascha
Apr 11, 2017Bronze Contributor
Hi
I found this PowerShell script that doesn't make use of PnP Powershell. It recursively loops through all webs in a site collection based on methods available in CSOM. You could write such a script to do something similar using the PnP PowerShell approach but I guess this provides just what you are looking for.
https://gallery.technet.microsoft.com/office/Script-to-get-All-Webs-in-c2c1cdaf
Hope this helps