Page 1 of 1 1
Topic Options
#198653 - 2010-05-18 10:34 PM Active Directory pwdLastSet
Wynder Offline
Just in Town

Registered: 2010-05-18
Posts: 2
Loc: Delaware
Greetings, folks...

Been searching for a solution for this issue and the only thing I've found is several years old and no longer works, so I'm bringing it to the community for advice.

You'll first have to please forgive me -- I don't know KiX well... I'm a C/PHP programmer that has had this Systems task tossed into my lap, so I may be making rudimentary errors in the language.

I'm using an LDAP function library to pull user information to validate information on our file server. Part of what I need to do is determine when their password was last set so I can see if their account isn't being utilized.

I'm attempting to pull the timestamp out of the 'pwdlastset' field:

 Code:
$aAttributes = "pwdlastset", "name"
$sADsPath = "LDAP://mydomain.com/OU=Domain Users,DC=mydomain,DC=com"
$strFilter = "(&(objectCategory=person)(objectClass=user)(cn=rob))"  
 
$aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter,"Name")  
@ERROR " | " @SERROR ?  

For $c = 0 to Ubound($aResults) 
	"Content: " $aResults[$c,0]
Next 


This yields me an IDispatch error -- and here's where my lack of the knowledge is killing me. I'm almost sure it's an issue with the object being returned but, quite frankly, I can't figure out how to deal with it. On top of that, I believe the data I'm looking for is an Integer8 Date...

Normally, I'd have time to actually learn a language before I was tasking with using it; however, I'm running on a tight deadline and would appreciate any advice or counsel anyone could offer.

Regards,
Rob

Top
#198655 - 2010-05-18 11:37 PM Re: Active Directory pwdLastSet [Re: Wynder]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
 Quote:
'm almost sure it's an issue with the object being returned but, quite frankly, I can't figure out how to deal with it.


I think you are right. Do a quick search of the board for pwdlastset, I just pulled up a number of threads that apply. You will likely need fnInteger8Date() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=145863#Post145863


Top
#198656 - 2010-05-18 11:54 PM Re: Active Directory pwdLastSet [Re: Allen]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Oh, and if you are only dealing with the current user of the script, the example in the header of the fnInteger8Date couldn't be any better.
Top
#198660 - 2010-05-19 02:14 PM Re: Active Directory pwdLastSet [Re: Allen]
Wynder Offline
Just in Town

Registered: 2010-05-18
Posts: 2
Loc: Delaware
Allen,

Thanks kindly for pointing me to the script and the example contained within -- I'll read over these and see what I can do with them!

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1045 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.053 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org