Re: psshutdown issue: shutdowns computers when using a logoff command!!

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Fredrik Landin (landin_at_home.se)
Date: 02/18/04


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.


Relevant Pages

  • Re: USSTAB color question
    ... The server sends the USS messages; ... command and there is no session in place, ... data - along with the same USS commands, specifically the LOGOFF versions ...
    (bit.listserv.ibm-main)
  • Re: WEB SITE PROJECT DEPLOYMENT ~ Help please??
    ... ECHO When/If prompted with the question: ... The files are all now sitting on my Server, and when I load my web site, ... An error has occurred while establishing a connection to the server. ... The connection string specifies a local Sql Server Express instance using ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: login/logoff Report
    ... On the client PC I do see the logoff script run in the logoff window. ... also run gpupdate /force on the server and client. ... was also able to edit this file in the shared folder. ... Server 2003, Windows XP Professional, or Windows 2000 ...
    (microsoft.public.windows.server.sbs)
  • Re: Script Need to check disk space on remote servers
    ... Is it possible to get SQL Server database and log information (like ... echo Checking drives on Server %%S... ... REM this part of the script generates an HTML file with all the ... REM and then launches it using the default browser. ...
    (microsoft.public.windows.server.scripting)
  • Re: Script Need to check disk space on remote servers
    ... Is it possible to keept the process running by skipping over remote computer ... Is it possible to get SQL Server database and log information (like ... echo Checking drives on Server %%S... ... REM and then launches it using the default browser. ...
    (microsoft.public.windows.server.scripting)