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,etc. is correct. can anyone suggest me what is going wrong here:
foreach ($row in $data)
{
Connect-PnPOnline -Url $row.Url -Credentials $creds
$web=Get-PnPWeb
write-host "web: " + $web.Title
write-host "web: " + $web.id
}