IIS Management Service Log Location

Hi all,

I am new to PowerShell and scripting in general, however I’ve been learning in order to assist with my administrative duties. One of those is installing and configuring IIS. One of the tasks that I’d like to do is move the IIS Management Service logs from %SystemDrive%\Inetpub\logs\WMSvc to D:\Inetpub\logs\WMSvc however I can’t seem to find that location in the registry or the correct command. I was hoping that you all might have a recommended idea.

Thank you!

Look at the Web Server (IIS) Administration Cmdlets in Windows PowerShell (Import-Module WebAdministration)

http://stackoverflow.com/questions/4626791/powershell-command-to-set-iis-logging-settings

You can also quickly set individual website log gin locations using something like this:

set-ItemProperty -Path IIS:\Sites\TestWebSite -Name Logfile.directory -Value ‘c:\whatever’

Thank you all very much for helping! I was able to set the default logging directory of all the sites using:

$defaultLogDir = "D:\Inetpub\logs\"
Set-WebConfigurationProperty "/system.applicationHost/sites/siteDefaults" -name logfile.directory -value $defaultLogDir

But I’m still stumped on how to change the log locations for the Web Management. I’ll keep on plugging away!

I finally figured it out. After changing the directory manually the registry location either populated or (more likely) became more obvious to me. :slight_smile:

To change the logging directory I modified the Registry Key Value using:

Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WebManagement\Server -Name LoggingDirectory -Value D:\whateveryouwant

Thanks again for all the help!