I learned how to deal with this the hard way and not sure if it applies to your situation. I purchase property at trustee sales and flip them. Seven deals so far this year. When someone is living in the properties I purchase, I treat them as an owner regardless of who they are and that includes squaters. I removed a squater in 21 days with the Sherriff's department assistance. File the notice if eviction with the owners name as the person being evicted, and include "all unknown occupants" along with the owner. Since the squater is not named on the eviction notice other than "all unknown occupants" they can't fight back, and in CA you can get them out within 21 days of the first 3 day notice. My squaters didn't think I could pull it off, and the sherriff showed up and blindsided them. They had 10 mins to get out, which meant I had all of their personal belongings, which I didn't want, but I was able to charge them retail daily rental fees paid in cash up front before they could load up their stuff in two large moving trucks. Also, right after the sherriff tossed them out, I went inside and sifted through all their personal belongs i.e. documentation like social security numbers, court recorts, etc... so I could identify everyone in the house just in case I wanted to sue them later.
Squaters are parasites. Do not feel bad for them or their situation. Use every loop hole in the law to your advantage.
Hope this is of help.