#205551 - 2012-08-17 03:29 PM
Unable to query LDAP unless a domain admin
|
Doofenshmirtz
Just in Town
Registered: 2010-11-05
Posts: 4
Loc: Baltimore, MD
|
I have a login script I wrote years ago and have used with minor tweaking at two different jobs/domains. Now, at the new job, the following code only works when I use my domain admin credentials:
$objSys = CreateObject("ADSystemInfo")
$objUser = GetObject("LDAP://"+$objSys.UserName)
select
case @time <= "11:59:59" ? " Good morning, " ($objUser.givenName) + " " + ($objUser.sn)
case @time >= "12:00:00" and @time <= "16:59:59" ? " Good afternoon, " ($objUser.givenName) + " " + ($objUser.sn)
case @time >= "17:00:00" ? " Good evening, " ($objUser.givenName) + " " + ($objUser.sn)
endselect
With my regular domain user account, I get an error right after the "Good morning, " (or whatever the time case works out to) greeting. With domain admin, it runs just fine.
What could be causing this to not work for the average user?
Thanks!
|
Top
|
|
|
|
#205554 - 2012-08-17 04:50 PM
Re: Unable to query LDAP unless a domain admin
[Re: Lonkero]
|
Doofenshmirtz
Just in Town
Registered: 2010-11-05
Posts: 4
Loc: Baltimore, MD
|
The results of the error lines as a user: objsys: 0 objuser: -2147024843
The results of the error lines as a domain admin: objsys: 0 objuser: 0
@fullname works just fine. The users full names here are lastName, firstName. Saying "Good morning, Doe, John" just looks bad. Concatenating their first name (givenName) and last name (sn) looks better. There are other LDAP attributes I am looking to display, too, at some point.
Edited by Doofenshmirtz (2012-08-17 04:53 PM)
|
Top
|
|
|
|
#205556 - 2012-08-17 05:08 PM
Re: Unable to query LDAP unless a domain admin
[Re: Glenn Barnas]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
Converting the com error to a standard error...
? VAL("&"+Right(DecToHex(-2147024843),4))
...returns 53... "The network path was not found."
Not sure that applies here, but it definitely feels like permissions.
|
Top
|
|
|
|
#205557 - 2012-08-17 07:12 PM
Re: Unable to query LDAP unless a domain admin
[Re: Glenn Barnas]
|
Doofenshmirtz
Just in Town
Registered: 2010-11-05
Posts: 4
Loc: Baltimore, MD
|
Wow, never thought of splitting the full name. That will work nicely for now.
Thanks, Glenn!
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|