Jump to content

Recommended Posts

Posted
Hi im looking for a vb script that i can put in the startup folder that will check all the time if the network cable is unpluged or not. We have a member of staff who keeps doing this so that we cannot get onto there machine. I would like it to turn the machine off if the cable gets disconected. Hope someone can help Thanks
Posted

Yeesh, i'd just get SLT to tell them to stop messing with the equipment! The problem is its not "their" machine to start with...

 

Sorry that doesnt help....hit a nerve lol!

Posted

How Can I Be Notified Any Time a Network Cable Gets Unplugged? - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs

 

Just adjust the code to make it log the user off or shutdown or the likes

 

shutdown url --> Win32Shutdown method of the Win32_OperatingSystem Class (Windows)

 



Function ShutDown(strComputer)
   ShutDown = -1
   WScript.Echo "Shutting down: " & strComputer
   on error resume next
   Set objWMIShutDownService = GetObject("winmgmts:" & "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2")
   Set colOperatingSystems = objWMIShutDownService.ExecQuery("Select * from Win32_OperatingSystem")
   If Err <> 0 Then
       DisplayErrorInfo
   Else
       For Each objOperatingSystem in colOperatingSystems
           ' See: http://msdn.microsoft.com/en-us/library/aa394058(VS.85).aspx
           ShutDown = ObjOperatingSystem.Win32Shutdown(1+4,0)
           ' WScript.Echo ObjOperatingSystem.Name
       Next
    End If
   on error goto 0
End Function

 

Just merge vb code as required and adjust the shutdown numbers as per the link

 

Technical work around above, as per little miss said it looks more like a management issue rather than a technical one :)

Posted

You could also make it hard for them to do this ... RJ LOCKDOWN CAT5 & 6 PATCH CORD LOCK

 

The other option (assuming it's a desktop machine) would be to buy a USB Network Card, attach that internally to an internal USB connection, feed the Cat5 through a small hole, put the RJ45 on the end, and connect to the network. This way, they would seriously struggle to unplug the thing, and if they did manage to, they'd need you guys to come and reconnect when they wanted to do something on the network / online etc, at which point you can be conveniently busy for as long as it takes to get the message across .. :)

Posted
Thanks for the ideas guys i have put the edulock on the machine the only trouble is he has two screens and it only locks one of them so he can still access stuff on the other screen. This is a real pain.
Posted
Have you mentioned this to SLT? Just point out that you're not able to support that particular machine because he insists on unplugging it and should something go wrong, you won't be notified (ham it up a bit .. but within reason).
Posted
enable wireless on his machine and add the wireless profile to always connect, use GPO to stop him from disabling the wireless connection and in the bios of the machine adjust the relevant setting(s) so using the physical slider switch does not disable wireless, password protect the bios so they can't change this, not sure if there is a way to stop him from going control panel --> network connections --> right click --> disable ??
Posted

Why does he keep unplugging it? What purpose does it serve for him to unplug it? Surely once logged on the GPOs remain in effect preventing admin access and he shouldn't have a local login account?

 

If he has local login rights take those away for starters, if he has found a way around GPOs and uses it regularly block his user account under your UAP which (presumably) states that students and staff are not allowed to circumvent the protections and systems in place to gain unauthorised access and keep it blocked until you can find a reliable way of preventing it.

 

Stack overflow has this:

command line - How to check if ping responded or not in a batch file - Stack Overflow

 

It's a setup for batch files that check a ping result, obviously rather then just setting an error state force a shutdown with:

shutdown -t 0 -r -f (windows XP, not 100% sure about vista/7)

 

When he complains tell him not to do and slam the door in his face!

 

If he wants IT support then he HAS to abide by the AUP and other "rules" for the system, he can't have the best of both words, he either abides by the rules and gets IT support or breaks them and deals with the problems himself.

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



×
×
  • Create New...