$installpath
= "c$\Program Files\Microsoft\Exchange Server\V14\Bin\ExSetup.exe"
Get-ExchangeServer | ?{$_.admindisplayversion -like "*14*"} | %{
$Servername
= $_.Name
$role =
$_.serverrole
$Path =
"\\" + $Servername + "\" + $installpath
$fileversion
= (Get-Command $Path).FileVersionInfo |ForEach {$_.FileVersion}
$result =
$Servername + "|" +
$fileversion + "|" + $role
$result
$result
>> result.txt
}