EfrenM
asked on
VB .net and Active Directory Account Expiration Date
Hi all
i am trying to add a expire date to the account with VB i found the code below and it works as long as i use two digit months ex i put 12/1/2012 and in the attribute it says 12/1/2012 12:00:00 am,
but if i put 1/1/2012 12:00:00 am then the attribute says 12/31/2011 11:00:00 pm. any ideas what is going on?
i am trying to add a expire date to the account with VB i found the code below and it works as long as i use two digit months ex i put 12/1/2012 and in the attribute it says 12/1/2012 12:00:00 am,
but if i put 1/1/2012 12:00:00 am then the attribute says 12/31/2011 11:00:00 pm. any ideas what is going on?
Dim adpath As String
Using de As New DirectoryEntry(adpath)
Dim deUser As DirectoryEntry = New DirectoryEntry(usr)
Dim ObjUser
ObjUser = GetObject(deUser.Path)
ObjUser.AccountExpirationDate = "1/1/2012 12:00:00 AM"
ObjUser.SetInfo()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i added 01/1/2012 1:00 <-
Open in new window