Updated! Upload Hundreds of Contacts into your Exchange 2007 in 8 simple steps -
I previously posted an article on how to upload Contacts into Exchange 2007 from a CSV file (the article can be found here).
The script has always generated errors when face with situations where Contacts had Double First or Last names thanks to the white space between the names which cannot be used as an alias. So today, I revisited the script & did some research to try 'fix' this little bug.
About 10 mins into reasearching it, The Scripting Guys came to the rescue again with a brilliant article on Manipulating String Values in PowerShell.
Anyway, it was relatively simple to fix the script & here it is for download, along with the CSV file template which is bes populated using Microsoft Excel.
Download CreateContactsV2.0
The script has always generated errors when face with situations where Contacts had Double First or Last names thanks to the white space between the names which cannot be used as an alias. So today, I revisited the script & did some research to try 'fix' this little bug.
About 10 mins into reasearching it, The Scripting Guys came to the rescue again with a brilliant article on Manipulating String Values in PowerShell.
Anyway, it was relatively simple to fix the script & here it is for download, along with the CSV file template which is bes populated using Microsoft Excel.
Download CreateContactsV2.0




Worked like a charm bro .. thanks !
had to edit the script a bit cause the excel file i had contained first name and last name in the same cell casing it to fail and i wasn't about to edit 1500 names.
here are the changes i made
$entry = $_
$DN = $_.First
$a = $_.First.Replace(" ", "")
$Alias = $a
Glad it helped - scripts are funny like that though, for some reason they usually need to be tweaked to suit your particular requirement. This could possibly be because most scripts are developed to suit the developer's initial requirement...
Good job on the tweaking & poting the update though, nice to see feedback from other professionals out there
I'm glad to find this article it has all that i need.
Keep the good work.
Hi Johan,
This script is great.. Is there any easy way that contacts can be automatically added to groups when they are imported?
Thanks..
Hi Nass,
Glad you found the script useful. It is possible to manage and maintain your groups using scripts but you will have to use the ldifde tool. Unfortunately I do not have such a script as csvde has always been sufficient for my requirements (as a consultant, user administration is not something I usually work with.)
There is plenty of information available on the web that can help you build up this script.
Hope this helps.
Regards,
Johan
Is there a way to make the contact list without making the mailbox. I am just trying to make my users who are all ready in the GAL show up in the global Contact's so there info will be pushed out to the mobile phones.
Hi Joseph,
I am a little confused here, are you looking to email enable existing contacts or to make existing users show up in the GAL?
By default all users & contacts that are email enabled would show up in the GAL and only users / contacts that are not email enabled would not show up. My question would therefore be; If the users are not showing up in the GAL then they have no Exchange Mailbox, do they have a mailbox on another platform? If so, then you have to create a contact object for each user as well as their user account. The contact object needs to be email enabled where the user object remains untouched.
I hope this makes sense and answers your question.
I think your script is the most straight forward of what I have found on the net. Could you direct me to where I can find the hooks to expand your script to use more of the available AD fields. I want to move our public folder contacts over to AD, but I want to maintain as much of the info as possible (multiple phone number, the address, notes, etc...). Thank you.
Hi Lee,
Glad you found it helpful & straight forward.
The best advice i can give you is to start by using CSVDE to export a contact object with all the desired fields filled in - this will give you the necessary table structure & field names for the info you want to fill. (I would suggest using a dummy contact)
Once you have this file, you can delete the dummy contact then using exchange powershell, just type the cmdlets that i call in the script to create / update the proprties, you can find every switch for the command by pressing TAB after a "-".
Alternatively, you can refer to the Exchange Help for the cmdlet which you are running, there should be a list of possible switches.
Once you have these, you just need to ensure the table exists and then add the switch to the script file with the value $_.<CSVColumnName> as the input for the switch.
It should work for you.
Regards,
Johan