Re: Putting a comma in (cn=user) when creating a user in AD

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Roger Abell (mvpNOSpam_at_asu.edu)
Date: 07/24/04


Date: Sat, 24 Jul 2004 10:30:00 -0700

The comma is part of the syntax for DNs, of which your
CN is to be a part, and therefrom comes your problem.
You know, the full LDap cn=val1, cn=val2, dc=hostdom,dc=org
wherefrome your comma is not valid.
In the case you show, there are already last and first and
full name fields so maybe you do not need to cram it all
in where you intend as you intend.

-- 
Roger Abell
Microsoft MVP (Windows Server System: Security)
MCSE (W2k3,W2k,Nt4)  MCDBA
"fzemenu" <fzemenu@discussions.microsoft.com> wrote in message
news:616C6600-AF62-40BA-83F9-B11DE009B3C6@microsoft.com...
> used this script to create a new user and set the new name (CN) as
(LastName, FirstName). Error comes whenever I use the comma.
>
> firstname = Forms!NewUserCreation!Fname.Value ' this is from Access
> LastName = Forms!NewUserCreation!Lname.Value
> Comma = ", "
>
> username1 = LastName & Comma & firstname
>
> Set objUser = objOU.Create("user", "cn=" & username)
> objUser.put "sAMAccountName", "" & username
>
> Can someone assist? Appreciate your help.
>
> Fesseha Z.
>
>


Relevant Pages