Expiration of Active Directory accounts -


requesting support if can guide in order obtain list of users expire account on active directory.

see great msdn magazine article managing directory security principals in .net framework 3.5

in section 8, authors talk how query common things finding users accounts expire in given period of time.

by doing quite simple this, can find users account expire dec 15:

// establish domain context principalcontext ctx = new principalcontext(contexttype.domain);  // find users accounts expire dec 15 principalsearchresult<userprincipal> users =        userprincipal.findbyexpirationtime(ctx, new datetime(2010, 12, 15),                                           matchtype.lessthanorequals); 

now have list of userprincipal accounts expire soon.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -