Re: ADSI and NDS help
- From: "Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 14 Mar 2006 15:06:12 -0600
Hi,
The object may have been found, but the sn attribute is optional. If it has
no value, ADO returns a Null value, even if the user with the email address
exists. You might want to retrieve the NT name of the user, which is the
sAMAccountName attribute (which is mandatory). I'm assuming the problem is
that sn has no value in the recordset, in which case appending a blank
string simply makes the value returned for sn "".
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
"Brian Burns" <noone@xxxxxxxxxxx> wrote in message
news:ck7b12pp4ifpqaiseaf1cgbm5dgbuvj3ra@xxxxxxxxxx
Why does this return a Null value? When I run the same query through
LPD.EXE, I find the object without any problems.
Thanks,
Brian Burns
On Thu, 9 Mar 2006 13:14:00 -0600, "Richard Mueller"
<rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx> wrote:
Brian Burns wrote:
I have an environment with both Active Directory and eDirectory. I am
trying to locate a user object in eDirectory via LDAP using ADSI. The
query i the script below runs successfully in ldp.exe; however, when I
run the script below, I receive the error Type Mismatch with code
800A000D. eDirectory is LDAP v3 compliant, so I would think this would
work
Dim conn
Dim rs
Set conn = CreateObject("ADODB.Connection")
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"
Set rs = conn.Execute("<LDAP://Server>;" & _
"(mail=xxxx@xxxxxx);sn;subtree")
While Not rs.EOF
wscript.echo rs.Fields(0).Value
rs.MoveNext
Wend
conn.Close
Has anyone worked with this type of scenario? Is there something I am
missing? I know I can use the ADSI NDS provider, but I prefer to use
LDAP.
Hi,
Sometimes you get a type mismatch error when ADO returns a null value (in
this case when the user has no value assigned to the sn attribute). One
way
to fix it is to append a blank string, so the Null value is converted to a
blank string. For example:
wscript.echo rs.Fields(0).Value & ""
.
- References:
- ADSI and NDS help
- From: Brian Burns
- Re: ADSI and NDS help
- From: Richard Mueller
- Re: ADSI and NDS help
- From: Brian Burns
- ADSI and NDS help
- Prev by Date: Re: resolve OU current user
- Next by Date: Re: ADSI loginhours restriction WINNT
- Previous by thread: Re: ADSI and NDS help
- Next by thread: Re: ADSI and NDS help
- Index(es):
Relevant Pages
|
|