Sharepoint 2010 Powershell: How To List All Web Applications via Powershell


mit diesem Code listet ihr alle Web Applikationen in einem Sharepoint-Farm:

den Code mit dem Notepad als “.ps1” Datei speichern und als Administrator (natürlich auf dem SP-PC) ausführen:

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null

$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()
$sitecollections = "";
$weburl = "";
$webappname = "";
foreach ($websvc in $websvcs) {
		foreach ($webapp in $websvc.WebApplications) {
			 $webappname = $webapp.Name
						foreach ($site in $webapp.Sites) {
							$site.URL ;
						}

		}
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s