REDMOND, Wash.—With a touch of a button on the wall outside Microsoft Corp.’s Cyber Defense Operations Center, opaque windows turn clear, offering visitors a glimpse of the high-tech bunker where the software giant’s security engineers work to thwart hackers.

The new facility is at the heart of Microsoft’s campaign to rebuild its reputation for security at a time when the number of potential targets for cyberattacks—from smartphones to corporate servers and Web services—has exploded.

...