<div dir="ltr">HI forwarded it to the Python Win32 list <br><br><div class="gmail_quote">On Thu, May 21, 2009 at 12:11 AM, Tim Golden <span dir="ltr"><<a href="mailto:mail@timgolden.me.uk">mail@timgolden.me.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">K-Dawg wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for any response. I am in a crisis where one of our networking guys<br>
moved where our PAC file is housed. There was a group policy set in Active<br>
Directory that set the PAC file location in Internet Explorer to the new<br>
location.<br>
<br>
However, we have 100 remote centers that have about 3 to 4 machines that are<br>
not on AD (from before an AD migration). These machines did not receive the<br>
update.<br>
<br>
Is there a way I can write a python script to run from my machine to jump<br>
out to a list<br>
</blockquote>
<br>
<br></div>
More of a Windows question, really, and depends on the configuration<br>
of network, security etc. Certainly you can use any of the usual<br>
Windows techniques (UNCs, WMI, DCOM etc.) to invoke things on those remote<br>
machines, assuming you have enough network and credentials to get there.<br>
<br>
Not clear what your level of expertise is, either at the Windows<br>
or at the Python level, so apols. if suggesting the obvious here.<br>
If you already know what technique you're going to use to push<br>
your file out (say, a copy to a remote unc) then getting Python to<br>
read a list of machines from a file and doing the same to each one<br>
is child's play:<br>
<br>
import shutil<br>
for machine in open ("machines.txt"):<br>
shutil.copyfile ("local.pac", r"\\%s\c$\somewhere\thing.pac" % machine)<br>
<br>
If you need to set up credentials for that connection first, you<br>
might want to use the win32net module from the pywin32 extensions<br>
to establish a mapped drive or at least a NULL session with known<br>
credentials.<br>
<br>
As a possibility the other way round, if you're able to WMI into<br>
the machines, you could run a command on them to pull the file<br>
in, rather than pushing. Obviously, you've still got to establish<br>
credentials.<br>
<br>
I'll stop there, because I might be missing the target altogether.<br>
You'll certainly get help here, but you might want to post to<br>
the python-win32 list which is a bit more specialised.<br>
<br>
TJG<br><font color="#888888">
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.goldwatches.com">http://www.goldwatches.com</a><br><br><br><br>
</div>