Change IIS Site Home Directory w/ Powershell

后端 未结 2 1654
暗喜
暗喜 2021-02-15 18:41

I can query the AD and find all the IIS sites and their virtual directories, now I need to be able to update those home directories and save the changes.

After I fetch t

相关标签:
2条回答
  • 2021-02-15 18:55
    Import-Module WebAdministration
    Set-ItemProperty 'IIS:\Sites\Default Web Site\' -name physicalPath -value $siteConfig.path
    

    http://technet.microsoft.com/en-us/library/ee909471(WS.10).aspx

    0 讨论(0)
  • 2021-02-15 19:19

    Ok, I tried this and it seems to work:

        $s.psbase.properties.path[0] = $siteConfig.path
        $s.psbase.CommitChanges()
    

    Is there a better cleaner way of handling this?

    0 讨论(0)
提交回复
热议问题