Plus if you don't know who is entering your room you don't have a problem with the keyboard but with your door lock. And if one team member is going rogue, well, he already has the passwords.
If the company has decided that computers need to be locked when away from keyboard there will be a policy and procedure for reporting and dealing infractions. This won’t be it. While in this case the program might have been mostly harmless, one never knows when a programming error might spin things out of control. It’s clever, funny to some, but if it accidentally resulted in downtime the stuff the flows downhill would come fast and be unpleasant in some organizations. Plus, annoying your teammates isn’t the best idea long term. I know this may seem harsh, but from my experience organizations with the most need for this security would be the least likely to approve of this method.
I think people are too focused on working for military and paranoïa, we need a range of behaviors, from the paranoid to the welcoming, that guy watching your screen could start an interesting discussion about your project, and give you the contact to the right person to help you. You don't want that in a military context, you highly desire it when you're building a vegan pet food marketplace for hipsters.
Not everyone needs to develop like in Aerospace, not everyone needs to develop like in video games, not everyone needs de behave like a NSA agent, and not everyone needs to behave like a farmer's market salesman, we need a range of behaviors.
And whatever the policy, you never, ever, let co-workers be dicks to each others, no "pranks", no public shaming, no sending a prank email from each other's computer. If security is really an big issue, then not locking a computer is a strike, it goes between the boss, the offender and HR, not a matter of joke.
Security is a trade-off, but things like locking your machine are so trivial and painless that they should be routine for everyone, no exception.
That said, I use padlock[1] on my laptop, especially in 'hostile' environments and I'm pretty happy with it.
Maybe you have a new hire in the office building, or a visitor, or the janitor.
It is good practice to always lock your machine. But yes i do agree that he is very lucky that upper management was awesome in this scenario.
--
At my last office job we would just flip the mouse buttons, and rotate the display screen. This proved to be very effective, and didn't cause issues with the team.
In this instance, the coworkers don't seem to be particularly clever, or even worried about security. They were terminating the powershell process, which was obviously doing unauthorized actions, then proceeding as usual? Who does that?!