A police officer convicted of harassment has been dismissed from the force.