ALBANY, N.Y. (CBSNewYork/AP) — Gov. Andrew Cuomo signed an executive order Friday, barring New York State Police and other agencies from asking about a person’s immigration status.

The new rule also prohibits officials from disclosing a person’s immigration status to federal authorities, except in certain situations, like a law enforcement investigation.

“As Washington squabbles over rolling back sensible immigration policy, we are taking action to help protect all New Yorkers from unwarranted targeting by government,” Cuomo said in a statement accompanying his order. “New York became the Empire State due to the contributions of immigrants from every corner of the globe and we will not let the politics of fear and intimidation divide us.”

Practically speaking, the order means State Police troopers or officers with other state law enforcement agencies will not be allowed to question a crime victim or a witness about their citizenship or residency.

It also means that the state’s public universities and colleges would be barred from sharing residency information about students with federal immigration officials or the administration of President Donald Trump.

The order does not apply to local police or municipal governments, a point that Erie County Sheriff Timothy Howard pointed out in a directive to his deputies.

“As sheriff, part of my job is enforcing our constitution and the law, regardless of what cheap political points Albany politicians are looking to score,” Howard, a Republican, said in a statement.

Groups that work on behalf of immigrants praised the executive order. Javier Valdes, co-executive director for the New York City-based progressive advocacy group Make the Road New York, called it a “major victory” and one of the strongest policies of its kind in any state.

“It is absolutely critical that New York State employees not be roped into collaborating with Trump’s rogue immigration enforcement agencies,” Valdes said.

Organizations that favor stronger rules on immigration, however, were displeased — though not shocked.

“It’s not a surprise,” said Joanna Marzullo, president of New Yorkers for Immigration Control and Enforcement. “A lot of people are pandering to what they see as their base.”

Also Friday, a judge ruled that Attorney General Jeff Sessions cannot follow through — at least for now — with his threat to withhold public safety grant money to Chicago and other so-called sanctuary cities for refusing to impose new tough immigration policies.

In what is at least a temporary victory for cities that have defied Sessions, U.S. District Judge Harry D. Leinenweber ruled that the Justice Department could not impose the requirements.

He said the city had shown a “likelihood of success” in arguing that Sessions exceeded his authority with the new conditions. Among them are requirements that cities notify immigration agents when someone in the country illegally is about to be released from local jails and to allow agents access to the jails.

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)