Forum Discussion

Re: Site Collection: Get Web Id fails

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
}

2 Replies

  • Edward_Chong's avatar
    Edward_Chong
    Copper Contributor

    Pieter Veenstra 

     

    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?

  • nileshvk's avatar
    nileshvk
    Copper Contributor

    I can confirm that there are bunch of site collections which has same Web Id. 2 things i want to mention here: 1) we have created these(bulk) site collections using PowerShell

    2) We are migrating data from SharePoint 2007 to these site collections.

Resources