Martin wrote:
> On Apr 27, 1:36 pm, Chris Dent <ch...@noreply.null> wrote:
>
>> Hi Martin,
>>
>> I suspect you're saturating the network connections (ports) available to
>> RPC. The pause you're adding would appear to give it time to clear up
>> completed connections.
>>
>> I realise you've not using ADMT, however the action you're attempting to
>> perform is similar:
>>
>> http://support.microsoft.com/?id=836429
>>
>> Do you really need to write to all 5000 objects?
>>
>> Chris
>>
>> Martin wrote:
>>
>>> Hi guys,
>>>
>>> I'm trying to open some 5000 computer objects in a loop. Anyway, at
>>> some point (say on 1500-ish iteration of the loop) ADsOpenObject()
>>> returns 0x8007203A (The server is not operational). But when I put a
>>> delay before each call (say, Sleep(20)), nothing similar happens. Any
>>> ideas why frequent calls to ADsOpenObject() may result in 0x8007203A?
>>>
>>> Martin
>>>
>> --
>> Blog:http://www.indented.co.uk
>> DnsShell:http://code.msdn.microsoft.com/dnsshell
>>
>
> Hi Chris,
>
> Yes, this is it, thanks a lot! Unfortunately, calling ADsOpenObject()
> for each computer object is set by design, and I can't change much
> here. On the other hand, is there even a way to somehow manage ports
> allocated for RPC manually (I mean programmatically)?
>
>
> Martin
>
Not really for two reasons.
1. ADsOpenObject is handling the client-side of connection negotiation
2. The server-side, the service you're talking to, allocates the port
Either you need a different method, or you need to batch / stagger the
calls, or you need to increase the number of ports available to you
using the method described in the KB article above. If you're writing
from the client-side for a generic environment then the first two are
most appropriate, but it depends a lot on how you're executing the code.
I'm afraid that isn't the most useful response in the world.
Chris
--
Blog:
http://www.indented.co.uk
DnsShell:
http://code.msdn.microsoft.com/dnsshell