Solved

Calculate AccountExpires

Posted on 2002-07-17
8
1,904 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 9

Expert Comment

by:schmiegu
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 9

Expert Comment

by:schmiegu
Comment Utility
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
Comment Utility
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
Comment Utility
---- 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
Comment Utility
Question closed and points refunded

PashaMod
CS Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now