+ Post New Thread
Results 1 to 10 of 10
Scripts Thread, Unplug Network Cable Script in Coding and Web Development; Hi im looking for a vb script that i can put in the startup folder that will check all the ...
  1. #1

    Join Date
    Jul 2012
    Posts
    6
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Unplug Network Cable Script

    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

  2. #2

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    Birmingham
    Posts
    5,359
    Thank Post
    2,331
    Thanked 624 Times in 419 Posts
    Blog Entries
    2
    Rep Power
    508
    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!

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,232
    Thank Post
    2,774
    Thanked 937 Times in 877 Posts
    Rep Power
    343
    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)

    Code:
    
    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

  4. #4
    mdench's Avatar
    Join Date
    Oct 2011
    Location
    Billingshurst
    Posts
    702
    Thank Post
    30
    Thanked 94 Times in 86 Posts
    Rep Power
    30
    Steve21 presents: EduLock Install this and everytime the cable gets unplugged it requires a password to unlock the screen again... they will soon get annoyed and will stop unplugging it!

  5. Thanks to mdench from:

    mac_shinobi (27th July 2012)

  6. #5

    Join Date
    Jul 2012
    Posts
    6
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks trouble is this guy just seams to get away with everything. Yes he says it is his machine doesnt understand its not thanks
    guys

  7. #6
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,356
    Thank Post
    617
    Thanked 274 Times in 241 Posts
    Rep Power
    77
    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 ..

  8. #7

    Join Date
    Jul 2012
    Posts
    6
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

  9. #8
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,356
    Thank Post
    617
    Thanked 274 Times in 241 Posts
    Rep Power
    77
    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).

  10. #9

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,232
    Thank Post
    2,774
    Thanked 937 Times in 877 Posts
    Rep Power
    343
    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 ??

  11. #10

    Join Date
    Mar 2010
    Location
    shadowx@AllEvil:/
    Posts
    222
    Thank Post
    12
    Thanked 28 Times in 25 Posts
    Rep Power
    13
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Deterring Kids From Unplugging Network Cables
    By farquea in forum Windows
    Replies: 85
    Last Post: 19th March 2012, 02:35 PM
  2. Auto shutdown when network cable is unplugged
    By BenTruscott in forum Network and Classroom Management
    Replies: 12
    Last Post: 12th September 2011, 11:56 AM
  3. students unplugging network cable
    By centurio in forum Network and Classroom Management
    Replies: 14
    Last Post: 3rd May 2011, 09:11 PM
  4. Replies: 4
    Last Post: 30th November 2010, 06:56 PM
  5. Students and Network Cables
    By ninjabeaver in forum Wireless Networks
    Replies: 36
    Last Post: 23rd November 2005, 09:14 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •