public static List
{
MethodBase mbo = System.Reflection.MethodBase.GetCurrentMethod();
Debug.WriteLine(mbo.Name + ": Entering");
List
DateTime dt = DateTime.Today.AddDays(days);
Debug.Print(mbo.Name + ": dt val " + dt.ToString());
Debug.Print(mbo.Name + ": getting list of passwords that expire in " + days + " days");
try
{
PrincipalContext adPrincipalContext = new PrincipalContext(ContextType.Domain, "gsb.uchicago.edu");
PrincipalSearchResult
UserPrincipal.FindByPasswordSetTime(
adPrincipalContext,
dt,
MatchType.LessThanOrEquals);
foreach (UserPrincipal result in results)
{
returnList.Add(result.SamAccountName);
//Debug.WriteLine(mbo.Name + ": " + result.SamAccountName);
}
Debug.WriteLine(mbo.Name + ": Returning");
return returnList;
}
catch
{
throw;
}
}
Replies
Know the answer? Post it — somebody with the same question will find it here.