import-csv to find exchangeserver per user?

Import-Csv C:\dump\users.csv | Foreach {get-exchangeversion -Identity $_.emailAddress}

The term 'get-exchangeversion' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
he spelling of the name, or if a path was included, verify that the path is correct and try again.
t line:1 char:40

trying to verify if my users are on exchange2013 or ex2007 servers.

no custom function named Get-ExchangeVersion


July 28th, 2015 10:01am

Do you have some custom function named Get-ExchangeVersion?

You need to supply some information in your questions or we can't help you very well.

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 10:20am

trying to verify if my users are on exchange2013 or ex2007 servers.

no custom function named Get-ExchangeVersion

July 28th, 2015 10:42am

trying to verify if my users are on exchange2013 or ex2007 servers.

no custom function named Get-ExchangeVersion

So why are you trying to use that function then?

Are you asking how you would check?

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 10:43am

hello

yes I would like to check only the users currently in a csv.

the csv contains smtp address only.

July 28th, 2015 10:56am

Import your CSV and then loop through each address, checking your various servers to see if there's a match.

If you don't know how to use Exchange, I'd suggest asking in the Exchange forums.

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 10:59am

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

July 28th, 2015 11:34am

thank you.

I was thinking that since I can get the property of ExchangeVersion just from running:

get-mailbox myuser|ft displayname, ExchangeVersion

if should be able to import-csv a file to just limit the return of users.

trying to get a better understanding of PS>

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 1:16pm

get-aduser <name> -properties homeMDB, msExchHomeServername   wont do the trick for you?
July 29th, 2015 2:26am

This would be enough for me.. i guess (there is really no need to use Exchange cmdlets)

$csv = Get-Content .\CSV\emailaddress.csv
foreach ($address in $csv)
{
 $ldapfilter = "proxyaddresses=smtp:$($address)"
 Get-ADUser -LDAPFilter "($ldapfilter)" -properties homemdb,msExchVersion |select name,homemdb,msExchVersion 
} 

Free Windows Admin Tool Kit Click here and download it now
July 29th, 2015 2:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics