Forum Discussion
Site Collection: Get Web Id fails
These are site collections. Itried this:
Connect-PnPOnline https://mytenant.sharepoint.com/Sites/Site1 -Credentials $cred Get-PnPWeb Connect-PnPOnline https://mytenant.sharepoint.com/sites/site2 -Credentials $cred
Get-PnPWeb
and I get :
Title Id ----- --------------------- -- Site 1 e19d8f5e-d966-44f7-829b-c9cd39a2c462 Site 2 e19d8f5e-d966-44f7-829b-c9cd39a2c462
Pieter Veenstra wrote:Are those site collections or sites?
I just ran this:
Connect-PnPOnline https://mytenant.sharepoint.com -Credentials $cred Get-PnPWeb Connect-PnPOnline https://mytenant.sharepoint.com/sites/site2 -Credentials $cred Get-PnPWeb Title ServerRelativeUrl Id ----- ----------------- -- My Team Site / e19d8f5e-d966-44f7-829b-c9cd39a2c462 Site 2 /sites/site2 0b3bc433-e3f1-4415-9154-97b624a59189
There are multiple site collections whhich has same Web Id. However Site Id is different for all the site collections. Also Sub Site's has unique ID's. This looks weird to me.
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_ChongMay 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?
- nileshvkSep 19, 2017Copper 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.