HOW TO shutdown Windows Server from Windows Console ?? (without TelnetServer installed) - Debian

This is a discussion on HOW TO shutdown Windows Server from Windows Console ?? (without TelnetServer installed) - Debian ; HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed) are there any linux-forged CLI tools available ?...

+ Reply to Thread
Results 1 to 14 of 14

Thread: HOW TO shutdown Windows Server from Windows Console ?? (without TelnetServer installed)

  1. HOW TO shutdown Windows Server from Windows Console ?? (without TelnetServer installed)

    HOW TO shutdown Windows Server from Windows Console ?? (without Telnet
    Server installed)

    are there any linux-forged CLI tools available ?

  2. Re: HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed)

    ["Followup-To:" header set to alt.os.linux.suse.]
    Axel Werner wrote:
    > HOW TO shutdown Windows Server from Windows Console ?? (without Telnet
    > Server installed)


    With a hammer.

    What did I win?

    houghi
    --
    The blue light suddenly flashed on my horrified face. What a disaster!
    Oh, the humanity! I never thought it would happen to me. How terrifying
    it is to see for yourself "*The Blue Screen of Death*".

  3. Re: HOW TO shutdown Windows Server from Windows Console ?? (withoutTelnet Server installed)

    Am Wed, 11 Jul 2007 10:36:41 +0200 schrieb Axel Werner:

    > HOW TO shutdown Windows Server from Windows Console ?? (without Telnet
    > Server installed)


    You'll need first access to the server itself (ssh, telnet or similar),
    you should also have a shutdown.exe on the system (depends on the system).
    If not available see the link and build your own shutdown CLI
    (http://msdn2.microsoft.com/en-us/library/aa376883.aspx).
    cheers

  4. Re: HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed)

    On Wed, 11 Jul 2007 10:36:41 +0200, Axel Werner wrote:

    > HOW TO shutdown Windows Server from Windows Console ?? (without Telnet
    > Server installed)


    Just pull the power cord out of the wall socket.



    --
    "Ubuntu" -- an African word, meaning "Slackware is too hard for me".


  5. Re: HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed)

    On Jul 11, 4:36 am, Axel Werner wrote:
    > HOW TO shutdown Windows Server from Windows Console ?? (without Telnet
    > Server installed)
    >
    > are there any linux-forged CLI tools available ?


    I don't know of any Linux forged tools, but if you are running wine
    you can download pstools. There is a tool bundled called psshutdown
    that has all the functions of shutdown.exe and then some.


  6. Re: HOW TO shutdown Windows Server from Windows Console ?? (withoutTelnet Server installed)

    DarthTBone@gmail.com schrieb:
    > I don't know of any Linux forged tools, but if you are running wine
    > you can download pstools. There is a tool bundled called psshutdown
    > that has all the functions of shutdown.exe and then some.


    thanks fer your smart reply!! much smarter than all the other replies
    yet. those other replies are mostly lame and boring. not funny at all.

    i know pstools and psshutdown. this is what im looking for, but for use
    on linux consoles without any telnet or even wine

    but thanks anyway for hint. at least wine would be a solution to bring
    pstools alive on linux.

    anyone got another hint to bring down a windows server from linux console ?

  7. Re: HOW TO shutdown Windows Server from Windows Console ?? (withoutTelnet Server installed)

    Dan C schrieb:
    > Just pull the power cord out of the wall socket.


    seems someone pulled off the cord from your brain u missed the point
    and its not even funny. next time reading the question before answering
    might help!

  8. Re: HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed)

    On Jul 12, 10:25 am, Axel Werner wrote:
    > DarthTB...@gmail.com schrieb:
    > > I don't know of any Linux forged tools, but if you are running wine

    >
    > > you can download pstools. There is a tool bundled called psshutdown
    > > that has all the functions of shutdown.exe and then some.

    >
    > thanks fer your smart reply!! much smarter than all the other replies
    > yet. those other replies are mostly lame and boring. not funny at all.
    >
    > i know pstools and psshutdown. this is what im looking for, but for use
    > on linux consoles without any telnet or even wine
    >
    > but thanks anyway for hint. at least wine would be a solution to bring
    > pstools alive on linux.
    >
    > anyone got another hint to bring down a windows server from linux console ?


    Here is a python script I got from:
    http://www.linuxforums.org/forum/red...linux-box.html

    #!/usr/bin/env python
    # win32shutdown.py

    import win32api
    import win32con
    import win32netcon
    import win32security
    import win32wnet


    def shutdown(host=None, user=None, passwrd=None, msg=None, timeout=0,
    force=1,
    reboot=0):
    """ Shuts down a remote computer, requires NT-BASED OS. """

    # Create an initial connection if a username & password is given.
    connected = 0
    if user and passwrd:
    try:
    win32wnet.WNetAddConnection2(win32netcon.RESOURCET YPE_ANY, None,
    ''.join([r'\\', host]), None, user,
    passwrd)
    # Don't fail on error, it might just work without the connection.
    except:
    pass
    else:
    connected = 1
    # We need the remote shutdown or shutdown privileges.
    p1 = win32security.LookupPrivilegeValue(host,
    win32con.SE_SHUTDOWN_NAME)
    p2 = win32security.LookupPrivilegeValue(host,
    win32con.SE_REMOTE_SHUTDOWN_NAME)
    newstate = [(p1, win32con.SE_PRIVILEGE_ENABLED),
    (p2, win32con.SE_PRIVILEGE_ENABLED)]
    # Grab the token and adjust its privileges.
    htoken = win32security.OpenProcessToken(win32api.GetCurrent Process(),
    win32con.TOKEN_ALL_ACCESS)
    win32security.AdjustTokenPrivileges(htoken, False, newstate)
    win32api.InitiateSystemShutdown(host, msg, timeout, force, reboot)
    # Release the previous connection.
    if connected:
    win32wnet.WNetCancelConnection2(''.join([r'\\', host]), 0, 0)


    if __name__ == '__main__':
    # Immediate shutdown.
    shutdown('salespc1', 'admin', 'secret', None, 0)
    # Delayed shutdown 30 secs.
    shutdown('salespc1', 'admin', 'secret', 'Maintenance Shutdown', 30)
    # Reboot
    shutdown('salespc1', 'admin', 'secret', None, 0, reboot=1)
    # Shutdown the local pc
    shutdown(None, 'admin', 'secret', None, 0)


  9. Re: HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed)

    On Jul 12, 10:25 am, Axel Werner wrote:
    > DarthTB...@gmail.com schrieb:
    > > I don't know of any Linux forged tools, but if you are running wine

    >
    > > you can download pstools. There is a tool bundled called psshutdown
    > > that has all the functions of shutdown.exe and then some.

    >
    > thanks fer your smart reply!! much smarter than all the other replies
    > yet. those other replies are mostly lame and boring. not funny at all.
    >
    > i know pstools and psshutdown. this is what im looking for, but for use
    > on linux consoles without any telnet or even wine
    >
    > but thanks anyway for hint. at least wine would be a solution to bring
    > pstools alive on linux.
    >
    > anyone got another hint to bring down a windows server from linux console ?


    Here is a python script I got from:
    http://www.linuxforums.org/forum/red...linux-box.html

    #!/usr/bin/env python
    # win32shutdown.py

    import win32api
    import win32con
    import win32netcon
    import win32security
    import win32wnet


    def shutdown(host=None, user=None, passwrd=None, msg=None, timeout=0,
    force=1,
    reboot=0):
    """ Shuts down a remote computer, requires NT-BASED OS. """

    # Create an initial connection if a username & password is given.
    connected = 0
    if user and passwrd:
    try:
    win32wnet.WNetAddConnection2(win32netcon.RESOURCET YPE_ANY, None,
    ''.join([r'\\', host]), None, user,
    passwrd)
    # Don't fail on error, it might just work without the connection.
    except:
    pass
    else:
    connected = 1
    # We need the remote shutdown or shutdown privileges.
    p1 = win32security.LookupPrivilegeValue(host,
    win32con.SE_SHUTDOWN_NAME)
    p2 = win32security.LookupPrivilegeValue(host,
    win32con.SE_REMOTE_SHUTDOWN_NAME)
    newstate = [(p1, win32con.SE_PRIVILEGE_ENABLED),
    (p2, win32con.SE_PRIVILEGE_ENABLED)]
    # Grab the token and adjust its privileges.
    htoken = win32security.OpenProcessToken(win32api.GetCurrent Process(),
    win32con.TOKEN_ALL_ACCESS)
    win32security.AdjustTokenPrivileges(htoken, False, newstate)
    win32api.InitiateSystemShutdown(host, msg, timeout, force, reboot)
    # Release the previous connection.
    if connected:
    win32wnet.WNetCancelConnection2(''.join([r'\\', host]), 0, 0)


    if __name__ == '__main__':
    # Immediate shutdown.
    shutdown('salespc1', 'admin', 'secret', None, 0)
    # Delayed shutdown 30 secs.
    shutdown('salespc1', 'admin', 'secret', 'Maintenance Shutdown', 30)
    # Reboot
    shutdown('salespc1', 'admin', 'secret', None, 0, reboot=1)
    # Shutdown the local pc
    shutdown(None, 'admin', 'secret', None, 0)


  10. Re: HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed)

    On Jul 12, 4:28 pm, Axel Werner wrote:
    > Dan C schrieb:
    >
    > > Just pull the power cord out of the wall socket.

    >
    > seems someone pulled off the cord from your brain u missed the point
    > and its not even funny. next time reading the question before answering
    > might help!


    I thoiugh it was funny.


  11. Re: HOW TO shutdown Windows Server from Windows Console ?? (without Telnet Server installed)

    Government satellites recorded AJackson saying:
    > On Jul 12, 4:28 pm, Axel Werner wrote:
    >> Dan C schrieb:
    >>
    >> > Just pull the power cord out of the wall socket.

    >>
    >> seems someone pulled off the cord from your brain u missed the point
    >> and its not even funny. next time reading the question before answering
    >> might help!

    >
    > I thoiugh it was funny.
    >


    Thought it was a good light hearted quip as well.

    --
    sk8r-365

    http://goodbye-microsoft.com/

  12. Re: HOW TO shutdown Windows Server from Windows Console ?? (withoutTelnet Server installed)

    Darth T schrieb:
    >>
    >> anyone got another hint to bring down a windows server from linux console ?

    >
    > Here is a python script I got from:
    > http://www.linuxforums.org/forum/red...linux-box.html
    >



    WOOOW! Thanks a lot! this is a good one!

  13. Re: HOW TO shutdown Windows Server from Windows Console ?? (withoutTelnet Server installed)

    Axel Werner wrote:
    > HOW TO shutdown Windows Server from Windows Console ?? (without Telnet
    > Server installed)
    >
    > are there any linux-forged CLI tools available ?


    If you have SAMBA installed on your Linux machine do

    /usr/bin/net rpc shutdown -I -U

  14. Re: HOW TO shutdown Windows Server from Windows Console ?? (withoutTelnet Server installed)

    Black Dew schrieb:
    >> HOW TO shutdown Windows Server from Windows Console ?? (without Telnet
    >> Server installed)

    > If you have SAMBA installed on your Linux machine do
    > /usr/bin/net rpc shutdown -I -U


    Thanks for that one! i suddenly found this tool too, last friday and
    tested a bit... however it seems not working for me. anywhay this is/was
    the tool i was looking for! so thanks again!


    i tried using it just like u up there.. no luck. with local and domain
    users... no effect. i checked samba manuals and tried using ip or
    hostname. no luck. my win server wont go down. however i was able to see
    in nt event log that something has been authenticated from my linux
    host. but my server was not about to shutdown. its a domain-member
    server (ADS). i did not found any GPOs in domain or at local system
    saying that it cant be shutdown from network. however it wont do a thing
    anyway..

    but this is another story )

    thanks fer help
    Axel

+ Reply to Thread