This is illegal without employee consent in the EU and in most other civilized countries around the world.
See the "notice" section starting at bottom 3 of this for the lay persons summary on the notice requirement (or read the whole thing to see what laws around this look like in Germany) https://www.bakermckenzie.com/-/media/files/people/lutz-holg...