I'm assming to get what I want I need to use Get-WebConfigurationProperty. How would I use this on the server itself? (i.e., when double-clicking on server name then selecting Logging in Inetmgr).
Thanks for the quick reply. I ran the script and it works well but the script reports logging for the IIS site level. I want to check logging that is set on the server level (double-clicking on the server name from inetmgr then selecting Logging).
jagojago12
11 Posts
Programmatically use PoSH for getting IIS W3C logging fields?
Feb 28, 2012 11:35 PM|LINK
Hi all,
Newbie to this forum :)
Is there any way to use PoSH to grab what fields are selected in IIS W3C logging fields?
The closest I've research to is it appears this command can set the W3C logging fields.
Set-WebConfigurationProperty system.applicationHost/sites/siteDefaults -Name logFile.logExtFileFlags -Value "Date, Time, ClientIP, UserName, Method, UriQuery, HttpStatus, Referer"
I'm assming to get what I want I need to use Get-WebConfigurationProperty. How would I use this on the server itself? (i.e., when double-clicking on server name then selecting Logging in Inetmgr).
Thank you
fab777
926 Posts
Re: Programmatically use PoSH for getting IIS W3C logging fields?
Feb 29, 2012 08:19 AM|LINK
Hi,
Clint Huffman shared great powershell scripts. There is one about what you want (Get-IisLogConfiguration.ps1)
Get here : http://blogs.technet.com/b/clinth/archive/2011/12/04/my-iis7-powershell-scripts.aspx
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
jagojago12
11 Posts
Re: Programmatically use PoSH for getting IIS W3C logging fields?
Feb 29, 2012 09:11 PM|LINK
Thanks for the quick reply. I ran the script and it works well but the script reports logging for the IIS site level. I want to check logging that is set on the server level (double-clicking on the server name from inetmgr then selecting Logging).
Is this possible?
Leo Tang - M...
4161 Posts
Microsoft
Re: Programmatically use PoSH for getting IIS W3C logging fields?
Mar 01, 2012 06:00 AM|LINK
Hi,
It can be done by using following cmdlet:
Get-WebConfigurationProperty -filter //log/centralW3CLogFile -name logExtFileFlags -PSPath:IIS:\
Thanks.
Feedback to us
Develop and promote your apps in Windows Store
jagojago12
11 Posts
Re: Programmatically use PoSH for getting IIS W3C logging fields?
Mar 02, 2012 06:41 AM|LINK