[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Exception: The server is not operational while querying the AD

P.L.

9/24/2008 9:03:00 PM

Dear experts,

My program raised an exception - "The server is not operational" after
it keeps querying the AD server thousand times. The strange thing is
that the exception only happens after No. 3800 times query, sometimes
No. 3824th query, sometimes No. 3864th query, etc.

Stranger, when I run the program inside VS.NET 2005 in debug mode, the
program stops at the break point (inside catch (Exception e)); then I
press continue to run, the program will finish all 6000 queries with
only one exception. However, if I run this program directly in
Windows, the program will raise thousand exceptions (from 38xxth to
6000th), non-stop.

Any advice and suggestion would be highly appreciated.

Code:
private DirectoryEntry root = new DirectoryEntry("...");
root.AuthenticationType = AuthenticationTypes.Delegation;
root.Username = "...";
searcher = new DirectorySearcher(root);
searcher.PropertiesToLoad.Add("number1");
searcher.PropertiesToLoad.Add("field1");
searcher.PropertiesToLoad.Add("field2");
searcher.SizeLimit = 5000;
searcher.ClientTimeout = new TimeSpan(0, 5, 0);
searcher.ServerTimeLimit = new TimeSpan(0, 5, 0);

SearchResultCollection src = null;
SearchResult sr = null;
string number = "0000000000";
counter++;
DateTime methodstart = DateTime.Now;

try
{
searcher.Filter = "(&((addomain=" + account[0] + ")(adsamaccount="
+ account[1] + ")))";
sr = searcher.FindOne();
//src = searcher.FindAll();

//if (src.Count > 0)
// sr = src[0];

if (sr != null)
{
ResultPropertyValueCollection rpvc = sr.Properties["number1"];

if (rpvc.Count > 0)
number = rpvc[0].ToString();
}
}
catch (Exception e)
{
// log to the file
DateTime exceptiontime = DateTime.Now;
Console.WriteLine(counter.ToString() + ": program start: " +
starttime + " method start: " +
methodstart.ToString() + " exception time: " +
exceptiontime.ToString() +
", Exception - SearchLDAP(" + account[0] + "\\" + account[1]
+"): " +
e.Message + "\r\n");
}
finally
{
if (src != null)
src.Dispose();
}
return number;
}
2 Answers

Gary Renzetti

5/23/2009 9:06:00 PM

0

rst9wxyz@yahoo.com top-posted:
> Don't cut and paste from someone else's writing. Write your own as it
> should be.
>
Why not, Rusty? It is rare for me to agree with an LT post, but the
article he shared below echoes my reservations about POTUS #44 almost
exactly. Despite his sweet words, the "renditions"? continue, GITMO
stays open, the unconstitutional military tribunals proceed and none of
the Bushoids get prosecuted for violating the Constitution they swore an
oath to defend. Where's the "change"??

