Ive never been at a base with a surprise visit so I can't speak to that. BUT, trust me when I say you can always tell something is going on or a visitor is coming by activities on a base. 0-6's come out of offices to direct and orchestrate small details like dust on a counter. So even if it's not announced, you know something is happening.
Ok, I've been at a base where there was a surprise visit, and being in the Law Enforcement field, would have been one's that had been impacted. Until just less than 90 minutes from the bird landing it was kept hush hush. I'm not saying generals didn't know, I'm just saying based on my real time experience, it wasn't such a huge hassle. It was in and out. Now, Dos Equis, will follow up with some "I read somewhere" story because he can't be wrong, but that has been my experience in the Military. Now in civilian life, we've had Presidents visit Austin and as a part of the team that had to coordinate that, it was a real pain in the ass a week in advance.