This is two first, first time posting to Thwack and first time trying to create a PowerShell Component Monitor.
We are moving away from SCM to Orionm but SCM allowed us to monitor on Exchange Search Index ContentIndexBackLog.
The powershell command to see that for a server is:
get-MailboxDatabaseCopyStatus <servername> | ?{$_.status -eq "Mounted"}| select name,ContentIndexbacklog
Here is the script I tried creating in SolarWinds, but it does not return any output.
$results= get-MailboxDatabaseCopyStatus -server ${ip} | ?{$_.status -eq "Mounted"}| select name,ContentIndexbacklog
foreach ($result in $results)
{
$stat=$result.ContentIndexBacklog
$Statistic.ContentBackLog = $stat
$Message.ContentBacklog ="$result.name $stat"
write-host $statistics.contentbacklog
write-host $message.contentbacklog
}
exit 0
Do I need to create an Exchange session, and how do you report back on array of data?