>
> On May 21, 10:31 am, ltlee1 <ltl...@hotmail.com> wrote:
>> "America has lost her soul, and so has her president."
>>
>> http://www.opednews.com/articles/Watching-Obama-Morph-Into-......
>> -------------------------
>> by Paul Craig Roberts, May 21, 2009
>>
>> America has lost her soul, and so has her president.
>>
>> A despairing country elected a president who promised change.
>> Americans arrived from every state to witness in bitter cold Obama?s
>> swearing-in ceremony. The mall was packed in a way that it has never
>> been for any other president.
>>
>> The people?s good will toward Obama and the expectations they had for
>> him were sufficient for Obama to end the gratuitous wars and enact
>> major reforms. But Obama has deserted the people for the interests. He
>> is relying on his non-threatening demeanor and rhetoric to convince
>> the people that change is underway.
>>
>> The change that we are witnessing is in Obama, not in policies. Obama
>> is morphing into Dick Cheney.
>>
>> Obama has not been in office four months and already a book could be
>> written about his broken promises.
>>
>> Obama said he would close the torture prison, Guantanamo, and abolish
>> the kangaroo courts known as military tribunals. But now he says he is
>> going to reform the tribunals and continue the process, but without
>> confessions obtained with torture. Getting behind Obama?s validation
>> of the Bush/Cheney policy, House Democrats pulled the budget funding
>> that was to be used for closing Guantanamo.
>>
>> The policy of kidnapping people (usually on the basis of
>> disinformation supplied by their enemies) and whisking them off to
>> Third World prisons to be interrogated is to be continued. Again,
>> Obama has substituted a "reform" for his promise to abolish an illegal
>> policy. Rendition, Obama says, has also been reformed and will no
>> longer involve torture. How would anyone know? Is Obama going to
>> assign a U.S. government agent to watch over the treatment given to
>> disappeared people by Third World thugs? Given the proclivity of
>> American police to brutalize U.S. citizens, nothing can save the
>> victims of rendition from torture.
>>
>> Obama has defended the Bush/Cheney warrantless wiretapping program run
>> by the National Security Agency and broadened the government?s legal
>> argument that "sovereign immunity" protects government officials from
>> prosecution and civil suits when they violate U.S. law and
>> constitutional protections of citizens. Obama?s Justice Department has
>> taken up the defense of Donald Rumsfeld against a case brought by
>> detainees whose rights Rumsfeld violated.
>>
>> In a signing statement this month, Obama abandoned his promise to
>> protect whistleblowers who give information of executive branch
>> illegality to Congress.
>>
>> Obama is making even more expansive claims of executive power than
>> Bush. As Bruce Fein puts it: "In principle, President Obama is
>> maintaining that victims of constitutional wrongdoing by the U.S.
>> government should be denied a remedy in order to prevent the American
>> people and the world at large from learning of the lawlessness
>> perpetrated in the name of national security and exacting political
>> and legal accountability."
>>
>> Obama, in other words, is committed to covering up the Bush regime?s
>> crimes and to ensuring that his own regime can continue to operate in
>> the same illegal and unconstitutional ways.
>>
>> Obama is fighting the release of the latest batch of horrific torture
>> photos that have come to light. Obama claims that release of the
>> photos would anger insurgents and cause them to kill our troops. That,
>> of course, is nonsense. Those resisting occupation of their land by
>> U.S. troops and NATO mercenaries are already dedicated to killing our
>> troops, and they know that Americans torture whomever they capture.
>> Obama is fighting the release of the photos because he knows the
>> barbaric image that the photos present of the U.S. military will
>> undermine the public?s support for the wars that enrich the military/
>> security complex, appease the Israel Lobby, and repay the campaign
>> contributions that elect the U.S. government.
>>
>> As for bringing the troops home from Iraq, this promise, too, has been
>> reformed. To the consternation of his supporters, Obama is leaving
>> 50,000 U.S. soldiers in Iraq. The others are being sent to Afghanistan
>> and to Pakistan, where on Obama?s watch war has broken out big time
>> with already one million refugees from the indiscriminate bombing of
>> civilians.
>>
>> Meanwhile, war with Iran remains a possibility, and at Washington?s
>> insistence, NATO is conducting war games on former Soviet territory,
>> thus laying the groundwork for future enrichment of the U.S. military/
>> security complex. The steeply rising U.S. unemployment rate will
>> provide the needed troops for Obama?s expanding wars.
>>
>> Obama can give a great speech without mangling the language. He can
>> smile and make people believe his rhetoric. The world, or much of it,
>> seems to be content with the soft words that now drape Dick Cheney?s
>> policies in pursuit of executive supremacy and U.S. hegemony.
>>
>> ---------------------------
>>
>> On May 21, 9:16 am, ltlee1 <ltl...@hotmail.com> wrote:
>>
>>
>>
>>> http://www.thefirstpost.co.uk/47696,opinion,barack-obama-fr......
>>> "How long does it take a mild-mannered, anti-war, black professor of
>>> constitutional law, trained as a community organiser on the South Side
>>> of Chicago, to become an enthusiastic sponsor of targeted
>>> assassinations, 'decapitation' strategies and remote-control bombing
>>> of mud houses at the far end of the globe?
>>> There's nothing surprising here. As far back as President Woodrow
>>> Wilson, in the early 20th century, American liberalism has been swift
>>> to flex its imperial muscle and whistle up the Marines. High-explosive
>>> has always been in the hormone shot.
>>> The nearest parallel to Obama in eager deference to the bloodthirsty
>>> counsels of his counter-insurgency advisors is John F. Kennedy. It is
>>> not surprising that bright young presidents relish quick-fix, 'outside
>>> the box' scenarios for victory. "
>>> Yes, democracy works. It is like Cheney is having a thrid term.- Hide quoted text -
>> - Show quoted text -
>

rst0wxyz

5/23/2009 11:28:00 PM

0

On May 23, 2:05 pm, Gary Renzetti <lizg...@connection.com> wrote:
> rst9w...@yahoo.com top-posted:> Don't cut and paste from someone else's writing.  Write your own as it
> > should be.
>
> Why not, Rusty? It is rare for me to agree with an LT post, but the
> article he shared below echoes my reservations about POTUS #44 almost
> exactly. Despite his sweet words, the "renditions"® continue, GITMO
> stays open, the unconstitutional military tribunals proceed and none of
> the Bushoids get prosecuted for violating the Constitution they swore an
> oath to defend. Where's the "change"®?

It takes time to correct past mistakes, and Obama said he will close
the prison in Cuba. The rendition program has not continue, but with
the outcry from the countries where it happens or where the planes fly
through, those countries have said they will not allow it to happen.

Where do we begin, and where do we end in prosecuting past mistakes?
The low ranking ones said they only take order from above. Do we or
should we prosecute G. Bush? or Dick Cheney? They were the biggest
instigators of those past mistakes.