[Plugin] [CLOSED] WOL-PowerManager (3 Viewers)

Status
Not open for further replies.

Luca Brasi

MP Donator
  • Premium Supporter
  • November 14, 2007
    1,026
    119
    Home Country
    Germany Germany
    Is there a way to have the server with WOL manually go back to sleep?
    Not over WOL but you can use other tools like shutdown.exe to tell the remote machine to go to sleep. Depends on what kind of NAS/Server you run.
    If there is any kind of process running/system tool there which is able to trigger the suspend it should be possible to call it from your htpc via command line. But this is still in development, have a look at my post #143...
     
    Last edited:

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,565
    3,946
    Lehmden
    Home Country
    Germany Germany
    Hi.

    Is there a way to have the server with WOL manually go back to sleep?
    Yes you can ;)
    If you use pstools. It's easy, one of those "famous" two line batch files...
    Code:
    cd c:\Wake-Hibernate\
    psshutdown -h -u user -p password -t 0 \\SERVER
    first line cd's to the dir with psshutdown.exe in.
    second line is the command -h means hibernate in this case -u is a valid user on the Server!!! and -p the corresponding password, -t is the time to wait until shutdown, here 0 means no wait.

    You can add this as shortcut to MP as well with Multishortcut plugin:
    hibernate.jpg


    I'm using this since years without any issue. Only at very first start of psshutdown you need to confirm the Terms of use...
     

    Luca Brasi

    MP Donator
  • Premium Supporter
  • November 14, 2007
    1,026
    119
    Home Country
    Germany Germany
    This will work! I made a mistake in my last post: The shutdown.exe is not able to trigger suspend, only hibernate I think. But you can use this: http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx Just have a look the arguments. I'm not sure if psshutdown has to be present on the remote machine (server). You can put it to C:\Windows\System32 just to be sure... The command would look like something like this: psshutdown \\yourserversname -d[DOUBLEPOST=1345738001][/DOUBLEPOST]@Lehmden: :)
     

    Luca Brasi

    MP Donator
  • Premium Supporter
  • November 14, 2007
    1,026
    119
    Home Country
    Germany Germany
    yepp, not necessary, quick test worked...
    I put psshutdown to c:\windows\system32 on the client so there is no need for the first line of the batch. I didn't need to put in credentials either as my user on the client is present on the server with same user/pass.
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,565
    3,946
    Lehmden
    Home Country
    Germany Germany
    Hi.
    The batch from above is working in all circumstances as long as all parameters are fit to the users system. No need to have same user on all PC or having psshutdown in path... I always have the same user on all my machines (makes live a lot easier) but prefer to give user/pass as arguments here. I made a copy of this folder which contains not only psshutdown.exe with .bat but also wolcmd.exe with .bat to manually wakeup Server (and also as Multishortcut Plugin inside MP) I can copy this folder to any PC as long as I copied it to c: all is working without any changes... That's why I've done it this way...
     

    Luca Brasi

    MP Donator
  • Premium Supporter
  • November 14, 2007
    1,026
    119
    Home Country
    Germany Germany
    Yeah that's smart! I think only thing one should be aware of is that you will have to change your bat if you change your password on your systems... if you don't do that from time to time: nothing to care about...
     

    seppi2204

    Portal Pro
    December 8, 2010
    103
    56
    Stuttgart
    Home Country
    Germany Germany
    Glad to hear it Lehmden! I'll zip up the code and post it here for Seppi to review and take over.[DOUBLEPOST=1345670974][/DOUBLEPOST]Hi Seppi,

    Please find attached the source code that I used for my last release to Lehmden. This code fixes his ping error and includes all the other work that I did to fix my WOL issue from a wireless laptop. I also included the source for a simple installation under an Install folder.

    For the latest fix, all I had to do was allow WakeSelectedServer() to ignore an unknown ping exception and go ahead and try to wake up the servers anyway.

    I'll now turn the project back over to you. Thanks for the great plug-in!(y)

    Thanks for your effort GJC, i will merge this with my current source and release a new version soon!
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom