Friday, 16 May 2014

Get WebApplication Name Using GUID

Get WebApplication Name Using GUID

Add-PSSnapin Microsoft.SharePoint.PowerShell

$url = "http://SERVER/sites/MyWebApp"
$site = Get-SPWeb ($url)
foreach ($web in $site.Site.AllWebs)
{
if ($web.Url.StartsWith($url))
{
Write-Host ($web.Name + "|" + $web.Url + "|" + $web.Id)
}
}
Now you will get Name and GUID, just check with GUID corresponding name.