Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: A script to Log a machine off

HTVi
TV Discussion Newsgroups

A script to Log a machine off
"Valex (Joe)" <joeboswell[ at ]gmail.com> 5/14/2007 8:41:22 PM
I did a bit of searching and couldn't find anything that I could
modify very easily as my scripting knowledge is quite limited in this
regard, I simply needed a VBScript that force quits everything and
boots the user off the computer.

The idea is that I am taking it and putting it into a Scheduled Task
that checks for Idle time and then boots the user after a given amount
of time, the script will also be setting reg keys to log back in
automatically.

Then a GPO will be overwriting those keys when the computer logs in so
that a user that walks up to the workstation will be able to log out
and get onto the workstation with his login.

Pretty much easy except for the whole logout thing...

Joe

Re: A script to Log a machine off
"CreateWindow" <createwindow[ at ]gmail.com> 5/15/2007 12:09:01 AM
Dear Valex,

I didn't read your post carefully, so this script may not work for your
logoff case.
Here it is - hope it helps.... I commented out the messagebox - its the same
script I use on all my client desktops. I train them to log off at night or
shutdown. ;-)

Option Explicit
Dim Res, WshShell, ExitCode
'Res = MsgBox("Are you sure you want to logoff?", vbYesNo, "Logoff?")
'if Res = vbYes then
Set WshShell = WScript.CreateObject("WScript.Shell")
ExitCode = WshShell.Run("logoff", 10, TRUE )
Set WshShell = Nothing
'End if
' End code

CreateWindow
http://justpageprobe.com
The FREE Web page utility you always wanted.
Monitor your enterprise Web Servers.
Keep your router connected.
Email your IP to where you need it.
http://mymessagetaker.com
Stop using those paper phone message pads
make the computer work for you.



"Valex (Joe)" <joeboswell[ at ]gmail.com> wrote in message
news:1179175282.623163.61010[ at ]e51g2000hsg.googlegroups.com...
[Quoted Text]
>I did a bit of searching and couldn't find anything that I could
> modify very easily as my scripting knowledge is quite limited in this
> regard, I simply needed a VBScript that force quits everything and
> boots the user off the computer.
>
> The idea is that I am taking it and putting it into a Scheduled Task
> that checks for Idle time and then boots the user after a given amount
> of time, the script will also be setting reg keys to log back in
> automatically.
>
> Then a GPO will be overwriting those keys when the computer logs in so
> that a user that walks up to the workstation will be able to log out
> and get onto the workstation with his login.
>
> Pretty much easy except for the whole logout thing...
>
> Joe
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen