Solved

How to i enter hebrew characters in New-MailContact (CSV bulk import)

Posted on 2012-12-29
8
1,157 Views
Last Modified: 2012-12-31
Hi
I am trying to run a bulk import to my Exchange 2010 from a CSV file.
I run the following in a powershell script:

Import-Csv C:\contacts.csv | ForEach { New-MailContact -Name $_.displayName -Firstname $_.FirstName -LastName $_.LastName -ExternalEmailAddress $_.EmailAddress -OrganizationalUnit "YourDomain.Local/Contacts"

It runs great, but the problem is that the CSV file has hebrew characters, and those are entered as question marks instead. Is there some setting i am missing?

Thanks
Jaime
0
Comment
Question by:GreatSolutions
  • 4
  • 4
8 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38730023
The problem is that the .csv file was saved in the ANSI format. You can fix this by converting the file to unicode with the following comand before importing.

gc c:\old-file.csv | Out-File -en unicode c:\new-unicode.csv

Or you can just open the csv file in notepad and save it in unicode format before you run import-csv..
Unicode
0
 
LVL 2

Author Comment

by:GreatSolutions
ID: 38730609
Thanks, it does load the hebrew characters alright, although the Alias field is filled with question marks for all contacts, is there something i can do?
0
 
LVL 2

Author Closing Comment

by:GreatSolutions
ID: 38730610
Easy to implement and saved me hours of fiddling with the encoding...
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 40

Expert Comment

by:Subsun
ID: 38730679
Do you have problem after changing the encoding? if yes please post some sample words/usernames which you have issue, so I will test it..
0
 
LVL 2

Author Comment

by:GreatSolutions
ID: 38731106
I think i didn't explain well.
I opened the csv file and saved it as Unicode.
Then i run the import code from my first post, and it runs successfully, and when checking, all the contacts were created successfully *with correct hebrew characters*.
Just when browsing the contacts themselves, i noticed the Alias field (which is created automatically i guess, during the import ) is all question marks. I wondered if there was a way for me to set the value for this field so it's in hebrew as well.

Jaime
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38731710
If you have a list of contacts to modify, then you can try with set mailbox.. Something like the following should work..
Import-csv "c:\newalias.csv" | % {Get-MailContact - Identity $_.Name | Set-MailContact -Alias $_.Alias}

Open in new window

0
 
LVL 2

Author Comment

by:GreatSolutions
ID: 38732038
I'll try that, thanks!
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38732105
then you can try with set mailbox..
I mean Set-MailContact.. it's a typo.. :-)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
2 Iphones cannot have our Exchange email configured 20 89
Exchange 2013 Update 4 27
Unified EndPoint Management 1 24
Exchange 2013 certificate 8 35
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question