[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Calculate AccountExpires

Posted on 2002-07-17
8
Medium Priority
?
1,980 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

834 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