1

Can you please help in finding a way to change Validate Request to True/False in IIS using PowerShell for a website?

Enrico Campidoglio
  • 56,676
  • 12
  • 126
  • 154
PowerShell
  • 1,991
  • 8
  • 35
  • 57

2 Answers2

2

You can modify the configuration settings of a specific web site or application using the Set-WebConfiguration cmdlet.

In your case you'll have to set the value of the <pages validateRequest="true" /> attribute to false:

Set-WebConfiguration "//system.web/pages/@validateRequest" IIS:\Sites\MyWebSite -Value $false
Enrico Campidoglio
  • 56,676
  • 12
  • 126
  • 154
0

According to this Canceling request validation using HttpHandler on IIS 7 and this Canceling request validation using HttpHandler on IIS 7

You should just change registry setting, so this code should do the trick for you:

Set-ItemProperty -path HKLM:\Software\Microsoft\ASP.NET -name VerificationCompatibility -Value 1
Community
  • 1
  • 1
Andrey Marchuk
  • 13,301
  • 2
  • 36
  • 52