# Remote Wildcard script mapping from site in IIS 7.5 with powershell

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?

-
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

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.

-

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']"

-