Announcement

Collapse
No announcement yet.

Shutdown 2008 R2 from a remote lan machine

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shutdown 2008 R2 from a remote lan machine

    Hello,

    ​Sometimes when shutting down the server , it becomes frozen (I attach image). I know I can press the button "force shutdown" but I picture myself in a situation where I am in a RDS session and that for some reason, I cannot get to that screen.

    In this cases, could I force a shutdown from a remote machine, through powershell ? , Would I need a specific port open to be able to do this ?

    Thanks in advance.
    Attached Files
    Last edited by loureed4; 14th July 2016, 07:27.
    -
    Madrid (Spain).

  • #2
    cmd prompt will be shutdown -r (reboot) or -s (shutdown) -f (force) -m <machine name>
    Cant off hand remember the powershell equivalent but it will be there
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Thanks Ossian, I should have known, because I knew the "shutdown" command. Sorry.
      -
      Madrid (Spain).

      Comment


      • #4
        The thing is that this machine is in the DMZ, hence, ISA Server is in the middle ( in my labs I used ISA or TMG firewalls ).
        -
        Madrid (Spain).

        Comment


        • #5
          Your powershell command would be 'stop_computer <name> -force' (change the underscore to a dash - ). If you have remote management enabled on the machine in the DMZ, and your firewall allows RPC traffic thru, you shouldn't have a problem. You don't even have to use an RDP session, all you need do is open a PS cmd window as an administrator on your local machine (assuming you are issuing the command under an account which has that authority). I use this routinely. If you want to bounce the machine instead of shutting it down, use 'restart_computer <name> -force'.
          *RicklesP*
          MSCA (2003/XP), Security+, CCNA

          ** Remember: credit where credit is due, and reputation points as appropriate **

          Comment


          • #6
            Originally posted by RicklesP View Post
            If you have remote management enabled on the machine in the DMZ, and your firewall allows RPC traffic thru, you shouldn't have a problem.
            Yes, this is what I did, but a nuance: I allowed 3389 through the firewall, not RPC.

            I don't know what a PS cmd is, I will look into it, thank you so much!

            ​*Edition: "PS" = "PowerShell" , Opppss !!
            -
            Madrid (Spain).

            Comment


            • #7
              Originally posted by RicklesP View Post
              If you want to bounce the machine instead of shutting it down, use 'restart_computer <name> -force'.
              Since there is a firewall in between, should I not point to the IP rather than to the computer name ?

              -
              Madrid (Spain).

              Comment


              • #8
                That really depends on your DNS - if you can resolve name to IP, use name, if not, use IP
                Tom Jones
                MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
                PhD, MSc, FIAP, MIITT
                IT Trainer / Consultant
                Ossian Ltd
                Scotland

                ** Remember to give credit where credit is due and leave reputation points where appropriate **

                Comment


                • #9
                  But, would not I need netbios (137, 138, 139) traffic going and coming through the firewall?. The machine I want to shutdown is in the DMZ, and mine is in the LAN.

                  "shutdown computer_name....." (not FQDN computer name), that is, the netbios name I believe.
                  -
                  Madrid (Spain).

                  Comment


                  • #10
                    That really depends on your DNS - if you can resolve name to IP, use name, if not, use IP
                    Last edited by Alex25; 4th September 2016, 02:28.

                    Comment


                    • #11
                      Thanks a lot Alex!
                      -
                      Madrid (Spain).

                      Comment

                      Working...
                      X