Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Twapi get primary domain controller

Path: g2news2.google.com!postnews.google.com!i3g2000cwc.googlegroups.com!not-for-mail
From: palm...@yahoo.com
Newsgroups: comp.lang.tcl
Subject: Re: Twapi get primary domain controller
Date: 31 Aug 2006 10:50:30 -0700
Organization: http://groups.google.com
Lines: 60
Message-ID: <1157046629.964513.192390@i3g2000cwc.googlegroups.com>
References: <1156892084.361165.225380@h48g2000cwc.googlegroups.com>
   <1156956844.326653.90460@i42g2000cwa.googlegroups.com>
   <1157037466.578873.39690@b28g2000cwb.googlegroups.com>
NNTP-Posting-Host: 125.22.39.213
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1157046635 17107 127.0.0.1 (31 Aug 2006 17:50:35 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 31 Aug 2006 17:50:35 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: i3g2000cwc.googlegroups.com; posting-host=125.22.39.213;
   posting-account=595D2gwAAACYiUjhUCEj7a2Td2A5ES72

OK, I just tried this and discovered something wonderful :-(and
undocumented) about the Win32 BackupEventLog API. The file name you
specify must be a full path on the remote system. If you specify a
relative path (including just specifying the file name portion),
Windows will take the current dir on the *local* system, append the
file yuo specify and try to write to it on the *remote* system! If your
current dir path on the local system does not exist on the remote
system you will get the "path does not exist" error. What a crock!

The upshot is specify the full path of the backup file on the remote
system and it should work.

/Ashok

getshor...@gmail.com wrote:
> palm...@yahoo.com 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