Help
Help

Reputation: 181

Get Command For Viewing IIS Logging Is Enabled Or Disabled

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

Answers (1)

Bruce Zhang
Bruce Zhang

Reputation: 3042

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

Upvotes: 1

Related Questions