Home > Mobile >  Get Command For Viewing IIS Logging Is Enabled Or Disabled
Get Command For Viewing IIS Logging Is Enabled Or Disabled

Time:04-27

Using cmd/PowerShell, I am trying to see if IIS logging is enabled or disabled. The command below should give the desired output, but it seems like it always returns true even when logging is disabled, is this the correct syntax?

Get-ItemProperty -Path 'IIS:\Sites\Default Web Site' -Name logfile | select enabled

Help is much appreciated!

CodePudding user response:

I think it is the correct synta. In my test, it work well. enter image description here

If it still cannot work in your environment, try this command to check if it can work.

Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/sites/siteDefaults/logFile" -name "enabled" | select value
  • Related