Here is what I know:
I have a csv export from groupwise (attached here but only containing an example user)
I have to mail enable thousands of users in exchange 2013 CU2 and the AD objects exist:
1. target mailDB is called 'powerusers'
2. SamAccountName exists in a column in csv.
3. Logging of users not found in AD is a must
4. Logging of users found and email address applied is a must.
I know I can do something like this but i need the logging and target DB:( Please help.
ForEach ($User in (Import-CSV c:\scripts\mycsv.csv))
{ Enable-Mailbox -Identity $User.SamAccountName
}
Or even one line it:
Import-CSV c:\scripts\mycsv.csv | ForEach { Enabled-Mailbox -Identity $_.SamAccountName }
csv looks like this:
SourceAddress | TargetAddress | DisplayName | GivenName | Surname | Native | ObjType | Userid | samACCOUNTName | PostOffice | Department | Title |
wc13846.SD41-PO1.SD41-DOM1 | Vlodek.Czubak@sd41.bc.ca | Vlodek Czubak | Vlodek | Czubak | 1 | 0 | wc13846 | e13846 | SD41-PO1 | Maintenance | Electrician |