# Nagios Exchange 2010 DAG Name from Member Detection Script # Author: Andy Grogan # Version 1.0 # www.telnetport25.com # ---------------------------------------- # Compatibility: # ---------------------------------------- # Nagios Version: 3.x # Exchange Version: 2010 # Powershell Version: 2.0 # NSClient++ Version: 3.x # ---------------------------------------- Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $cName = gwmi Win32_ComputerSystem | Select Name $DAG = Get-MailboxServer -id $cName.Name | Select DatabaseAvailabilityGroup if($DAG -ne $null){ $Result = $DAG.DatabaseAvailabilityGroup.Name $NagiosStatus = "0" }else{ $Result = "This Server is not part of a DAG" $NagiosStatus = "0" } Write-Host $Result exit $NagiosStatus