Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull expiration dates from AD

Status
Not open for further replies.

micromko

Technical User
Jan 11, 2005
6
US
This works for one user...how do i change it to pull all users from this OU along with expiration dates?

On Error Resume Next

Set objUser = GetObject _
("LDAP://cn=username,OU=A-E,OU=VendorsContractors,DC=resource,DC=domain,DC=domain,DC=com")

dtmAccountExpiration = objUser.AccountExpirationDate

If Err.Number = -2147467259 Or dtmAccountExpiration = "1/1/1970" Then
WScript.Echo "No account expiration date specified"
'Else
' WScript.Echo "Account expiration date: " & objUser.AccountExpirationDate
End If

getExpireDate = objUser.AccountExpirationDate

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top