Re: psshutdown issue: shutdowns computers when using a logoff command!!
From: Fredrik Landin (landin_at_home.se)
Date: 02/18/04
- Next message: Ellak: "password to script"
- Previous message: Amorpheous: "Properties of Computer Object"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Feb 2004 11:18:16 +0100
This is what we use to shutdown our Windows Server 2003 servers, we had a
simular issue with several of our servers.
The problem we had was when someone was logged on to the console, on another
server the problem was disconnected RDP sessions.
If you have multiple sessions logged on to a server just add more sessions
to the logoff part of the script.
Logoff [session id]
Just schedule a batch file with this whenever you need the restart, you also
need something to let the server wait to let the session logging off to
logoff.
The echo | command is used if there are any questions aksed, it just presses
"enter" and continues.
You can also use echo |y command or echo |n or anything you need to respond
to anything inside a batch script.
-
echo | logoff
timeout 2
echo | logoff 1
timeout 2
echo | logoff 2
timeout 2
echo | logoff 3
timeout 2
echo | logoff 4
timeout 2
echo | logoff 5
timeout 2
shutdown /r /f /c "restart" /t 15 /m \\SERVERNAME /d p:4:1
-
Good luck,
Fredrik
-- > I created a VB.Net program that retrieves particular computers names from the Active Directory and that then logs off all those machines every night (via a Scheduled Task) using the well-known already-existing "psshutdown" program. > I am using the following syntax in order to perform the logoff: > "psshutdown -f -o -u MyUsername -p MyPassword \\MyMachine" > > The first time I use it in order to log off a machine that has not been logged off yet, then it works fine! > But if I reuse the same command (that you have above!) to a computer that has already been logged off, then this causes the computer to be shut down (with a message on the screen that looks like the following: "It is now safe to turn off your computer"), which I don't want!!!!! > Is this a bug? > Is there any aother way using psshutdown or another program in order to be able to log off a machine when not logged off yet and not to do anything when not yet logged on ? > > I would really appreciate if someone could give me a hand on this matter. > Thank you in advance. > Julien.
- Next message: Ellak: "password to script"
- Previous message: Amorpheous: "Properties of Computer Object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|