This was because there was receiver for the usage services. The below code to be able to query the Service with the below code.
$aud = Get-SPUsageDefinition | where {$_.Name -like "Analytics*"}
$aud | fl
Then
$prud = Get-SPUsageDefinition | where {$_.Name -like "Page Requests"}
$prud | fl
Check for result and find the below parameter.
Enable receivers="false"
Receiver= {}
Notice there is no receiver attached.
The below code will apply the Microsoft extensions.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$aud = Get-SPUsageDefinition | where {$_.Name -like "Analytics*"}
if analytics usage definition receivers is empty then manually add back receiver
if($aud.Receivers.Count -eq 0)
{
$aud.Receivers.Add("Microsoft.Office.Server.Search.Applications, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c", "Microsoft.Office.Server.Search.Analytics.Internal.AnalyticsCustomRequestUsageReceiver")
}
if analytics usage definition receiver is not enabled then enable it
if($aud.EnableReceivers -eq $false)
{
$aud.EnableReceivers = $true
$aud.Update()
}
$aud | fl
$prud = Get-SPUsageDefinition | where {$_.Name -like "Page Requests"}
if page requests usage definition receivers is empty then manually add back receiver
if($prud.Receivers.Count -eq 0)
{
$prud.Receivers.Add("Microsoft.Office.Server.Search.Applications, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c", "Microsoft.Office.Server.Search.Analytics.Internal.ViewRequestUsageReceiver")
}
if page requests usage definition receiver is not enabled then enable it
if($prud.EnableReceivers -eq $false)
{
$prud.EnableReceivers = $true
$prud.Update()
}
$prud | fl
This will apply the receivers. Running the below code we can check the outcome.
$aud = Get-SPUsageDefinition | where {$_.Name -like "Analytics*"}
$aud | fl
Then
$prud = Get-SPUsageDefinition | where {$_.Name -like "Page Requests"}
$prud | fl
You will find Enable receiver is true and Receiver with path
After 24 hours the reports will start to populate information. This is pending on the timer jobs running which out of the box are set to run daily