Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote Desktop Reboot 1

Status
Not open for further replies.

PJFry

Technical User
Feb 6, 2005
93
US
I use remote desktop to hit my office PC from the house via my laptop and VPN. Sometimes it is necessary for me to reboot the remote machine and I usually have to call some at the office to log in and reboot. Is there a way to force a reboot remotely?

I am running XP Pro SP2 on the remote machine and XP Pro SP1 on the laptop.
 
the shutdown command

shutdown /? in a cmd window for more info

if you are an admin on the machine you are connected to .. you should still be able to choose "reboot"

For the shutdown command you can run it remotely or locally.
 
See what you can do via the Shutdown command. Perhaps Shutdown -r from the Remotes, Start Run box?

Type Shutdown /? from a Command Prompt to display the full Syntax of the command.
 
The easiest way is to enter 'shutdown -r' in the Start > Run dialog of the PC you are RDP'ing into. The only disadvantage is that the default timeout is 20 seconds. As a result, you may wish to use 'shutdown -r -t 0' which will shutdown and reboot immediately.

Alternatively, you could use a script on your laptop. Mark D. MacLachlan, another forum contributor, provided the following script. Copy it into Notepas and save it as 'RebootWS.vbs'.

Code:
'==========================================================================
'
' NAME: RebootWS.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE  : 9/18/2002
'
' COMMENT: Remotely reboots a PC.  May use machine name or IP address.
'
' MODIFICATIONS: 10/7/2002 Added support for confirmation box
'==========================================================================

On Error Resume Next
mname = InputBox("Enter Machine Name", "Reboot Machine")
If Len(mname) = 0 Then Wscript.Quit

if Msgbox("Are you sure you want to reboot machine " & mname, vbYesNo, "Reboot Machine") = vbYes then

        Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//" & mname).ExecQuery("select * from Win32_OperatingSystem where Primary=true")
        for each OpSys in OpSysSet
            OpSys.Reboot()
         next
end If

Hope this info helps...
 
You can also create a shortcut and leave it on the desktop,
which runs the shutdown -r -t 0
I have had my machine setup that way for quite some time and itworks out well.
 
The only reason I can think of for the 'restart' option not being present, is that it has not been enabled under your TS profile/permissions.


Carlsberg don't run I.T departments, but if they did they'd probably be more fun.
 
Another way to do it...

Press Ctrl-Alt-End, which sends a "Ctrl-Alt-Delete" to the remote machine. That will bring up Task Manager or the Windows Security screen, depending on your settings... and you can do a restart or a shutdown from there.
 
Are you saying that you need to call and have someone reboot the machine BEFORE you can log into it (that's what it sounds like)?

I only ask because if you are remoted into a machine with Remote Desktop Connector - all you have to do is click Start > Shutdown and select "Shut Down".

Make yourself a local admin of the remote PC if you aren;t already.



"He who laughs last probably made a backup. He who laughs loudest probably hasn't checked his backups in a while."
 
Fatboy0341,

Unless I'm missing something, when you connect to an XP workstation using "Remote Desktop Connection", and you click the Start button, you do not get a "Shutdown" option... just "Log off" and "Disconnect". This is regardless of being local admin or not. Now, Terminal Server is a different story...
 
Guitarzan, that is true but you also get a "Windows Security" option below your Run link. If you click Windows Security it will give the same functions as a Cntrl-Alt-Delete, including Shutdown.

Cheers
 
Ahh I see what you mean... I almost always use the "Classic Start Menu", so I usually don't see the "Windows Security" option. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top