Solved

Calculate AccountExpires

Posted on 2002-07-17
8
1,937 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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…
Riverbed Technology's webinar discusses networking for the cloud era with simplified SD-WAN cloud connectivity.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

829 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