I am using scripts to create user logins in AD with Windows 2003 domain
controllers. When I try to create a user with the CN name being something
like "Blow, Joe" my script chokes. I can create a login with a CN name of
"Blow Joe", with a space, but not a comma. I get the rror message "Active
Directory: An invalid Active Directory pathname was passed." Same problem
when I try to read a specific CN that has a comma in it with a script. The
script chokes.

However, if you create a login using the utility Active Directory Users and
Computers, by default the CN name is created in the form of "Blow, Joe."
Also you can go in on the gui and manually change the CN name to contain a
comma.

Any suggestions on how to create a CN name with scripting?

Re: Commas in the CN name by Wayne

Wayne
Wed Jun 16 15:03:21 CDT 2004

"Phill Prescott" <pap@choa.org> wrote in
news:uQrwp28UEHA.2508@TK2MSFTNGP12.phx.gbl:

> I am using scripts to create user logins in AD with Windows 2003
> domain controllers. When I try to create a user with the CN name being
> something like "Blow, Joe" my script chokes. I can create a login with
> a CN name of "Blow Joe", with a space, but not a comma. I get the rror
> message "Active Directory: An invalid Active Directory pathname was
> passed." Same problem when I try to read a specific CN that has a
> comma in it with a script. The script chokes.
>
> However, if you create a login using the utility Active Directory
> Users and Computers, by default the CN name is created in the form of
> "Blow, Joe." Also you can go in on the gui and manually change the CN
> name to contain a comma.
>
> Any suggestions on how to create a CN name with scripting?
>
>
>

You need to escape the , with a \

CN=Blow\, Joe

Wayne

--
Standard Disclaimer: I said it, they didn't, so blame me, not them!
Spam Avoidance: My reply address is invalid to confuse the spambots.
You can reach me at 'Wayne_Tilton at yahoo dot com'

Re: Commas in the CN name by Roland

Roland
Wed Jun 16 15:47:32 CDT 2004

"Wayne Tilton" <Wayne_Tilton@NoSpam.Yahoo.com> wrote in message
news:Xns950A84CF6EEB5NWDCLMIT@207.46.248.16...
: "Phill Prescott" <pap@choa.org> wrote in
: news:uQrwp28UEHA.2508@TK2MSFTNGP12.phx.gbl:
:
: > However, if you create a login using the utility Active Directory
: > Users and Computers, by default the CN name is created in the form of
: > "Blow, Joe." Also you can go in on the gui and manually change the CN
: > name to contain a comma.
: >
: You need to escape the , with a \
:
: CN=Blow\, Joe

Wayne...

This is vbscript, not jscript.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp



Re: Commas in the CN name by Torgeir

Torgeir
Wed Jun 16 15:58:07 CDT 2004

Roland Hall wrote:

> "Wayne Tilton" <Wayne_Tilton@NoSpam.Yahoo.com> wrote in message
> news:Xns950A84CF6EEB5NWDCLMIT@207.46.248.16...
> : "Phill Prescott" <pap@choa.org> wrote in
> : news:uQrwp28UEHA.2508@TK2MSFTNGP12.phx.gbl:
> :
> : > However, if you create a login using the utility Active Directory
> : > Users and Computers, by default the CN name is created in the form of
> : > "Blow, Joe." Also you can go in on the gui and manually change the CN
> : > name to contain a comma.
> : >
> : You need to escape the , with a \
> :
> : CN=Blow\, Joe
>
> Wayne...
>
> This is vbscript, not jscript.
Hi

Actually, for CN strings, you need to use \ to escape commas
even in VBScript...



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Re: Commas in the CN name by Roland

Roland
Wed Jun 16 20:26:37 CDT 2004

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:e1lmST%23UEHA.3988@tk2msftngp13.phx.gbl...
: Roland Hall wrote:
:
: > "Wayne Tilton" <Wayne_Tilton@NoSpam.Yahoo.com> wrote in message
: > news:Xns950A84CF6EEB5NWDCLMIT@207.46.248.16...
: > : "Phill Prescott" <pap@choa.org> wrote in
: > : news:uQrwp28UEHA.2508@TK2MSFTNGP12.phx.gbl:
: > :
: > : > However, if you create a login using the utility Active Directory
: > : > Users and Computers, by default the CN name is created in the form
of
: > : > "Blow, Joe." Also you can go in on the gui and manually change the
CN
: > : > name to contain a comma.
: > : >
: > : You need to escape the , with a \
: > :
: > : CN=Blow\, Joe
: >
: > Wayne...
: >
: > This is vbscript, not jscript.
: Hi
:
: Actually, for CN strings, you need to use \ to escape commas
: even in VBScript...

I wasn't aware. Thanks. What was that old slogan? Microsoft, making it
all make sense? (O:=

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp



Re: Commas in the CN name by Torgeir

Torgeir
Thu Jun 17 00:54:55 CDT 2004

Roland Hall wrote:
> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
> news:e1lmST%23UEHA.3988@tk2msftngp13.phx.gbl...
> : Roland Hall wrote:
> :
> : > "Wayne Tilton" <Wayne_Tilton@NoSpam.Yahoo.com> wrote in message
> : > news:Xns950A84CF6EEB5NWDCLMIT@207.46.248.16...
> : > : "Phill Prescott" <pap@choa.org> wrote in
> : > : news:uQrwp28UEHA.2508@TK2MSFTNGP12.phx.gbl:
> : > :
> : > : > However, if you create a login using the utility Active Directory
> : > : > Users and Computers, by default the CN name is created in the form
> of
> : > : > "Blow, Joe." Also you can go in on the gui and manually change the
> CN
> : > : > name to contain a comma.
> : > : >
> : > : You need to escape the , with a \
> : > :
> : > : CN=Blow\, Joe
> : >
> : > Wayne...
> : >
> : > This is vbscript, not jscript.
> : Hi
> :
> : Actually, for CN strings, you need to use \ to escape commas
> : even in VBScript...
>
> I wasn't aware. Thanks. What was that old slogan? Microsoft, making it
> all make sense? (O:=
Hi

:-)

Well, is is really not an VBScript issue, it is a LDAP
provider "parsing" thing, and if I am not mistaken, it
follows some RFC standard.


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx