Is there a command or PS command to disable a specific W3C Logging Field?
I know you can just go to IIS manager and uncheck the box but I have a few hundred servers to do.
iislogging
Is there a command or PS command to disable a specific W3C Logging Field?
I know you can just go to IIS manager and uncheck the box but I have a few hundred servers to do.
Best Answer
There is a powershell command for this:
You can generate your command easily in the IIS GUI. Choose the server (top-level of IIS), then Configuration Editor. Go to section 'system.applicationHost/log'. Make your edits, then find the 'Generate Script' link.
Here is a quick example from something I use for our app servers.
If that gives you trouble, you could also use the appcmd tool with something like this (update MySiteName to your IIS site name, and id='6' to the ID of your web site):