I am writing a function to get the user expiration date in C# using ldap. I am currently refering the following link information to get the maxPwdAge from the Properties.
Active Directory user password expiration date .NET/OU Group Policy
Problem with my code is that
var maxPwdAge = results[0].Properties["maxPwdAge"][0]; // Getting Error here
maxDays = (long)maxPwdAge / -864000000000;
in this line, I am getting Error as follows
The time limit for this request was exceeded or "Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation."
I tried IADsLargeInteger also to get the value, but I am getting the same error for the both cases
object obj = entry.Properties["maxPwdAge"];// Getting Error here
ActiveDs.IADsLargeInteger largeIntADSI;
largeIntADSI = (ActiveDs.IADsLargeInteger)obj;
But after nearly 30 secs, I am getting 240 days, the expected result from my code.It is very problematic issue.