IIS Management Service Log Location

Welcome Forums General PowerShell Q&A IIS Management Service Log Location

This topic contains 4 replies, has 3 voices, and was last updated by

 
Participant
4 years, 3 months ago.

  • Author
    Posts
  • #16446

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Member
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    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!

The topic ‘IIS Management Service Log Location’ is closed to new replies.