Solved

Calculate AccountExpires

Posted on 2002-07-17
8
1,944 Views
Last Modified: 2012-05-04
How do you calculate the Long Integer that is required in Active Directory for the AccountExpires?
0
Comment
Question by:bugsuperstar37
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 7160518
Good question.

I can give you a method to show you the dates, and you should be able to figure it out from there.

one of the sites below has a utility to print out users and password expiration dates. I'll try to find the exact location..
See


http://www.sysinternals.com/

http://www.sysinternals.com/ntw2k/freeware/ntfsdospro.shtml  NTFS for DOS
http://www.systemtools.com/
http://www.winternals.com
 www.bhs.com
http://www.bhs.com/soft_index.asp

http://www.sunbelt-software.com/search_category.cfm
www.optimumx.com


I hope this helps !

0
 
LVL 63

Expert Comment

by:SysExpert
ID: 7160524
http://www.systemtools.com/free_frame.htm  June 10, 2002 checked for updates.
Yes, these utilities are all FREE !

We have assembled (and in some cases developed) the following free utilities for addressing unique Windows
NT system management problems.  Please direct any questions concerning these utilities to the contact
addresses listed in each application's ReadMe or Help file.

SystemTools TScmd - Developed by SystemTools.  A command-line utility to set terminal server user
settings.  All eighteen (18) terminal server settings can be set.  Includes documentation in readme.txt file.

Password Age - Password Age (formerly "machines"). Displays the age of the password for user and
computer accounts. For computer accounts, this information can be used to determine if the computer is no
longer being used. For users, it can be used to determine which accounts are not being used or have
expired.

----------

I hope this helps !
0
 
LVL 1

Author Comment

by:bugsuperstar37
ID: 7160584
Unless you can send me code, these sites are useless. Look, I don't need more tools. Windows provides many. I need to know how to calculate a date as a Long Integer that is acceptable to the Active Directory accountExpires property.
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 9

Expert Comment

by:schmiegu
ID: 7161448
From ADSI SDK:

accountExpires
The accountExpires property specifies when the account will expire. This value is stored as a large integer that represents the number of seconds elapsed since 00:00:00, January 1, 1970. A value of TIMEQ_FOREVER indicates that the account never expires.

0
 
LVL 9

Expert Comment

by:schmiegu
ID: 7161463
Also from ADSI SDK:

Account Expiration

Account Expiration Date can be set using the AccountExpiration method in the IADsUser interface.

Set usr = GetObject("WinNT://ArcadiaBay/JSmith")
usr.AccountExpirationDate = "05/06/1998"
usr.SetInfo
To set the account expiration date to "never", use "January 1, 1970" as the parameter.

You can set the account expiration date by setting the AccountExpirationDate property of the IADsUser interface to a desired date value. To set the account expiration date to "never", set this property to "Janurary 1, 1970".

Example Code [Visual Basic]
Set usr = GetObject("WinNT://ArcadiaBay/JSmith")
usr.AccountExpirationDate = "05/06/1998"
usr.SetInfo
 
// to enable the account forever,
usr.AccountExpirationDate = "01/01/1970"
usr.SetInfo
0
 
LVL 1

Author Comment

by:bugsuperstar37
ID: 7162278
This is nice, but the truth is I have figured out the 00:00:00, January 1, 1970 portion, the only problem is that I am not working with a Microsoft relater programming language. I am using PHP. But after some serious hit and miss, I have discovered you must add a specific number of zeros to the end and then after calculating leap years and so forth I have found my answer.
0
 
LVL 1

Expert Comment

by:netwiz562
ID: 9497093
---- CLEAN UP ----

bugsuperstar37,
No comment has been added lately (445 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: [ PAQ/Refund ]

Please leave any comments here within the next seven days.

¡PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

------------------------------
Rajiv Makhijani
EE Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 9803498
Question closed and points refunded

PashaMod
CS Moderator
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question