Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to enter non keyboard characters through script.

$
0
0

I have a new problem coming up  now.

We have bulk updates to be made on some of user attributes which involves updating their city name in Scandinavian format.

For ex. city name is to be updated for various users as "Äänekoski" but when i am trying to update through script i am getting it as "��nekoski".

I have a list of all users which needs city update in csv format. 

I am using to below script to perform this:

# Import CSV into variable $userscsv            

$users = Import-Csv -Path C:\users\admbharti.gupta\attributeTestExcel.csv            

# Loop through CSV and update users if the exist in CVS file            

 

foreach ($user in $users) {            

#Search in specified OU and Update existing attributes            

 Get-ADUser -Filter "SamAccountName -eq '$($user.LogonName)'" -Properties * -SearchBase "OU=MG,DC=mgr,DC=ads" |            

  Set-ADUser -Replace @{ l = "$($user.city)"}

 

Kindly provide some suggestions so that i can have successful update of this attribute without showing any question marks. 


Viewing all articles
Browse latest Browse all 6937

Trending Articles