Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Extended characters not kept when creating new users

Reply
 
Old 02-03-2009   #1 (permalink)
Bruno


 
 

Extended characters not kept when creating new users

Hi
I received a list of users with extended characters in their names like "
röidste or O'Neil "
When i copy paste the name in AD, it works fine. However when i use
New-Qaduser to create the user in AD from the text file, I get blocks instead
of extended characters. O�Neill

Does one know what could be the cause of the problem ?

Thanks in advance


My System SpecsSystem Spec
Old 02-03-2009   #2 (permalink)
RichS [MVP]


 
 

RE: Extended characters not kept when creating new users

This worked for me

New-QADUser -ParentContainer 'Manticore.org/Test' -Name 'Jo O''Neill'
-FirstName Jo -LastName 'O''Neill' -SamAccountName jooneill
-UserPrincipalName jooneill@xxxxxx

Escape the ' by using 2
--
Richard Siddaway
All scripts are supplied "as is" and with no warranty
PowerShell MVP
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Bruno" wrote:
Quote:

> Hi
> I received a list of users with extended characters in their names like "
> röidste or O'Neil "
> When i copy paste the name in AD, it works fine. However when i use
> New-Qaduser to create the user in AD from the text file, I get blocks instead
> of extended characters. O�Neill
>
> Does one know what could be the cause of the problem ?
>
> Thanks in advance
>
My System SpecsSystem Spec
Old 02-03-2009   #3 (permalink)
Bruno


 
 

RE: Extended characters not kept when creating new users

Hi

sorry for the bad example, as the ' is already used in powershell, i
understand very well that it's to be treated and escaped. Is this also true
for the ö character ?
brgds
bruno

"RichS [MVP]" wrote:
Quote:

> This worked for me
>
> New-QADUser -ParentContainer 'Manticore.org/Test' -Name 'Jo O''Neill'
> -FirstName Jo -LastName 'O''Neill' -SamAccountName jooneill
> -UserPrincipalName jooneill@xxxxxx
>
> Escape the ' by using 2
> --
> Richard Siddaway
> All scripts are supplied "as is" and with no warranty
> PowerShell MVP
> Blog: http://richardsiddaway.spaces.live.com/
> PowerShell User Group: http://www.get-psuguk.org.uk
>
>
> "Bruno" wrote:
>
Quote:

> > Hi
> > I received a list of users with extended characters in their names like "
> > röidste or O'Neil "
> > When i copy paste the name in AD, it works fine. However when i use
> > New-Qaduser to create the user in AD from the text file, I get blocks instead
> > of extended characters. O�Neill
> >
> > Does one know what could be the cause of the problem ?
> >
> > Thanks in advance
> >
My System SpecsSystem Spec
Old 02-03-2009   #4 (permalink)
RichS [MVP]


 
 

RE: Extended characters not kept when creating new users

With characters like ö I've not had much success in the past
--
Richard Siddaway
All scripts are supplied "as is" and with no warranty
PowerShell MVP
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Bruno" wrote:
Quote:

> Hi
>
> sorry for the bad example, as the ' is already used in powershell, i
> understand very well that it's to be treated and escaped. Is this also true
> for the ö character ?
> brgds
> bruno
>
> "RichS [MVP]" wrote:
>
Quote:

> > This worked for me
> >
> > New-QADUser -ParentContainer 'Manticore.org/Test' -Name 'Jo O''Neill'
> > -FirstName Jo -LastName 'O''Neill' -SamAccountName jooneill
> > -UserPrincipalName jooneill@xxxxxx
> >
> > Escape the ' by using 2
> > --
> > Richard Siddaway
> > All scripts are supplied "as is" and with no warranty
> > PowerShell MVP
> > Blog: http://richardsiddaway.spaces.live.com/
> > PowerShell User Group: http://www.get-psuguk.org.uk
> >
> >
> > "Bruno" wrote:
> >
Quote:

> > > Hi
> > > I received a list of users with extended characters in their names like "
> > > röidste or O'Neil "
> > > When i copy paste the name in AD, it works fine. However when i use
> > > New-Qaduser to create the user in AD from the text file, I get blocks instead
> > > of extended characters. O�Neill
> > >
> > > Does one know what could be the cause of the problem ?
> > >
> > > Thanks in advance
> > >
My System SpecsSystem Spec
Old 02-03-2009   #5 (permalink)
Kiron


 
 

Re: Extended characters not kept when creating new users

If you're reading the list from a file with Get-Content, the file's encoding could be the cause.
If you can, overwrite the file with Set-Content and change its encoding to Unicode; if you can't overwrite it, create a new file with Unicode encoding:

# to overwrite and change encoding
(gc list.txt) | sc list.txt -encoding Unicode

# to create a new file
gc list.txt | sc newList.txt -encoding Unicode

--
Kiron
My System SpecsSystem Spec
Old 02-03-2009   #6 (permalink)
Bruno


 
 

Re: Extended characters not kept when creating new users

thanks for the tip
will have a try and advise.
brgds


"Kiron" wrote:
Quote:

> If you're reading the list from a file with Get-Content, the file's
> encoding could be the cause.
> If you can, overwrite the file with Set-Content and change its encoding to
> Unicode; if you can't overwrite it, create a new file with Unicode
> encoding:
>
> # to overwrite and change encoding
> (gc list.txt) | sc list.txt -encoding Unicode
>
> # to create a new file
> gc list.txt | sc newList.txt -encoding Unicode
>
> --
> Kiron
>
My System SpecsSystem Spec
Old 02-04-2009   #7 (permalink)
Bruno


 
 

Re: Extended characters not kept when creating new users

Hi
thanks again for your help
this worked fine !
brgds


"Kiron" wrote:
Quote:

> If you're reading the list from a file with Get-Content, the file's
> encoding could be the cause.
> If you can, overwrite the file with Set-Content and change its encoding to
> Unicode; if you can't overwrite it, create a new file with Unicode
> encoding:
>
> # to overwrite and change encoding
> (gc list.txt) | sc list.txt -encoding Unicode
>
> # to create a new file
> gc list.txt | sc newList.txt -encoding Unicode
>
> --
> Kiron
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Vista Contacts - extended characters import Vista mail
Vista Contacts - extended characters import Vista General
Creating Local Users PowerShell
Creating Extended / logical Parttion Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46