# Get targetAddress attribute for a bunch of users
#
# $csv = Import-Csv "c:\Temp\UserList.csv" 
# foreach ($record in $csv)
# {
# $record = Get-QADUser  -Properties * | select targetAddress |Export-Csv "c:\Temp\UserTargetAddList2.txt" 
# }
###############################


#Import-Csv c:\Temp\UserList.csv | %{ Get-QADUser -User $_.SamAccountName } |Export-Csv "c:\Temp\UserTargetAddList2.txt"

#get-Qaduser -ldapfilter '(targetAddress=*rwe.com)' |Export-Csv "c:\Temp\UserTargetAddList2.txt"

 Get-QADUser garnt03 -Properties * |select targetAddress |Export-Csv "c:\Temp\UserTargetAddList2.txt"


# For Powershell ISE : Get-ADUser alb100 -Properties *| select targetAddress







#$user = Import-Csv "c:\Temp\UserList.csv" | % {Get-QADUser $_.User | Get-QADUser -ObjectAttributes @{targetAddress="SMTP:$($_.targetAddress)"}} |Export-Csv "c:\Temp\UserTargetAddList2.csv"
#get-qaduser | where{$_.targetAddress} | format-table displayname

#$Target = "ud1.utility/Accounts" 
#Get-QADUser -SearchRoot $Target `
#| Get-QADUser igbia01 -Properties * |select targetAddress |Export-Csv "c:\Temp\UserTargetAddList2.txt"