【发布时间】:2012-02-17 05:11:32
【问题描述】:
我正在编写一个用于 Exchange 2007 LCR 和 SCR 复制的监控脚本,以自动化我的一些日常工作,并确保其他人可以看到是否有问题。我的代码在下面,我的情况是其中一个数据库在重播队列中超过 2000 个日志。我知道脚本的恢复是有效的,因为如果我在没有 .count 的情况下检查输出,它确实会返回事务日志重放队列太高的数据库。有人可以向我解释我做错了什么以及为什么我不能计算输出吗?
#SCR Replay Queue Length Check
IF (($SCRstatusTable|? {$_.ReplayQueueLength -ge 2000}).Count -gt 0)
{
$SCRReplayQueueLengthHealth = "SCR replay queue length check: At least 1 instance
is reporting more than 2000 queued logs. Refer to detailed logs for more information."
}
ELSE
{
$SCRReplayQueueLengthHealth = "SCR replay queue length check: No instances
currently reporting more than 2000 logs queued for replay."
}
非常感谢任何帮助!我认为这是一个语法问题,因为我使用 .count 方法来计算其他集合输出没有问题。
【问题讨论】:
标签: powershell windows-server-2008 powershell-2.0 exchange-server exchange-server-2007