Changing IIS6 Site Home Directory with Powershell
$server = "localhost"$siteName = "mysite"$iis = [ADSI]"IIS://$server/W3SVC"$site = $iis.psbase.children | where { $_.keyType -eq "IIsWebServer" -AND $_.ServerComment -eq $siteName }$path = [adsi]($site.psbase.path+"/ROOT")$path.path$path.psbase.properties.path[0] = "D:\Sites\$siteName\www2"$path.path$path.psbase.CommitChanges()