I'm trying to get the PDC-Computername of a foreign WinNT-domain, but
I only managed to get the PDC of my own domain with this code:
pdc=win32net.NetGetAnyDCName()
I think it should be possible to get the PDC of a foreign domain
(which is a trusted domain) with this code. If I'm right with this
assumption, could anyone give me an example-code?
Or tell me that I'm wrong, then I can concentrate on something else...
Thanks!
Dirk
If you don't specify any params to that call, win32net will assume
you're looking at your own domain. It can take two params: server & domain.
If you do this:
pdc = win32net.NetGetAnyDCName (None, "name_of_other_domain")
it should work.
TJG
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Any other idea?
Dirk
Tim Golden <tim.g...@viacom-outdoor.co.uk> wrote in message news:<mailman.642.10747801...@python.org>...
>From: use...@mail-2-me.com [mailto:use...@mail-2-me.com]
>
>Thanks for your help, but that does not work. I get an error message
>which sais it can't reach the domain.
>But I'm sure did not make an syntax-error, because if I enter my own
>domain it works.
>
>Any other idea?
>
>Dirk
>
>
To ask the obvious question: do you definitely have all
the necessary security / connectivity in place to reach
the domain controller on that domain?
Can you log onto it normally with whatever name you're
running under now?
(I don't have more than one domain here, so it's difficult
for me to test)
I can reach the other domains and I have all rights. That's no the problem.
Dirk
Could you dump a cut-and-paste of the interpreter, so
we can see what's happening? This is what I get, altho'
as I say, I don't have another domain. Is yours the same?
<dump>
ActivePython 2.2.3 Build 227 (ActiveState Corp.) based on
Python 2.2.3 (#42, Nov 13 2003, 09:57:55) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32net
>>> win32net.NetGetAnyDCName ()
u'\\\\VOBDC1'
>>> win32net.NetGetAnyDCName (None, "VOUK")
u'\\\\VOBDC1'
>>> win32net.NetGetAnyDCName (None, "non-existent")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
pywintypes.error: (1355, 'NetGetAnyDCName', 'The specified domain either
does not exist or could not be contacted.')
>>>
</dump>