In order to set an OoO (Out of Office) message, you must be logged in with the credentials of that user.
If the user has left the company, IT can take ownership of the account, log in with the expired user's credentials and set the Out of Office message. Something like this should not happen too often, so automating such a rare event is probably more effort than doing it manually for ten years.
If the user is sick, they can call in sick through the app, and the app sets the OoO message with the user's credentials. I've built such apps and they are very popular, because people can use them on the phone. Instead of calling in to work and tell someone they're sick, they just use the app to hit 5 buttons and can go back to sleep.