In our Active Directory, user objects are represented as "lastname,
firstname"

This causes a problem for me in connecting to the user object to change
properties. Using the Getobject("LDAP://cn=USERNAME,cn=Users," & _
objrdse.get("defaultNamingContext")) returns an 0x80005000 error
because it is reading the "," between the user's last and first name.

Does anyone know how I can get around this problem?

Re: Comma in AD object name is causing error by Ato

Ato
Thu Jun 23 17:42:17 CDT 2005

Try putting a "\" character in front of the comma.

Regards,
Ato
<chrispittman@comcast.net> wrote in message
news:1119559902.190409.161960@g44g2000cwa.googlegroups.com...
> In our Active Directory, user objects are represented as "lastname,
> firstname"
>
> This causes a problem for me in connecting to the user object to change
> properties. Using the Getobject("LDAP://cn=USERNAME,cn=Users," & _
> objrdse.get("defaultNamingContext")) returns an 0x80005000 error
> because it is reading the "," between the user's last and first name.
>
> Does anyone know how I can get around this problem?
>



Re: Comma in AD object name is causing error by Richard

Richard
Thu Jun 23 17:41:13 CDT 2005

Hi,

Escape the comma with a backslash. For example:

Set objUser = GetObject("LDAP://cn=lastname\,
firstname,ou=Sales,dc=MyDomain,dc=com")

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--
<chrispittman@comcast.net> wrote in message
news:1119559902.190409.161960@g44g2000cwa.googlegroups.com...
> In our Active Directory, user objects are represented as "lastname,
> firstname"
>
> This causes a problem for me in connecting to the user object to change
> properties. Using the Getobject("LDAP://cn=USERNAME,cn=Users," & _
> objrdse.get("defaultNamingContext")) returns an 0x80005000 error
> because it is reading the "," between the user's last and first name.
>
> Does anyone know how I can get around this problem?
>



Re: Comma in AD object name is causing error by James

James
Thu Jun 23 21:05:04 CDT 2005

I don't know if it is syntactically correct, but I have always used quotes
for these situations:

Set objUser = GetObject("LDAP://cn=""lastname,
firstname"",ou=Sales,dc=MyDomain,dc=com")

"Richard Mueller [MVP]" <rlmueller-NOSPAM@ameritech.NOSPAM.net> wrote in
message news:uWj5eUEeFHA.1504@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> Escape the comma with a backslash. For example:
>
> Set objUser = GetObject("LDAP://cn=lastname\,
> firstname,ou=Sales,dc=MyDomain,dc=com")
>
> --
> Richard
> Microsoft MVP Scripting and ADSI
> Hilltop Lab web site - http://www.rlmueller.net
> --
> <chrispittman@comcast.net> wrote in message
> news:1119559902.190409.161960@g44g2000cwa.googlegroups.com...
> > In our Active Directory, user objects are represented as "lastname,
> > firstname"
> >
> > This causes a problem for me in connecting to the user object to change
> > properties. Using the Getobject("LDAP://cn=USERNAME,cn=Users," & _
> > objrdse.get("defaultNamingContext")) returns an 0x80005000 error
> > because it is reading the "," between the user's last and first name.
> >
> > Does anyone know how I can get around this problem?
> >
>
>



Re: Comma in AD object name is causing error by Richard

Richard
Fri Jun 24 12:34:56 CDT 2005

I had no idea that would work, but it does.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--
"James Whitlow" <jwhitlow@letter.com> wrote in message
news:42bb699d$0$91697$bb4e3ad8@newscene.com...
> I don't know if it is syntactically correct, but I have always used quotes
> for these situations:
>
> Set objUser = GetObject("LDAP://cn=""lastname,
> firstname"",ou=Sales,dc=MyDomain,dc=com")
>
> "Richard Mueller [MVP]" <rlmueller-NOSPAM@ameritech.NOSPAM.net> wrote in
> message news:uWj5eUEeFHA.1504@TK2MSFTNGP15.phx.gbl...
> > Hi,
> >
> > Escape the comma with a backslash. For example:
> >
> > Set objUser = GetObject("LDAP://cn=lastname\,
> > firstname,ou=Sales,dc=MyDomain,dc=com")
> >
> > --
> > Richard
> > Microsoft MVP Scripting and ADSI
> > Hilltop Lab web site - http://www.rlmueller.net
> > --
> > <chrispittman@comcast.net> wrote in message
> > news:1119559902.190409.161960@g44g2000cwa.googlegroups.com...
> > > In our Active Directory, user objects are represented as "lastname,
> > > firstname"
> > >
> > > This causes a problem for me in connecting to the user object to
change
> > > properties. Using the Getobject("LDAP://cn=USERNAME,cn=Users," & _
> > > objrdse.get("defaultNamingContext")) returns an 0x80005000 error
> > > because it is reading the "," between the user's last and first name.
> > >
> > > Does anyone know how I can get around this problem?
> > >
> >
> >
>
>