Montag, 13. Februar 2012

How to get the IIS-directory of a webapplication with Powershell

There might be the need to get the IIS absolute path of your webapplication.
Here is the Powershell-script with which you can achieve that:

function GetIISPath ([string] $webApplicationName)
{
foreach($app in Get-SPWebApplication)
{
if($app.Name -eq $webApplicationName)
{
$IISSettings = $app.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default]
Write-Host $IISSettings.Path
}
}
}



This function writes the absolute path of the overloaded webapplication-name.


Keine Kommentare:

Kommentar veröffentlichen