I use the following command to remotely shut down some Windows OS servers from a Linux OS PC (for example): net rpc SHUTDOWN -f -I 192.168.1.5 -U Administrador%su_contrasenna -W GTMBD but in one of them before shutting down I need to run some commands to disassemble and close a database system running on it. Is there a way to achieve it using some combination of samba? that is, from a PC with Linux operating system order the execution of a file.bat on a PC with Windows operating system. I hope understand the point. Thank in advance. -- Rommel Rodriguez Toirac rommelrt at nauta.cu
Windows 10 has ssh support. You could ssh into the machine, then execute those commands. On 10/6/21 2:53 PM, Rommel Rodriguez Toirac via samba <samba at lists.samba.org> wrote:> I use the following command to remotely shut down some Windows OS servers from > a Linux OS PC (for example): > > net rpc SHUTDOWN -f -I 192.168.1.5 -U Administrador%su_contrasenna -W GTMBD > > but in one of them before shutting down I need to run some commands to > disassemble and close a database system running on it. > Is there a way to achieve it using some combination of samba? that is, from a > PC with Linux operating system order the execution of a file.bat on a PC with > Windows operating system. > > I hope understand the point. > > Thank in advance. > >
I use Saltstack. Install the agent on all your Windows machines.>From your server:salt 'somemachine.customer.tld' cmd.run 'sc stop mydatabase' -A On Wed, Oct 6, 2021 at 1:54 PM Rommel Rodriguez Toirac via samba < samba at lists.samba.org> wrote:> I use the following command to remotely shut down some Windows OS servers > from > a Linux OS PC (for example): > > net rpc SHUTDOWN -f -I 192.168.1.5 -U Administrador%su_contrasenna -W GTMBD > > but in one of them before shutting down I need to run some commands to > disassemble and close a database system running on it. > Is there a way to achieve it using some combination of samba? that is, > from a > PC with Linux operating system order the execution of a file.bat on a PC > with > Windows operating system. > > I hope understand the point. > > Thank in advance. > > -- > Rommel Rodriguez Toirac > rommelrt at nauta.cu > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba >
Mandi! Rommel Rodriguez Toirac via samba In chel di` si favelave...> Is there a way to achieve it using some combination of samba? that is, from a > PC with Linux operating system order the execution of a file.bat on a PC with > Windows operating system.I used 'winexe', as just stated, now i use SSH; for pre-Win10 OS, i install it: https://github.com/PowerShell/Win32-OpenSSH -- dott. Marco Gaiarin GNUPG Key ID: 240A3D66 Associazione ``La Nostra Famiglia'' http://www.lanostrafamiglia.it/ Polo FVG - Via della Bont?, 7 - 33078 - San Vito al Tagliamento (PN) marco.gaiarin(at)lanostrafamiglia.it t +39-0434-842711 f +39-0434-842797 Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA! http://www.lanostrafamiglia.it/index.php/it/sostienici/5x1000 (cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)