- webApp = Get-SPWebapplication 'http://portal.mysite.com'
- foreach($spSite in $webApp.Sites)
- {
- if ($spSite.HostHeaderIsSiteName)
- { Write-Host $spSite.Url 'is host-named' }
- else
- { Write-Host $spSite.Url 'is path based' }
- }
PowerShell scripts to check if the site collection is Host Based or Path Based
Below are the Powershell commands to check if the site collection is either Host Based or Path. These commands would be very useful while migrating SharePoint 2010 to 2013.
