IIS Management Service Log Location

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by Profile photo of Dodge Howell Dodge Howell 2 years, 5 months ago.

  • Author
    Posts
  • #16446
    Profile photo of Dodge Howell
    Dodge Howell
    Participant

    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
    Profile photo of Bucky Koehler
    Bucky Koehler
    Participant

    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

  • #16481
    Profile photo of Jason Helmick
    Jason Helmick
    Keymaster

    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
    Profile photo of Dodge Howell
    Dodge Howell
    Participant

    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
    Profile photo of Dodge Howell
    Dodge Howell
    Participant

    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.