0

I'm trying to automate as much of our SharePoint builds as possible, but there is currently one part I'm getting hung up on.

Right now, my event log is filled with error 6398 and error 5586, which according to my Google-fu is rectified by enabling HEALTH data collection (not just usage).

I've examined the object returned by Get-SPUsageApplication, and the one returned by Get-SPUsageService. I've also tried looking at every cmdlet I can think of and the closest I can find for configuring anything to do with Health Collection is the trio of Get/Disable/Enable-SPHealthAnalysisRule.

I'd really like to believe that MS really wouldn't forget to add in a way to enable this without having to go through CA, but so far I haven't found it.

If there's a way to do it with stsadm I suppose that'll work for now.

0

you can try this:

Write-Host "Enabling Heatlth Data Collection..."
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Diagnostics")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")
$localFarm = [Microsoft.SharePoint.Administration.SPFarm]::Local
[Microsoft.SharePoint.Diagnostics.SPDiagnosticsProvider]::EnableAll($localFarm)

Enable Health Data Collection with PowerShell

  • I love you so much for this. – Chris Kennedy Nov 6 '15 at 14:42
  • After some further poking and going from what you gave me, I discovered the Get-SPDiagnosticsProvider is the cmdlet I was looking for. A nice foreach loop and setting .IsDisabled (really Microsoft, why not Enabled?) to $false on each object has the same effect. – Chris Kennedy Nov 6 '15 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.