I have a query to fetch ad users based on modifytimestamp attribute.
string datetime = acc.ToUniversalTime().ToString("yyyyMMddHHmmss") + ".OZ";
"(&(objectClass=User)(objectCategory=User)
(userAccountControl:1.2.840.113556.1.4.803:=2)(modifyTimestamp<=" + datetime +
"))";
The above query generate the following error in Windows Server 2008R2, but it works
fine in other Windows Server OS
Error:
The Server does not support the requested critical extension at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext() at DisabledUsers.Program.GetDisabledUsers(String tag, Int32 days) in C:\Users\hari\Documents\Visual Studio 2010\Projects(C#)\DisabledUsers\DisabledUsers\Program.cs:line 37 at DisabledUsers.Program.Main(String[] args) in C:\Users\hari\Documents\Visual Studio 2010\Projects(C#)\DisabledUsers\DisabledUsers\Program.cs:line 14 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()