For those without a subscription:

Google Chief Executive Sundar Pichai criticized President Donald Trump’s immigration order in an email to staff late Friday, saying the U.S. ban on foreign nationals from seven countries affects at least 187 Google employees.

“We’re upset about the impact of this order and any proposals that could impose restrictions on Googlers and their families, or that could create barriers to bringing great talent to the US,” Mr. Pichai said in the email, according to a copy reviewed by The Wall Street Journal. “It’s painful to see the personal cost of this executive order on our colleagues.”

Mr. Trump on Friday signed an executive order that, for at least 90 days, bans people from seven Muslim-majority nations—Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen—from entering the U.S. The order also indefinitely bans Syrian refugees from the U.S. and suspends the broader refugee program. Mr. Trump said the order was to keep out “radical Islamic terrorists.”

Humans-rights advocates criticized the move as religious persecution. Now two leading tech executives are speaking out against the order.

Earlier on Friday, Facebook Inc. CEO Mark Zuckerberg wrote on his Facebook page that he was concerned by the order. “We need to keep this country safe, but we should do that by focusing on people who actually pose a threat,” he wrote.

In his message to employees, Mr. Pichai suggested at least 187 employees hailed from countries included in the ban. “Our first order of business is to help Googlers who are affected,” he said. “If you’re abroad and need help please reach out to our global security team.”

Mr. Pichai, who grew up in India, said that at an internal meeting on Friday broadcast to all staff, two Google employees apparently affected by the policy discussed their situations. They were “grappling with what this might mean for them and their families,” he wrote. “Just as that discussion was happening, another Googler was rushing back from a trip to New Zealand to make it into the US before the order was signed.”

Google, a unit of Alphabet Inc., said in a statement, “We’ll continue to make our views on these issues known to leaders in Washington and elsewhere.” Bloomberg News previously reported Mr. Pichai’s email to staff.

Microsoft Corp. is concerned about the impact of Mr. Trump’s order on employees from the listed countries and is providing them with legal advice and assistance, a spokesman said. In a Securities and Exchange Commission filing earlier this week, Microsoft said changes to U.S. immigration policies could inhibit staffing for research and development efforts.

Immigrants make up much of the workforce in Silicon Valley, including many executive roles, and the tech industry has long advocated for more open immigration laws in the U.S., saying they need more skilled foreigners to fill technical jobs.

Silicon Valley widely supported Hillary Clinton over Mr. Trump, and he and some tech executives clashed during the presidential campaign. But those executives were largely silent during President Trump’s first week, even as he made several moves that appeared to push against their principles, including on climate change and net neutrality, a policy that requires internet providers to treat all traffic equally.

But Mr. Trump’s immigration order appears to immediately be affecting some of the companies’ operations, apparently causing some executives to speak up.

“We wouldn’t wish this fear and uncertainty on anyone—and especially not our fellow Googlers,” Mr. Pichai wrote. “In times of uncertainty, our values remain the best guide.”