Re: Creating a session in windows to auth to remote machines
- From: Tim Golden <mail@xxxxxxxxxxxxxxx>
- Date: Sun, 05 Apr 2009 07:11:57 +0100
ericwoodworth@xxxxxxxxx wrote:
Hi,
I'm trying to auth to remote machines so I can plunder WMI to get
logs and settings and the like. My script works for most of my
machines because they're all in the same domain and I run the script
as somebody who has enough access to get at this stuff but for
machines off the domain I'm stuck.
Unless I'm missing something here, you can already specify
username etc. with WMI. Just Dispatch on "WbemScripting.SWbemLocator"
and call .ConnectServer. Just in case you haven't already, I
(naturally :) ) recommend my wmi module [1] which wraps a fair bit
of the plumbing for you, including this. Eg,
<code>
import wmi
c = wmi.WMI ("some-machine", user="tim", password="password")
for log in c.Win32_NTLogEvent (
Logfile="Application",
Type="error"
):
print log.RecordNumber, log.SourceName, log.Message
</code>
[1] http://timgolden.me.uk/python/wmi.html
TJG
.
- Follow-Ups:
- Re: Creating a session in windows to auth to remote machines
- From: ericwoodworth
- Re: Creating a session in windows to auth to remote machines
- References:
- Creating a session in windows to auth to remote machines
- From: ericwoodworth
- Creating a session in windows to auth to remote machines
- Prev by Date: Re: Generators/iterators, Pythonicity, and primes
- Next by Date: Re: How to free /destroy object created by PyTuple_New
- Previous by thread: Re: Creating a session in windows to auth to remote machines
- Next by thread: Re: Creating a session in windows to auth to remote machines
- Index(es):
Relevant Pages
|