iis 6 - How can I use PowerShell to set the default document in IIS? -


I am configuring a web site using PowerShell and I want to set the default document. How do i do this

This is a method:

  $ MetabasePath = "IIS: // localhost / w3svc "$ iisNumber =" 12345 "$ site = new-object system Directory Service Directory Enter ("$ Metabase Path / $ iisNumber / Route") $ site.psbase.Properties ["DefaultDoc"]. Value = "newdefdoc.htm," + $ site.psbase.Properties ["DefaultDoc"]. The value $ site.psbase.CommitChanges ()  

returned to the value $ Site.psbase.Properties ["DefaultDoc"]. Price is a comma separated list of documents, so you may have to revive the order in accordance with your case. The above example adds a new default document ( newdefdoc.htm ) at the top of the list.


Comments

Popular posts from this blog

SQL/PHP: Table design question -

NHibernate Passing Session to the Repository -

asp.net - How do I pass login ID as parameter to SharePoint login page? -