Hi,
I have a VB app that sets an account expiry date for Active Directory accounts however if I don't specify an expiry date then the account is set to expire on 28th Dec 1899! (I believe this is a cdate or isDate issue). I've narrowed the fault down to the code below, if the code below is excluded from the program the account expiry date is set to 'Never' as I would expect. Please take a look and if you can help I'd love to here from you.
Thanks
If Not (Trim(newUser.DateExpires) = "") Then
If (IsDate(newUser.DateExpires)) Then
objNewUser.AccountExpirationDate = newUser.DateExpires
objNewUser.SetInfo
If (Err.Number <> 0) Then
doMsg ("Could not set the account expiration date for user " & newUser.SAMAccountName & ". Error : " & Err.Description)
Err.Clear
End If
End If
End If
I have a VB app that sets an account expiry date for Active Directory accounts however if I don't specify an expiry date then the account is set to expire on 28th Dec 1899! (I believe this is a cdate or isDate issue). I've narrowed the fault down to the code below, if the code below is excluded from the program the account expiry date is set to 'Never' as I would expect. Please take a look and if you can help I'd love to here from you.
Thanks
If Not (Trim(newUser.DateExpires) = "") Then
If (IsDate(newUser.DateExpires)) Then
objNewUser.AccountExpirationDate = newUser.DateExpires
objNewUser.SetInfo
If (Err.Number <> 0) Then
doMsg ("Could not set the account expiration date for user " & newUser.SAMAccountName & ". Error : " & Err.Description)
Err.Clear
End If
End If
End If