The simplest thing is to have a script permanently running hidden on the student PC which checks a centralised INI file.

When the teacher selects a PC to be disabled an entry in the INI file which is keyed by the PC name is set to request it to disable. When the PC next checks it's name in the file it will see the block request, run the block code and set a status field in another INI file to show that it has done it.

Unblocking works the same way.

Setting the status field means that the teacher can check the status of the PCs and ensure that they are blocked/unblocked as appropriate.

The purpose of having a seperate file for the status field is that you don't want the students to have permissions to be able to change the blocking request INI file!