Police and sheriff's departments will be ordered to collect the immigration status of people involved in crimes.