Brooks Peppin has a great public blog that should be a great place to start bringing in Oauth.
https://www.brookspeppin.com/2021/07/24/rest-api-in-workspace-one-uem/
It is worth contacting VMware to see if they publish a script-friendly way to find servers that can issue the token
https://kb.vmware.com/s/article/76967
Brooks Peppin has a great public blog that should be a great place to start bringing in Oauth.
https://www.brookspeppin.com/2021/07/24/rest-api-in-workspace-one-uem/
It is worth contacting VMware to see if they publish a script-friendly way to find servers that can issue the token
https://kb.vmware.com/s/article/76967