NEW YORK — California’s new law requiring companies to include women on their boards of directors may not survive widely expected legal challenges but it has already spotlighted the entrenched practices and barriers that have helped keep women out of boardrooms.

Some of the country’s best-known companies, along with many smaller ones, will have to overcome such obstacles to comply with the new measure, which requires public corporations headquartered in California to have at least one female director on their board by the end of next year. 

Companies with more than six board members would need three female directors by the end of 2021. Those with fewer than six members would need two women.

After years of public and internal pressure to increase gender parity at the top of the corporate ranks, few of the biggest companies have zero female board directors. 

But men vastly outnumber women on boards across nearly every industry, a landscape that has remained stubbornly unchanged despite years of debate and studies on the subject.

Facebook, Apple and Google’s parent company Alphabet are among the several hundred companies headquartered in California that would have to add women to their boards by 2021 to comply with the law.

The law imposes a $100,000 fine for a first violation and a $300,000 penalty for subsequent violations, not huge sums for major corporations. Nevertheless, companies will likely begin efforts to comply with the law even as they keep track of — or participate in — legal efforts to block it, said Wendy Patrick, a professor of business ethics at San Diego State University.

Those efforts will push companies to work through obstacles frequently cited by corporate executives, including finding a wide pool of female talent, particularly in industries that are male-dominated. 

In the short term, Davis said the law might serve as catalyst for widening the pool if it encourages more women to seek out board positions. 

In the long term, the law will encourage companies to more aggressively recruit and retain women in all ranks, she said.

Women held about 20 percent of board seats at Fortune 500 companies in 2016, according to the most recent census by the Alliance of Board Diversity. That was up from just under 17 percent in 2012, according to the study, which was conducted with Deloitte, an auditing, taxes and consulting services provider.

Among California-based companies, many of the top companies already have at least three women on their boards, including Walt Disney, Chevron, Oracle, HP Inc. and Twitter. Those with only two female directors include Facebook, Apple and Alphabet.

Recommended for you