Problem re-importing CSV
I recently imported a CSV into exchange 2007 using import-csv:[PS] C:\>Import-Csv emailz.csv| foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database "Mailbox Database" -org Users -Password $Password}but each one of them errored out because I forgot to include the 'alias' entry in the csv. I fixed the CSV, and now when I try to re-import it, I'm getting the following errors:Import-Csv : The member "szymon.rybczynski" is already present.At line:1 char:11+ Import-Csv <<<< emailz.csv| foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database "Mailbox Database" -org Users -Password$Password}How can I remove that member, along with all the other invalid entries that my previous import added? I've re-installed Exchange 2007 already with the *same* result. I've also scoured through AD and cannot find any remnants of these 'ghost' users. Any help would be greatly appreciated!
June 9th, 2007 5:17pm
Rather than remove you have have already, it might be easier to modify your existing entries. Here's an example.
http://www.exchangepedia.com/blog/2006/12/id-written-about-how-to-bulk-create.html
Tony
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2007 3:02am
The input is appreciated, but unfortunately the users seem to not exist![PS] C:\>Get-UserName RecipientType---- -------------Administrator UserMailboxGuest UserSUPPORT_388945a0 Userkrbtgt UserIUSR_SMITHWICKS UserIWAM_SMITHWICKS UserAndrew Pace UserI 'imported' around 200 users...I need to find out where it added the users during the broken import first...
June 10th, 2007 5:41pm
what was the exact error you received when you first tried to create the mailboxes using the CSV? The error you're getting "the member <user> is already present" isn't an error I would expect to see when adding new mailboxes.
when you say you forgot the 'alias' entry in the CSV, what do you mean? That you omitted the alias column header? or that you included the alias column header, but omitted the values in that column (in effect, shifting each subsequent row one column over so that Name could have become alias, UPN could have become name, etc).
What do you get when you run Get-Mailbox? Get-Recipient?
I attempted to repro what you are seeing and I'm unable to.
The more info you can provide, the better.
Free Windows Admin Tool Kit Click here and download it now
June 11th, 2007 4:49am
foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database "Mailbox Database" -org Users -Password $Password}the CSV looked like this:username,email@domain.comThe *CORRECT* import should have been something like this:username,alias,email@domain.comcorrect?I can't recall the error when I was originally importing the domains...I'm assuming UPN == email address, and both the usernames and aliases are the same, so that really doesn't matter....
June 11th, 2007 8:08pm
So I re-installed Exchange to wipe EVERYTHING I've done, and guess what? Same problem! I can add users manually using the following example:[PS] C:\>New-Mailbox -alias logan -name logan -UserPrincipalName logan@midphase.com -database "mailbox database" -org Users -Password $PasswordName Alias ServerName ProhibitSendQuota---- ----- ---------- ---------------logan logan singleho-4zt2ce unlimitedHowever, when I try to run my foreach command, I get an error: [PS] C:\>Import-Csv emailz.csv| foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database "Mailbox Database" -org Users -Password $Password}Import-Csv : The member "szymon.rybczynski" is already present.At line:1 char:11+ Import-Csv <<<< emailz.csv| foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database "Mailbox Database" -org Users -Password$Password}SOOOO, this leads me to think that my foreach hack is just plain wrong. Any ideas on what should actually be used?I've tried to echo what it *thinks* is $_.alias only to result in the same error:Import-Csv : The member "szymon.rybczynski" is already present.At line:1 char:11+ Import-Csv <<<< emailz.csv
Free Windows Admin Tool Kit Click here and download it now
June 11th, 2007 11:25pm
NEVERMIND. I've been way up way too long apparently. I just had to fix the CSV...Alias,Name,UPN
June 12th, 2007 12:28am