Forum Discussion
nileshvk
Sep 17, 2017Copper Contributor
Site Collection: Get Web Id fails
Hi Guys, I am using below code to get web Id of list of site collections using code below. The issue is i always get GUID of the first site collection howerver the other webinfo like Title, Url,e...
Sep 19, 2017
Do all you site collection have this problem?
the script below should list all your rootwebs
$cred = Get-Credential -Message "Password" -UserName admin@mytenant.onmicrosoft.com
Connect-PnPOnline https://mytenant.sharepoint.com -Credentials $cred
$sites = Get-PnPTenantSite
foreach ($site in $sites) {
Connect-PnPOnline $site.Url -Credentials $cred
$web = Get-PnPWeb
$web
}Edward_Chong
May 07, 2024Copper Contributor
I'm getting the same issue. We have ~500 group/team sites (not including private channels). I grabbed the site ID using the same script and I see many sites with duplicate ID's.
Did anyone have a resolution? Is there a different ID I can grab for the site collection?