How should I approach the issue of students not writing their name and student number on an exam? I am a teaching assistant (TA) in a second-year undergraduate course and have just received the results of my students' multiple choice midterm exam, which were marked by an optical marking ("Scantron") machine. The students are required to print their name in pencil, and are also asked to fill in a clearly-marked set of bubbles with their student number so that the Scantron machine can create an overview printout with each individual student's mark for me (as well as statistics related to the test, i.e. class average, percentage of students who selected the correct answer, etc.). These forms are standardized across our university, and all of my students have used them before. There are 4 students who did not fill in their student numbers, even though they are explicitly directed to do so before the start of the exam.

We check photo ID at the door of the exam to ensure that students are on our class list, and the course instructor may still have the list of highlighted names of students that attended. This means that I very likely can identify which four students these no-name exams belong to. The bigger issue in my mind is that we require students to fill in their student number so the scanner will be able to identify them, but also as an extra measure to ensure that students are writing a test in their own name, and not impersonating another student. Even if I can go back and look at the students' individual bubble sheets, I still need them to understand the importance of filling in their testing sheet correctly. Other instructors or TA's are not necessarily so understanding.

How can I address this issue with these students? It feels very unfair to say, "Sorry, you didn't write your student number, so you get a zero," but I also need to ensure that we aren't allowing students to cheat because we are being lenient in verifying student identity. Is this something I should just say at the beginning of the next lecture, or do I need to approach these students individually and remind them of the requirement?
Y'all have never proctored or taken SATs?

Give only the answer sheets out first, and have students complete the important information before they even get the questions.

If you don't give the questions until students have filled out the relevant information on the answer sheet, they won't be able to ignore the answer sheets, in lieu of answering questions.

It may require a bit of a rethink as to the time available for the test (i.e. take five minutes away from testing and put it onto "administrivia"), but this might just be time well spent.

You could even incentivize students to arrive early to complete this task quickly by saying that the question packs will be given out as soon as all students have filled out their information; any student who shows up to class (up to five minutes) early will be given their answer sheet to fill out.  If all students have their answer sheets filled out by the time "##:##", the tests will be handed out then.  Anyone who shows up late will have to complete their information on the answer sheet at the front of the room before being given the questions.

Or, have part of the ID process be that students have to show you their IDs AND a completed information section on their answer sheet before they get the questions (or, maybe before they take their seats).

If it's an important step in the process, make sure it has a defined step in the process.

To forestall the comments I know are coming: Yeah, I know: Young adults should be able to follow directions.  OTOH, negative reinforcement doesn't have the learning results you think it does. Don't penalize students for a bad process.