+ Post New Thread
Page 4 of 6 FirstFirst 123456 LastLast
Results 46 to 60 of 86
Windows Thread, Deterring Kids From Unplugging Network Cables in Technical; Wireless adaptors are usually known as "Wireless Network Connection"...
  1. #46

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,941
    Thank Post
    1,628
    Thanked 1,898 Times in 1,410 Posts
    Blog Entries
    2
    Rep Power
    429
    Wireless adaptors are usually known as "Wireless Network Connection"

  2. #47
    p858snake's Avatar
    Join Date
    Dec 2008
    Location
    Queensland
    Posts
    1,490
    Thank Post
    37
    Thanked 175 Times in 151 Posts
    Blog Entries
    2
    Rep Power
    51
    Quote Originally Posted by Steve21 View Post
    I'll try to sort it this afternoon if I get some free time, but harder to play with it when I don't have a wireless card on this pc :P

    *Edit - On a side note, do you know the name of your wireless adaptors? or you got many different ones? Easier to pick it's name, rather than checking all connections

    Steve
    You could run and detect the output of "getmac" and see what it gives as the transport name, iirc it will give the mac address and a "media not connected" when it isn't connected to a wifi network.

  3. #48

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by nephilim View Post
    Wireless adaptors are usually known as "Wireless Network Connection"
    You sure?

    I know if I return instancenames on wired adaptors I get names such as :

    Computer Name: ICTTECH-01
    InstanceName: Intel(R) 82567LM-3 Gigabit Network Connection
    NdisLinkSpeed: 1000 Mbps
    Steve

  4. #49

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,941
    Thank Post
    1,628
    Thanked 1,898 Times in 1,410 Posts
    Blog Entries
    2
    Rep Power
    429
    but on the physical machine they appear as Wireless Network Connection if you are doing batch scripts etc.

    EG I have this one

    Code:
    netsh interface ip set address name="Wireless Network Connection" static 10.***.48.235 255.255.***.0 10.***.48.1 1
    netsh interface ip set dns "Wireless Network Connection" static 10.***.55.254
    (Stars inserted deliberately here)

    Just change the IP per machine, and it will work. Also works on other scripts where I need to config the wireless cards (and they are different on laptops, PCs, tablets etc)

  5. #50
    BatchFile's Avatar
    Join Date
    Aug 2007
    Location
    Cumbria
    Posts
    948
    Thank Post
    544
    Thanked 128 Times in 106 Posts
    Rep Power
    60
    Deterring Kids From Unplugging Network Cables
    Connect +240v to the 4 unused pins.
    Instruct Teachers to look for kids flying backwards across the room

  6. Thanks to BatchFile from:

    eddyc (9th August 2011)

  7. #51

    Join Date
    Jun 2009
    Posts
    372
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    20
    it does work actually, just didnt have the policy linked up to our Laptops OU. Only problem now is when it kills IE, locks the computer, you log back on and can load up IE without the cable or wireless being back on. From the script i thought it was meant to loop and keep closing IE while there was no network connection. I want it to do this ideally but that script means very little to me, i can see what it does but no idea how to edit it.
    Anyone help?

  8. #52

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    I know I slacked a bit, but if anyone was still after it:

    Code:
    Option Explicit  
    Dim strHost
    strHost = "www.google.com"
    PingForever strHost  
    Sub PingForever(strHost)     
    Dim Shell, strCommand, ReturnCode      
    Set Shell = CreateObject("wscript.shell")     
    strCommand = "ping -n 1 -w 300 " & strHost     
    While(True)         
    ReturnCode = Shell.Run(strCommand, 0, True)              
    If ReturnCode = 0 Then             
    Else             
    Shell.Run "rundll32 user32.dll,LockWorkStation"        
    End If         
    Wscript.Sleep 5000     
    Wend 
    End Sub
    Changed it a bit so it works off pinging an IP (best change google to an internal IP just incase net goes down), and if no ping replies it locks. (aka works off Wireless too, not just Wired)

    For those who wanted it to kill IE too:

    Code:
    Option Explicit  
    Dim strHost
    strHost = "www.google.com"
    PingForever strHost  
    Sub PingForever(strHost)     
    Dim Shell, strCommand, ReturnCode      
    Set Shell = CreateObject("wscript.shell")     
    strCommand = "ping -n 1 -w 300 " & strHost     
    While(True)         
    ReturnCode = Shell.Run(strCommand, 0, True)              
    If ReturnCode = 0 Then             
    Else             
    Shell.Run "rundll32 user32.dll,LockWorkStation"    
    
    Dim objWMIService, objProcess, colProcess
    Dim strComputer, strProcessKill
    strComputer = "."
    strProcessKill = "'iexplore.exe'"
    
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
    
    Set colProcess = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = " & strProcessKill )
    For Each objProcess in colProcess
    objProcess.Terminate()
    Next    
    End If         
    Wscript.Sleep 5000     
    Wend 
    End Sub
    That should work, but haven't tested 2nd one yet.

    Steve

  9. #53

    Join Date
    Jun 2009
    Posts
    372
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    20
    good work Steve, is there anyway of looping to do this until the cable/wireless is back on as thats my problem at the moment, a kid can turn off the wireless, kill IE, lock, but then they just log back on and open up IE to play a flash game they have saved on their pen drive.

  10. #54

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Well assuming that 2nd version works ok (only tested first) it'll already do it :P

    Every 5 seconds (Wscript.Sleep 5000) it tries to ping, whether connected or not. If it fails it'll kill all IE pages. If it can connect it won't. Never ending loop. (or should be)

    Should work as you want, aslong as it's working :P (if that made sense) If you can test it, would be grateful. No wireless here.

    Steve

  11. #55

    Join Date
    Jun 2009
    Posts
    372
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    20
    ah right i'll give it a go in that case, didnt realise thats what it was doing. I'll let you know.

    Just trying to decide what to ping instead of google (our internet is too unreliable) and dont want to say a DC and have it subjected to 500+ pings attempts. Might have to setup an old pc just to be pinged for it.
    Last edited by farquea; 4th April 2011 at 11:05 AM.

  12. #56
    DrCheese's Avatar
    Join Date
    Apr 2008
    Posts
    1,029
    Thank Post
    97
    Thanked 159 Times in 108 Posts
    Rep Power
    58
    a kid can turn off the wireless, kill IE, lock, but then they just log back on
    There's a group policy you can turn on to require that Domain Controller auth to unlock a computer, so if the computer can't contact the DC, it can't unlock

  13. #57

    Join Date
    Jun 2009
    Posts
    372
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    20
    yep appears to work although without the wireless switch on, it locks you log back on without being reconected to the network and it locks within 5 seconds. I cant figure out how often its pinging in your script tho as i'd rather it be a longer wait or else we are going to have about 600 computers pinging every few seconds which i imagine will have some sort of negative affect on general performance?

  14. #58

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by farquea View Post
    yep appears to work although without the wireless switch on, it locks you log back on without being reconected to the network and it locks within 5 seconds. I cant figure out how often its pinging in your script tho as i'd rather it be a longer wait or else we are going to have about 600 computers pinging every few seconds which i imagine will have some sort of negative affect on general performance?
    It only pings once per "sleep". Currently 5 seconds. Just make it a bigger number :P

    And you got to remember it's only 1 ping (28 bits) per 5 seconds. Not a lot compared to what 100meg+ lines, or w/e you're running. But sure just increase that sleep time.

    Hope that helps,

    Steve

  15. #59

    Join Date
    Jun 2009
    Posts
    372
    Thank Post
    14
    Thanked 3 Times in 3 Posts
    Rep Power
    20
    Quote Originally Posted by DrCheese View Post
    There's a group policy you can turn on to require that Domain Controller auth to unlock a computer, so if the computer can't contact the DC, it can't unlock
    sounds handy, know anymore about it as sounds like it would do what i need and cut out the need to constantly ping a host?
    Ah just realised, because i am locking and not logging them off, this is why they can unlock and get back on. I dont imagine there is a way of not allowing a user to unlock unless it detects a DC

  16. #60
    DrCheese's Avatar
    Join Date
    Apr 2008
    Posts
    1,029
    Thank Post
    97
    Thanked 159 Times in 108 Posts
    Rep Power
    58
    Interactive logon: Require Domain Controller authentication to unlock: Security Configuration Editor

    Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\

    Interactive logon: Require Domain Controller authentication to unlock

  17. Thanks to DrCheese from:

    farquea (4th April 2011)

SHARE:
+ Post New Thread
Page 4 of 6 FirstFirst 123456 LastLast

Similar Threads

  1. students unplugging network cable
    By centurio in forum Network and Classroom Management
    Replies: 14
    Last Post: 3rd May 2011, 09:11 PM
  2. gpo application issues (kids removing network cables)
    By jjohnsoncantell in forum Windows
    Replies: 1
    Last Post: 2nd July 2010, 12:30 PM
  3. Replies: 6
    Last Post: 27th May 2010, 08:21 AM
  4. Network Cables .. who?
    By DanW in forum Recommended Suppliers
    Replies: 8
    Last Post: 9th February 2009, 08:40 PM
  5. terminating CAT5E network cables in network cabinets
    By broc in forum Network and Classroom Management
    Replies: 7
    Last Post: 10th July 2007, 11:54 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
  •