IADsUser Property: AccountExpirationDate

Property Name
AccountExpirationDate

Property Type
Date

Description
Gets and sets the date and time after which a user cannot log on. The specified time is with reference to the time zone of the client computer. The client computer is the one from where the script is run.

Remarks
While getting the date of Account Expiration:

  1. If the account expiration date is any day before 1/1/1980, it returns the Account Expiration date as 1/1/1980.

  2. If the account expiration date is any day after 1/18/2038, it returns the Account Expiration date as 1/18/2038.

  3. If the account never expires, it returns the Account Expiration date as 8/19/9999.

While setting the date of Account Expiration:

  1. If the account expiration date is any day before 1/1/1980, it sets the Account Expiration date as 1/1/1980.

  2. If the account expiration date is any day after 1/18/2038, it sets the Account Expiration date as 1/18/2038.

  3. If the account never expires, it sets the Account Expiration date as 8/19/9999.

Example

Dim UserObject As IADsUser
Set UserObject = GetObject("NTDS://DomainName/UserName")
Debug.Print UserObject.AccountExpirationDate

 

See Also