<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kb.rvmgroup.it/index.php?action=history&amp;feed=atom&amp;title=Shutdown_Remoto_di_una_macchina_Windows_da_Linux</id>
	<title>Shutdown Remoto di una macchina Windows da Linux - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://kb.rvmgroup.it/index.php?action=history&amp;feed=atom&amp;title=Shutdown_Remoto_di_una_macchina_Windows_da_Linux"/>
	<link rel="alternate" type="text/html" href="https://kb.rvmgroup.it/index.php?title=Shutdown_Remoto_di_una_macchina_Windows_da_Linux&amp;action=history"/>
	<updated>2026-05-06T14:16:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://kb.rvmgroup.it/index.php?title=Shutdown_Remoto_di_una_macchina_Windows_da_Linux&amp;diff=4977&amp;oldid=prev</id>
		<title>Gabriele.vivinetto at 18:59, 30 November 2006</title>
		<link rel="alternate" type="text/html" href="https://kb.rvmgroup.it/index.php?title=Shutdown_Remoto_di_una_macchina_Windows_da_Linux&amp;diff=4977&amp;oldid=prev"/>
		<updated>2006-11-30T18:59:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:59, 30 November 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Stub}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Si può usare uno script in Python:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Si può usare uno script in Python:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gabriele.vivinetto</name></author>
	</entry>
	<entry>
		<id>https://kb.rvmgroup.it/index.php?title=Shutdown_Remoto_di_una_macchina_Windows_da_Linux&amp;diff=4976&amp;oldid=prev</id>
		<title>Gabriele.vivinetto at 18:59, 30 November 2006</title>
		<link rel="alternate" type="text/html" href="https://kb.rvmgroup.it/index.php?title=Shutdown_Remoto_di_una_macchina_Windows_da_Linux&amp;diff=4976&amp;oldid=prev"/>
		<updated>2006-11-30T18:59:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Si può usare uno script in Python:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
# win32shutdown.py&lt;br /&gt;
&lt;br /&gt;
import win32api&lt;br /&gt;
import win32con&lt;br /&gt;
import win32netcon&lt;br /&gt;
import win32security&lt;br /&gt;
import win32wnet&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def shutdown(host=None, user=None, passwrd=None, msg=None, timeout=0, force=1,&lt;br /&gt;
reboot=0):&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot; Shuts down a remote computer, requires NT-BASED OS. &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Create an initial connection if a username &amp;amp; password is given.&lt;br /&gt;
connected = 0&lt;br /&gt;
if user and passwrd:&lt;br /&gt;
try:&lt;br /&gt;
win32wnet.WNetAddConnection2(win32netcon.RESOURCET YPE_ANY, None,&lt;br /&gt;
&amp;#039;&amp;#039;.join([r&amp;#039;\\&amp;#039;, host]), None, user,&lt;br /&gt;
passwrd)&lt;br /&gt;
# Don&amp;#039;t fail on error, it might just work without the connection.&lt;br /&gt;
except:&lt;br /&gt;
pass&lt;br /&gt;
else:&lt;br /&gt;
connected = 1&lt;br /&gt;
# We need the remote shutdown or shutdown privileges.&lt;br /&gt;
p1 = win32security.LookupPrivilegeValue(host, win32con.SE_SHUTDOWN_NAME)&lt;br /&gt;
p2 = win32security.LookupPrivilegeValue(host,&lt;br /&gt;
win32con.SE_REMOTE_SHUTDOWN_NAME)&lt;br /&gt;
newstate = [(p1, win32con.SE_PRIVILEGE_ENABLED),&lt;br /&gt;
(p2, win32con.SE_PRIVILEGE_ENABLED)]&lt;br /&gt;
# Grab the token and adjust its privileges.&lt;br /&gt;
htoken = win32security.OpenProcessToken(win32api.GetCurrent Process(),&lt;br /&gt;
win32con.TOKEN_ALL_ACCESS)&lt;br /&gt;
win32security.AdjustTokenPrivileges(htoken, False, newstate)&lt;br /&gt;
win32api.InitiateSystemShutdown(host, msg, timeout, force, reboot)&lt;br /&gt;
# Release the previous connection.&lt;br /&gt;
if connected:&lt;br /&gt;
win32wnet.WNetCancelConnection2(&amp;#039;&amp;#039;.join([r&amp;#039;\\&amp;#039;, host]), 0, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
# Immediate shutdown.&lt;br /&gt;
shutdown(&amp;#039;salespc1&amp;#039;, &amp;#039;admin&amp;#039;, &amp;#039;secret&amp;#039;, None, 0)&lt;br /&gt;
# Delayed shutdown 30 secs.&lt;br /&gt;
shutdown(&amp;#039;salespc1&amp;#039;, &amp;#039;admin&amp;#039;, &amp;#039;secret&amp;#039;, &amp;#039;Maintenance Shutdown&amp;#039;, 30)&lt;br /&gt;
# Reboot&lt;br /&gt;
shutdown(&amp;#039;salespc1&amp;#039;, &amp;#039;admin&amp;#039;, &amp;#039;secret&amp;#039;, None, 0, reboot=1)&lt;br /&gt;
# Shutdown the local pc&lt;br /&gt;
shutdown(None, &amp;#039;admin&amp;#039;, &amp;#039;secret&amp;#039;, None, 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Riferimenti==&lt;br /&gt;
*[http://www.linuxforums.org/forum/redhat-fedora-linux-help/60324-remote-shutdown-windows-linux-box.html remote shutdown of Windows from Linux box-Redhat / Fedora Linux Help-Linux Forums]&lt;/div&gt;</summary>
		<author><name>Gabriele.vivinetto</name></author>
	</entry>
</feed>