Use this small script to get the ID or GUID of a site(web) in your SharePoint environment.
Don't forget to change the webURL to your site URL!
Script:
# Starting the script
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
$webURL = "http://mySPServer/sites/mySite"
$web = Get-SPWeb -Identity $webURL
$web.ID
Script:
# Starting the script
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
$webURL = "http://mySPServer/sites/mySite"
$web = Get-SPWeb -Identity $webURL
$web.ID