Hi everyone,
I need to discover when a user's password account needs to be changed due to account policy expiration. I have tried some samples on the net but none of them have worked for me, getting some weird errors when implemented.
I stared by testing code like that:
DirectorySearcher ds = new DirectorySearcher();
ds.Filter = ("(&(objectClass=user)(samaccountname=" + this.textBoxUserName.Text + "))");
SearchResult sr = ds.FindOne();
Here, i can get the object model ( SearchResult) for the user in the textBox and of course the values (long integer values) for properties like lastlogon, lastlogontimestamp, badpasswordtime, accountexpires, pwdlastset.
Then i selected the "accountexpires" property assuming it's the one that gives some information about user's password expiration date.
Every time i use functions for conve ...
Go to the complete details ...