IIS Management Service Log Location

This topic contains 4 replies, has 3 voices, and was last updated by  Dodge Howell 4 years ago.

  • Author
  • #16446

    Dodge Howell

    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!

  • #16450

    Bucky Koehler

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


  • #16481

    Jason Helmick

    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'

  • #16491

    Dodge Howell

    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!

  • #16517

    Dodge Howell

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

    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!

You must be logged in to reply to this topic.