The sweeping order applied to hundreds of thousands of people legally in the country through programs put in place for Ukrainians, Afghans and others.