'check for unplugged network cord during logon
'checks for mapped drives
'merge registry key to run
'| Windows Registry Editor Version 5.00
'| [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
'| "check-home-dir"="\"C:\\WINDOWS\\vbs_logoff.vbs\""
'copy this vbs file to c:\windows directory
Option Explicit ' Added By SM
Dim objNetwork
Dim strUserName
Dim WshShell, WshNetwork, ObjFSO
Dim intReturn
Set objNetwork = CreateObject("WScript.Network")
Set WshShell = CreateObject("WScript.Shell")
Set WshNetwork = CreateObject("WScript.Network")
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
' Wait until the user is really logged in... Added by SM
While StrUserName = ""
WScript.Sleep 100 ' 1/10 th of a second
StrUserName = WSHNetwork.UserName ' Get the user name
Wend
if strUserName = "Administrator" then
'Ignore the admins ;-) Added By SM
else
'Check if the home drive is there... Added By SM
if ObjFSO.DriveExists("z:") then
'Yes it is bail out... Added By SM
else
'No its not, has the network cable been pulled... Added By SM
intReturn = WshShell.Popup("Please ensure the network Cable is plugged in or the Wireless Button is on.", 8, "Login Error", 0)
If intReturn = 1 Then ' Trap the button click... Added By SM
'Wscript.Echo "You clicked the ok button. This would log you off"
WshShell.Run "logoff.exe"
Else ' The popup timedout log the user off... Added By SM
'Wscript.Echo "The popup timed out. This would log you off after a timeout"
WshShell.Run "logoff.exe"
End If
End if
End if
I have no idea what, but if a correctly setup modern Windows network can be circumvented by temporarily pulling a network cable it would be all over the news and everyone here would probably already know about it. (And Microsoft would be working on a real patch, not a VBS kludge.)
The process of loading a profile should add privileges, not give full admin rights then remove them.
Wow, I wish I lived in a far away house so I could get a magical free bus service too.