Re: Twapi get primary domain controller




palmtcl@xxxxxxxxx ha scritto:

Not sure this will be much help but
twapi::get_primary_domain_controller is more or less a direct call into
Win32 NetGetDCName so you can look up MSDN for detailed description and
try doing

twapi::NetGetDCName SYSTEMNAME DOMAINNAME

Pass "" as either parameter to refer to local system or default.


Thank you.
With the help of MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netgetdcname.asp),
I have understood that API: you can remote it only to a domain
controller, nor to desktops neither to member servers. The DsGetDcName
API would be a bit more useful, as it supports many more options. It
remains one problem with twapi::get_primary_domain_controller, that the
-system option should work when COMPUTERNAME is a domain controller



Regarding the eventlog backup, from what I remember the eventlog back
up is done by the SCM itself which runs under the built-in LocalSystem
account and has no network credentials. Even if you invoke the command
as domain admin, the SCM itself in all likelihood does not have access
to the network share and will not be able to write to it. You'll
probably have to write locally and then file copy it to the network
share.

/Ashok


I get your point, but don't you think that at least the following code
should work ?

set remoteMachineEvt [twapi::eventlog_open -system REMOTEMACHINE]
twapi::eventlog_backup $remoteMachineEvt test0831.evt

Instead, I get "The system cannot find the file specified."

Regards,
Frank

.



Relevant Pages

  • RE: JoinMulticastingGroup & Compact Framework
    ... I would suggest creating the UdpCLient object ... > has to listen for any datagrams coming from the network, ... > catch any datagram comming from the network, ... and I didn't find any much help on that matter on the msdn. ...
    (microsoft.public.dotnet.general)
  • Re: Share a folder without login name and password
    ... disable security for it. ... MSDN should have details about how to make this ... best security pracites ask for security in depth. ... Especially in wireless network scenarios, I don't have to plug my PC into ...
    (microsoft.public.windowsce.embedded)
  • Re: connect to MSDN library on network
    ... > I installed the MSDN 2003 NET library from from the cd's on to a network ... > to the network share where I installed all the MSDN help content. ... why not just install it locally everywhere you need it? ... Seagate Technology LLC ...
    (microsoft.public.vsnet.general)
  • Re: Any legit mail from msdn.com?
    ... > Developers' Network) Is it safe to set up my ISP preferences to block ... Internet message headers will show at bottom. ... If you have never subscribed to MSDN, odds are the email is bogus. ...
    (microsoft.public.windowsxp.general)
  • Re: Win 2K/NT Services
    ... You MUST reply to SCM in your code when the Start event is fired as follows: ... Private Sub NTService1_Start ... success = True ... 1997 MSDN but all the links in MSDN presently are broken. ...
    (microsoft.public.vb.winapi)