Hi Experts,
I am using the following code to set the value of accountExpires for LDAP Users
Code:
DirectoryEntry oUserDE = new DirectoryEntry(strPath, LDAPUserName, LDAPPassword);;
DirectorySearcher oSearch = new DirectorySearcher(oUserDE);
oSearch.Filter = "(SAMAccountName=" + UserName + ")";
SearchResult oResult = oSearch.FindOne();
oUserDE = oResult.GetDirectoryEntry();
DateTime Dt = DateTime.Now.AddMonths(6);
oUserDE.Properties["accountExpires"].Value = Dt;
However, I am getting an error. Can anyone tell me how to do this. Basically I want to create users who should not able to login after a specific date.
Regards
Ganesh
http://ganeshprof.blogspot.com