Link to home
Start Free TrialLog in
Avatar of onebulgar
onebulgar

asked on

Remote Logoff script needed for Win2003

I am looking for a VBS script that will remotely FORCED_LOG_OFF or restart w/force, I found a few scripts that worked great on XP and win2k machines, but didn't on Windows 2003.

Thanks a bunch!
Avatar of chandru_sol
chandru_sol
Flag of India image

Hi,

You can use psshutdown to remote logoff Windows 2003 servers.
You can download the same from here........

http://www.microsoft.com/technet/sysinternals/utilities/psshutdown.mspx

psshutdown /accepteula -f -o \\Computer
You can also use qlogoff.exe from www.joeware.net/freetools
Avatar of onebulgar
onebulgar

ASKER

These are really great suggestions, but I would really like a script for security reasons. The script I can read and modify if needed. However, I can't do the same with these :(
ASKER CERTIFIED SOLUTION
Avatar of LauraEHunterMVP
LauraEHunterMVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, that is the exact script that I tried and it didn't work. It had issues with "oSys.Win32ShutDown(5)" line
I should add that it worked great on XP, but it didn't go very well with 2003.
Hi,

As WMI is not enabled by default in Windows 2003 server, can you try enabling WMI as per the link at the bottom and give it a try

http://www.microsoft.com/technet/scriptcenter/resources/qanda/jul05/hey0712.mspx

Can you post the error you are getting?
I already tried that but I will try again and will post the results in a few days. I remember that it didn't like the fact that it was Win32ShutDown had a number..."Win32ShutDown(5)"?
The error I am getting is:

Scritp: ...\Remote Logoff.vbs
Line: 32
Char: 4
Error: Generic failure
Code: 80041001
Source: SWbemObjectEx

This works in XP and 2000 Machines and not in Windows 2003 servers. I am looking into it today to see what is going wrong
I gave it a B as this didn't fully work on what I needed but I was able to use some of the code to make it work.