I configured jenkins in windows 2019
It starts as domain\jenkins service
I have configured WindowsServer1 node
What should I do to make the *.bat script on WindowsServer1 run as a different user?
Should the agent on WindowsServer1 be run under the user under which the script is to run?
Yes, that is exactly what I was saying. You need to launch the agent as the user you want stuff to run as. So, as you said in your case, run the java command as WindowsServer1\users1, then all processes/scripts/etc. will run as that user on the agent.