A cyberattack on Microsoft Corp.’s Outlook email software is believed to have infected tens of thousands of businesses, government offices and schools in the U.S., according to people briefed on the matter.