If you want to get ahead and gain respect at work, don’t make “being nice” your priority, says Stanford University organizational behavior professor Jeffrey Pfeffer.

You might think being nice will you them stand out from your peers, but you weren’t hired “to win a popularity contest, says Pfeffer, 76. “You’ve been hired to get things done.” Focusing on results doesn’t mean you should be mean or rude, but “you shouldn’t optimize on being popular and being nice. You should optimize on getting your job done,” he says.

Many young professionals, especially women, feel pressure to be liked at work, notes Pfeffer, who has taught at Stanford for nearly five decades and written or co-written 16 books on topics like leadership and career development. He’s the host of MasterClass’ “The Power Playbook” course, which published on August 21.

But you don’t actually need anyone except your boss — and, perhaps, your boss’ boss — to like you, he says. Start building those relationships with some old-fashioned flattery, he recommends: Compliment them on a new initiative they’re spearheading, for example, or show them you value their insight by asking them for career advice.

“The people in the hierarchy are the people who are responsible for your career,” says Pfeffer, adding: “You need to worry a lot about what your boss thinks about you. You don’t need to worry so much about what everybody else thinks.”