I have a Window 2008 server with Plesk installed, and I am working on a project to build a Powershell cmdlet that will allow me to add a 500-100.asp error page to IIS.
Now I know how to build the cmdlet, what I'm not sure of is how to interface with IIS from powershell. I have the IIS Snapin for IIS installed, however I'm not sure how complete this with that. I've also tried importing the WebAdministration Module, which I have an idea how to do it with that, however I'm not sure I have the right Syntax for that.
Here's what I have so far:
import-module WebAdministration
add-WebConfiguration -Filter /System.WebServer/HttpErrors -Value @{StatusCode=500-100;PrefixLanguageFilePath="$Null"; Path="http://smartertest.com"; ResponseMode="Redirect"} -PSPath "IIS:\smartertest.com/error_docs/500-100.asp"
Normally what I have to do to enable this error page, is copy the file from a network shares into C:\inetpub\vhosts\smartertest.com\error_docs, and then open IIS >> Go to the Site >> Open the Error Pages >> Add >> 500.100 >> Slect Execute a URL on this site >> enter /error_docs/500-1000.asp and click ok.
Can anyone think of an efficient, powershell friendly way to do this? Your help is appreciated, and I will be sure to acknowledge your contribution. Thanks.

New Topic/Question
Reply



MultiQuote



|