This project has moved and is read-only. For the latest updates, please go here.

Setting Log paths

Apr 19, 2011 at 2:58 PM

First of all, I love the script and we will use this script for installation over 100 servers.   I searched this discussion but I couldn't find the thread setting the log path.   So I wrote the simple PowerShell script to perform this - including Trace Log path and Usage/Health Data log path.  

Function Change-LogPaths
  if (!(Test-Path -path D:\Logs\SharePoint))
    New-Item d:\Logs\SharePoint -type Directory
  Write-Host -ForegroundColor White " - Setting trace log path..."
  Set-SPDiagnosticConfig -LogLocation D:\Logs\SharePoint

  $GetSPUsageApplication = Get-SPUsageApplication
  If ($GetSPUsageApplication -ne $Null)
    Write-Host -ForegroundColor White " - Setting Usage and Health Data log path..."
    Set-SPUsageService -UsageLogLocation D:\Logs\SharePoint


Thanks, Leo

Dec 17, 2011 at 4:16 PM

Hi there and sorry for very very late reply! This has actually been implemented in recent releases, have a look... thanks for the excellent suggestion!