I've had some luck breaking animals of unwanted intrusions and running them off with a Supersoaker loaded with a mix of sudsy ammonia and plain water. The detergent allows the mix to soak into fur and ammonia is relatively safe, temporary, and quite unpleasant.

I consider attacking livestock to be far more serious than what I would use a chemical deterrent for but it is an option.

This has also worked to run raccoons, rats and squirrels out of attics and stray dogs and cats out of crawl spaces.