Hi Guys,
weeeelll ... I know I really shouldn't do another man's work - breeds bad habits - buuut I was bored, had an idea and well ... just did it:
function Get-RecipientExchangeVersion
{
[CmdletBinding()]
Param (
[Parameter(ValueFromPipeline = $true, Mandatory = $true)]
[Object[]]
$Recipient
)
Begin
{
$Server = @{ }
Get-MailboxServer | %{ $Server[$_.Name] = $_.AdminDisplayVersion }
$Databases = @{ }
Get-MailboxDatabase | %{ $Databases[$_.Name] = $Server[$_.Servers[0].Name] }
}
Process
{
foreach ($R in $Recipient)
{
$Props = @{
DistinguishedName = $R.DistinguishedName
Mail = $R.PrimarySmtpAddress
Database = $R.Database
ServerVersion = $Databases[$r.Database.Name]
}
New-Object PSObject -Property $Props
}
}
End
{
}
}
This function expects the output of Get-Recipient as input and may or may not work for all types of recipients available.
Usage:
$Recipients = Import-Csv C:\dump\users.csv | Select -expand emailAddress | Get-Recipient
$Results = $Recipients | Get-RecipientExchangeVersion
$Results
Of course you need to add the function above first.
Cheers,
Fred