Quantcast
Channel: General
Viewing all articles
Browse latest Browse all 7363

powershell command to get iis site home directory

$
0
0

Get home directory based off of site name

self solved

[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")

$siteName = "Monitor"


$serverManager = New-Object Microsoft.Web.Administration.ServerManager
$site = $serverManager.Sites | where { $_.Name -eq $siteName }
$rootApp = $site.Applications | where { $_.Path -eq "/" }
$rootVdir = $rootApp.VirtualDirectories | where { $_.Path -eq "/" }
$Path = $rootVdir.PhysicalPath
write $path


Viewing all articles
Browse latest Browse all 7363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>