Looking online, I have not seen any information on how to capture the status of the logging function on the IIS console and I was hoping to see if anyone knew how to do this via cmd/PowerShell? I am trying to see if the logging component is enabled/disabled via the command-line interface.
-
Have a read of these which should get you started, once you have a powershell script which you need help with update your question: learn.microsoft.com/en-us/iis/configuration/… stackoverflow.com/help/how-to-askDavid Martin– David Martin2022-04-19 14:14:13 +00:00Commented Apr 19, 2022 at 14:14
Add a comment
|
1 Answer
you could use the below PowerShell command to check the iis logging is enabled or not and other details:
Import-Module -Name WebAdministration
Get-ItemProperty -Path 'IIS:\Sites\Default Web Site' -Name logfile
1 Comment
Help
Hello, thank you for the assistance, I have just tested the PowerShell command and it seems even if the logging setting is set to disable, the enabled line within the command output is set to True at all times. I have also, restarted the IIS service to make sure the disable/enable setting is successfully enforced.
