Guys,
Our company is new to Solarwinds and writing powershell monitors to monitor Exchange. We've tried writing our own monitor and copying monitors from here, but only receive the message "loading - please wait" when trying to access an Exchange cmdlet. Here is an example of the code we're currently trying and again only shows loading.
$ErrorActionPreference = "silentlycontinue";
add-pssnapin Microsoft.Exchange.Management.PowerShell.Admin;
$Error.Clear();
$username = $args.get(0);
if ( !$username )
{
Write-Host "Message: Can't find "target_user" argument. Check documentation.";
exit 1;
}
$stat = (Get-MailboxFolderStatistics -Identity $username -FolderScope Inbox | select itemsinfolder).itemsinfolder;
if ($Error.Count -eq 0) {
Write-Host "Message: Items in mailbox $username : $stat";
Write-Host "Statistic: $stat";
Exit 0;
}
Write-Host "Message: $($Error[0])";
Exit 1;
The platform is set at x64, with impersonation running under an account that has priviledge for Exchange. Any help is appreciated.