Avatar of GreatSolutions
GreatSolutions
Flag for Israel asked on

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

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
Exchange

Avatar of undefined
Last Comment
SubSun

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
SubSun

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
GreatSolutions

ASKER
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?
GreatSolutions

ASKER
Easy to implement and saved me hours of fiddling with the encoding...
SubSun

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..
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
GreatSolutions

ASKER
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
SubSun

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

GreatSolutions

ASKER
I'll try that, thanks!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SubSun

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