Monthly Archives: July 2013

How to change the SharePoint web application physical IIS physical path

Recently, I needed to change the physical path of an already existing SPWebApplication.
This feature is not available from the Central Administration user interface. Of course the first option will be using SharePoint Management Shell.

Here are the steps to do that:

# Get the SPWebApplication using its url or id
$app = Get-SPWebApplication http://servername:port
# Display the currently set iis physical path
# Create a directory info object with the new required path
$newPathDirectoryInfo = New-Object -TypeName System.IO.DirectoryInfo -Argument List "F:\WebApplications\80"
# Assign the new directory info to the application iis settings
$app.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].Path = $newPathDirectoryInfo
# Update the application