Page 2 of 2 <12
Topic Options
#177227 - 2007-06-25 03:20 PM Re: Script to display Account Expiration date to user. [Re: Shawn]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Shawn,

You code gave me this.
I set my account in AD to expire on 1-1-2020 so it seems to be working ok.

 Quote:

Your account expires on 2-1-2020 1:00:00.
The operation completed successfully.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#177229 - 2007-06-25 03:28 PM Re: Script to display Account Expiration date to user. [Re: Mart]
RFW Offline
Fresh Scripter

Registered: 2006-04-19
Posts: 9
Loc: New York
Okay. Then it must be something within our AD. Thanks for everything.
Top
#177230 - 2007-06-25 03:28 PM Re: Script to display Account Expiration date to user. [Re: Mart]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
With no expiration date set it gives weird results.
I started working here in August 2005 and my account expires in 1601. Hmmm... where did that -404 years go. They say time flies when you're having fun.

 Quote:

Your account expires on 1-1-1601 2:00:00.
The operation completed successfully.


Edited by Mart (2007-06-25 03:29 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#177231 - 2007-06-25 03:35 PM Re: Script to display Account Expiration date to user. [Re: Mart]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Mart - thats weird. Going to try that on my side.

RFW - the only thing I can suggest you try is this. Stick a "GetInfo" between the lines ...

$objUser = GetObject("LDAP://"+$strUser)

$objUser.GetInfo()

?"Your account expires on " + $objUser.AccountExpirationDate + "."

-Shawn

Top
#177235 - 2007-06-25 04:09 PM Re: Script to display Account Expiration date to user. [Re: Shawn]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
One could do some data math on it and display some kind off message when the expiration date is less the today and no expiration is set.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#177236 - 2007-06-25 04:13 PM Re: Script to display Account Expiration date to user. [Re: Mart]
RFW Offline
Fresh Scripter

Registered: 2006-04-19
Posts: 9
Loc: New York
I think I've found my problem. It looks like are Domain is configured in such a manner that restricts the normal users from getting the information, because it did work fine with a true Domain Admin account. Back to the drawing board for a solution. Thanks for all the help, as always the Kixtart community is a great resource.
Top
Page 2 of 2 <12


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

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

Generated in 0.057 seconds in which 0.025 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