Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I created a site in IIS 7.5 via Powershell; however, the site inherited the parent handler mappings and one of the wildcard script mappings causes problems for this particular application. Is there a way to script removing a wildcard script mapping?

share|improve this question
    
Do you need to do this from a script or IIS MMC? –  Kev May 2 '12 at 19:26
    
I need to do it from a script because I need the setup of the site to be 100% hands-off –  Alex May 2 '12 at 20:13
add comment

2 Answers

If you have imported the module WebAdministration, you can use the Set-ItemProperty command on the IIS: drive, such as:

Set-ItemProperty "IIS:\Sites\Default Web Site" -name "Bindings" -value  @{protocol="HTTP";port="80"}

Note that this will replace all of your site bindings, so you will need to enter each one that you want to have in the value parameter.

share|improve this answer
add comment
up vote 0 down vote accepted

Thanks for the suggestion. I actually found a command that does exactly what I need:

C:\Windows\System32\inetsrv\appcmd.exe set config "<SITE_NAME>" -section:system.webServer/handlers /-"[name='<NAME_OF_HANDLER_MAPPING']"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.