You grab a business card from their desk or their assistant.
I’ve been the ‘assistant’ in these cases, and some people make a point of getting names/emails of everyone who interviewed them.
The thank you note DOES make an impression, and too few bother to do it.
Besides the simple thank you, it also gives you a chance to include a quick thought or statement that you didn’t get in during the interview, or to briefly ‘fix’ something that may not have come out exactly right.
What desk? The majority of interviews are now Skype and Google Hangouts.