Discussion Locked

Scripting

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Does anyone know if there is a way to write a script of some sort in NT that finds whether or not a user is logged onto a server and then based on that answer, close the open resources they have on the server?

7 replies

by joseph moore

You can just use Server Manager. Connect with it to the server you want to check, click Users, and see if the user you want to keep out is connected. It will show what that user has open also.
You can then just click the Disconnect button to kick the user off.

by glasswalkertheurge

I would suggest going to http://www.activestate.com/Products/ActivePerl/ and checking out the PERL scripting language. I could not give you the specific perl commands, but as I recall what you want should be pretty easy. Get on some mailing lists (http://www.perl.org/), they should be able to chug out 15 lines of code or less to fix your problem. Use NTs AT command (help at) to schedule the script (I would associate the .pl extension with the PERL compiler), and life is good.

by kahana

yes, thru the file service object (in vbs with the addition af iads objects)
it is a special type of object that is returned by the lanman server.
put this in a vbs file
set s = getobject("winnt//DOMAIN/SERVER/lanmanservice,fileservice")
set ses1 = fso.sessions
for each session in s.sessions
if session.user = "whatever" then ses1.remove "session",session.name
next

This discussion is closed to new replies.