CheckAccountExpiration Method

Checks a Windows user account and returns account password expiration information.

Syntax

object.CheckAccountExpiration(bstrUsername, pbExpired, pbCanChangePassword, pnDaysLeft)

Properties

The CheckAccountExpiration method syntax has these parts:

Part

Description

object

An object expression that evaluates to an object in the Applies To list.

bstrUserName

String. Specifies the Windows user name.

pbExpired

Boolean. Returns True if the Windows user account password is expired, and False if it is not.

pbCanChangePassword

Boolean. Returns True if the user is allowed to change their password, and False if he is not.

pnDaysLeft

Long. Returns the number of days left until the account password expires.

Return Value

This method returns HRESULT. If the HRESULT is a value other than S_OK, VBA generates an error. You can handle this error using the On Error Statement You can find out more information about the error by using Err Object.

 

Example

Applies To