Post by SueI don't think that last script would work, becuase the users are
Post by RevengerPost by Suehello. Also thankyou Pegasus for your last script.
I need a script to log off users from my SBS 2003 server. I have
told them they have to do it, but sometimes they forget.
A little info about the server
users folders are redirected to the server.
Try this batch file ... I wrote it for a coleague of mine who had to
echo off
FOR /F "usebackq delims== " %%i IN (`"query session | find
"rdp-tcp#""`) DO logoff %%i
You have to run this from the console session ... It will
disconnect all users except the one where the script is running
from.
-- Pozdrav
Jednom su izmislili papir po imenu Chuck Norris, ali papir nije
dopu9tao da itko sere po njemu !
You could give my script a try:
[code]
'=======================================================================
===
' ForceLogoff.vbs
' By Mark MacLachlan, The Spider's Parlor
' Usage- Double click and enter a machine name or IP address to force
logoff
'
' This code is Copyright (c) 2006 The Spider's Parlor.
'
' All rights reserved.
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.'
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE
SUPPLIERS BE
' LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
' COMMENT: Note that this script will wait for user input if a password
protected
' screen saver is enabled.
'
'=======================================================================
===
On Error Resume Next
Const FORCE = 4
mname = InputBox("Enter Machine Name", "Force Logoff of Machine")
If Len(mname) = 0 Then Wscript.Quit
if Msgbox("Are you sure you want to force logoff on machine " & mname,
vbYesNo, "Force Logoff of Machine") = vbYes then
Set OpSysSet =
GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//"
& mname).ExecQuery("select * from Win32_OperatingSystem where
Primary=true")
for each OpSys in OpSysSet
OpSys.Win32Shutdown FORCE
next
end If
[/code]
--