kwizcom banner advertisement

Create Usage and Health Data Collection Service Application in SharePoint 2013 using PowerShell

Usage and Health data collection service application in SharePoint collects usage and health data from a variety of sources, including event logs, performance counters, search usage data, site collection and site usage data, and server statistics of the entire farm. There are timer jobs to collect data from log files in 16\LOGS folder where usage usage data is initially logged and then updated to the usage database.

Usage and Health Data Collection Service Application can be only created through PowerShell in SharePoint 2013. You'll get empty reports in Web Analytics reports section, if usage and health data collection service application isn't configured properly.
Usage and Health Data collection database that should not be part of the Availability Group!

Create Usage and Health Data Collection Service Application in SharePoint 2013 using PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Variables
$UsageSAName = "Hosting Farm Usage and Health Data Collection Service"
$DatabaseName = "HostingFarm_Usage_SA"
$DatabaseServer="SP13_SQL"
$UsageLogPath = "D:\UsageLogs\"

#Get the Usage Service Application Service Instance
$ServiceInstance = Get-SPUsageService 

#Create new Usage Service application
New-SPUsageApplication -Name $UsageSAName -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -UsageService $ServiceInstance #> $null

#Create Service Application Proxy..." 
$proxy = Get-SPServiceApplicationProxy | where {$_.TypeName -eq "Usage and Health Data Collection Proxy"}
$proxy.Provision()

#Set Usage Service Application Option
Set-SPUsageService -LoggingEnabled 1 -UsageLogLocation $UsageLogPath -UsageLogMaxSpaceGB 1 
Here is how it appear in Service applications page:
create usage and health data collection service application sharepoint 2013
SharePoint 2013 create usage and health data collection service application PowerShell
Please note, Only one instance of the usage and data collection service application can be created for a SharePoint farm! If you try to create one more, you'll get "A Usage Application already exists in this farm." error.
Create Usage and Health Data Collection Service Application in SharePoint 2013 using PowerShell Create Usage and Health Data Collection Service Application in SharePoint 2013 using PowerShell Reviewed by Salaudeen Rajack on 5:01 PM Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.