Results 1 to 6 of 6

Thread: shutdown server on a lan

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Posts
    138

    shutdown server on a lan

    Hi gurus

    I would like to write a program the will shutdown servers on an specific sequence using VB2003 application.

    something similar to psshutdown@file, which I used right now when outage are in place and I need to bring my servers down before ups run out of juice.Can this be possible

    Thanks in advance for your help

  2. #2
    Frenzied Member dolot's Avatar
    Join Date
    Nov 2007
    Location
    Ancient City, U.S.
    Posts
    1,254

    Re: shutdown server on a lan



    Yep. the way I did it one time was to simply have a service that was installed on the local server that I wanted to shut down. There's a command you can run that tells the server to shut down. I don't remember what it was - you'll have to look that up - but it had parameters associated with it so you could tell what kind of shutdown to do. Maybe somebody else here knows the exact command.

    Anyway, I had .net 2003 front end that communicated with the service using .net remoting. I actually had several servers that were configured this way and all were controlled by one central app. .net remoting is not too complicated once you figure it out, and there's plenty of good documentation out there.

    That's the really high level view of the solution.
    I always add to the reputation of those whose posts are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
    My war with a browser-redirect trojan

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Posts
    138

    Re: shutdown server on a lan

    Thanks D

    You mentioned a service, do you remeber by any chance what kind of service.

    thanks a bunch

  4. #4
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: shutdown server on a lan

    Doesn't shutdown.exe work?

    If worse comes to worse, just make a little winsock app that sits in the background listening on a certain port waiting for a specific password. If you're worried about security, make it the day's date x 2 for each day month and year or something. I'm sure you could be more creative then that though.

  5. #5
    Frenzied Member dolot's Avatar
    Join Date
    Nov 2007
    Location
    Ancient City, U.S.
    Posts
    1,254

    Re: shutdown server on a lan

    When I say a service I mean use .net to build your own custom service to listen and do the work for you. Windows service is one of the project types available for .net.

    When you create this service, all you'll need is a public method that shuts down the server. This method, in turn, will be accessed as a remote object from your controlling front end. It will be accessed through .net remoting. So, you could almost think of this new service that you will create as an object library that sits on a remote server.

    Do some reading in the MSDN or online about .net remoting and they will talk about using a service as the remote object. You'll quickly get the picture.
    I always add to the reputation of those whose posts are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
    My war with a browser-redirect trojan

  6. #6
    Frenzied Member dolot's Avatar
    Join Date
    Nov 2007
    Location
    Ancient City, U.S.
    Posts
    1,254

    Re: shutdown server on a lan

    BTW, shutdown.exe may be the command you need to use. It seems I used a method in the .net framework somewhere to do my shutdown, but I may be completely wrong.
    I always add to the reputation of those whose posts are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
    My war with a browser-redirect trojan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width