Hello Michael,
If you want to output some information, you can add a record to the Execution Log of the operation using the $Context.LogMessage method. For more information, see ExecuteScriptContext. The execution log of the Custom Command will be displayed in Adaxes Web Interface once the Custom Command is executed.
So, to output the information that is returned by the Get-MailboxDatabaseCopyStatus cmdlet, you need to pass the collection of database copy status entries that this cmdlet returns into a foreach loop and output information on each entry as a separate log entry. Here's a sample script that you can use:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
$databaseCopyStatuses = Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus
foreach ($databaseCopyStatus in $databaseCopyStatuses)
{
$logMessage = $databaseCopyStatus.Name + " : " + $databaseCopyStatus.Status + " ; " `
+ $databaseCopyStatus.CopyQueueLength + " ; " + $databaseCopyStatus.CopyQueueLength + " ; "`
+ $databaseCopyStatus.ReplayQueueLength + " ; " + $databaseCopyStatus.LastInspectedLogTime`
+ " ; " + $databaseCopyStatus.LastInspectedLogTime + " ; " + $databaseCopyStatus.ContentIndexState
$Context.LogMessage($logMessage, "Information")
}
For more information on the properties of a database copy status entry that you can get, see the description of the DatabaseCopyStatusEntry Class on MSDN.