Jump to content

Remote Logoff


Recommended Posts

Hi.

Does anybody know who to force a logoff in a remote station?

(script running in a machine and shutting down user in remote station)

Anay ideas ?

Thanx

:whistle:

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

There is a DOS-command, called Shutdown which I think can do what

you want...Haven't tested it fully yet though...

Or you can do it 100% AutoIt style..

You could make a script for the remote station which will shutdown

the computer if a net send-message is received

While 1

Sleep(100)
If WinExists("Messenger Service", "shutdown") Then
Shutdown(5)
EndIf

WEnd

So in this example you just have to send a net send-message to the

remote station and the computer will shutdown..

Dos command to send net send-messages :

net send REMOTE_STATION "MESSAGE"

Good luck !

Link to comment
Share on other sites

I like PStools from sysinternals

http://www.sysinternals.com/

here is the tool I would use from that:

PsShutdown

Windows NT/2K/XP does not come with a built-in command-line shutdown command. However, both the Windows NT 4 and Windows 2000 Resource Kits come with shutdown, a program that you can use to shutdown local and remote computers. PsShutdown is a clone of the Resource Kit shutdown tool, providing you the same options and ability to shutdown, and optionally reboot, local and remote Windows NT/2K/XP systems.

....

All of the utilities in the PsTools suite work on Windows NT, Windows 2000, Windows XP, and Server 2003 and none of the tools requires any special installation. You don't even need to install any client software on the remote computers at which you target them. Run them by typing their name and any command-line options you want. To show complete usage information, specify the "-?" command-line option.

That said, I like Helge's solution since it is almost all AutoIt.

Here is a little one I use that works with all Windows I think.

you only have to place the textfile z:\temp\shutdown.txt on a networked share that is mapped to Z drive.

Messenger is only available for WinNT bassed systems I think.

;place in startup, hide after debug is done.
Opt("TrayIconHide", 0)         ;0=show, 1=hide tray icon
While 1
Sleep(100)
If FileExists ( "z:\temp\shutdown.txt" ) Then
Shutdown(5)
EndIf
WEnd

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

I've been using the FileExist-trick on some of my scripts, and I thinks it's

better to use that on for example scripts where you are controlling many

computers, and where you can control them in many ways..

For example if you have 3 computers in your network which you have

installed a script on, in which all are waiting for commands from a INI-file

in a shared folder...

Example on INI-file :

[SECTION]

SCRIPTKITTY=Shutdown
LARRY=Restart
JDEB=Logoff

But for a simple Shutdown, it doesn't need to be all that advanced,

and I think the NET SEND method works pretty well...

Though just on WinNT, Win200 and WinXP !

Ha en riktig god kveld ! :whistle:

Link to comment
Share on other sites

heh heh, nice Helge, I was actually useing @ComputerName.txt basically in my close individual applications in scripts, with a shutdown.txt as well to have everyone out. I like the InI approach though. I think I would put a longer sleep in however, I wouldn't want that many file reads off the server.

Actually now that I am thinking about it, I need to go check my sleep rate, and how much additional traffic I am putting on with my existing script.

Always nice to have many options to choose from.

edit...so very sorry, my typing skills are not good at spellin names right.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

B)

Thanx all of you,

I think i'll wait for activex componets of AutoIt.

My basic wish is to use only a script with no 3rd party software, or remote machine file installation.

C U Around.

:whistle:

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...