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