Reputation: 181
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!
Upvotes: 0
Views: 378
Reputation: 3042
I think it is the correct synta. In my test, it work well.
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
Upvotes: 1