标签:
Add-PSSnapin microsoft.exchange* Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $servers="mailbox1","mailbox2" $i_Object = New-Object PSObject foreach ($server in $servers) { $status=Get-MailboxDatabaseCopyStatus -Server $server | % {$_.status} if ($status | ? {$_ -notmatch "Healthy|Mounted" -and $_ -ne""} ) {$status = "1"} #1表示OK else {$status = "0"} #0表示bad $i_object | Add-Member -MemberType NoteProperty -name $server -value $status } $i_object |fl
标签:
原文地址:http://www.cnblogs.com/dreamer-fish/p/4644028.html