The easiest way to do this is to make a custom logon script that runs when user2 logs in to windows via scheduled task. (Windows home disables logon scripts for users, so we have to get around it with this method.)
The only prerequisite requires that you know the name of the interface(s) that you want to disable upon login.
To get a list of all the interfaces:
- Open
command prompt
by holding down the Windows
key and then pressing the R
key. This will give you run
box.
- Now, type
cmd
into that box and press enter
.
- Type
netsh interface show interface
and take note of the interface name in the last column. This could be something like "local area connection" or "wi-fi", etc.
Now, we need to make a script to actually disable this adapter. From here on out, I will assume that your adapters name is "Wi-Fi" (yours may be different).
- Open a new notepad document.
- Paste in the following:
netsh interface set interface "Wi-Fi" admin=disable
- Save the file as
"turnOffNetwork.bat"
** Use the quotes when you save it. This will force the file to be saved with the .bat extension.
- The file needs to be saved to a place where her profile can see it, so I would create a folder called
scripts
directly on the c:\
drive.
- When you save it, the location should be
C:\Scripts\turnOffNetwork.bat
Now we need to login to the profile that this will run as. In this case, login to user2.
- Click the start button and type
task scheduler
and open it.
- On the far right, choose
Create Task
. Do not choose basic task.
- There will be 5 tabs here, General, Triggers, Actions, Conditions and Settings.
General Tab:
- Name: Turn off Network Access
- Choose "Run only when user is logged on"
- Tick the box for "Run with highest privileges" (needed)
Triggers Tab:
- Click "New"
- Begin the task dropdown: "At Logon"
- Press OK
Actions Tab:
- Click "New"
- Action: Start a program
- Browse for program/script and choose
C:\Scripts\turnOffNetwork.bat
- Click OK
Conditions Tab:
- Uncheck: "Start the task only if AC is on"
- Uncheck: "Stop if computer switches to battery"
- Click OK
Settings Tab:
Press OK.
You may now be prompted with a credential asking for admin credentials. If this is the case, enter the username/password of an account on the computer that is an administrator. (most likely your profile, not your daughters.)
Log out of user2 and back in as user2 and the task should now run, disabling the network card/wifi adapter.
Do you want the LAN interface disabled only while your daughter Ida logged in? Something else? – I say Reinstate Monica – 2018-03-15T01:01:46.483
Yes, thats the point – Corto – 2018-03-15T01:10:12.957