I have a legacy email list given to me and it contains email address only in text document.
I need to use this information to export logon name from AD out to text or csv file so I can then use this information to populate new distribution list. Bit stuck at the moment.
I have tried unsuccessfully :
$users = Import-Csv c:\temp\file.csv
outUsers = @()
Foreach ($user in $users)
{
$outUsers += Get-Mailbox $user | Select-Object PrimarySmtpAddress ,Alias
}
$outUsers | Export-Csv c:\temp\UserLogon.csv -NoTypeInformation
Yasar