Start pgAgent Service on Windows 10 with AzureAD login

100 Views Asked by At

How can I get the pgAgent Service installed and started on a Windows 10 OS with an AzureAD login?

The pgAgent Service will not start on Windows 10 with a AzureAD login.

My username on this computer is azuread\my_username when I run whoami from the CLI.

I ran EnterpriseDB’s PostgreSQL Stack Installer as an Administrator to install the pgAgent. I tried the following values for the "Operating system username": my_username, azuread\my_username, [email protected], and azuread\[email protected].

Only using my_username worked without error.

However, this created a completely different user named my_username.computername and put the pgpass.conf file in that "users" %APPDATA%\Roaming\postgresql\ directory.

In my actual user profile, I still cannot start the pgAgent Service.

After installing with my_username as the "Operating system username", the pgAgent "Log On As" setting is automatically changed to .\my_username.
When trying to start the Service with "Log On As" set to .\my_username, I get the following message:
enter image description here

When installed with or "Log On As" set to any of the other domain\username options, I get the following error:
enter image description here

When running net start pgAgent-pg16 from an elevated Powershell terminal, I get:

The PostgreSQL Scheduling Agent - pgagent-pg16 service is starting...................
The PostgreSQL Scheduling Agent - pgagent-pg16 service could not be started.

The service did not report an error.

More help is available by typing NET HELPMSG 3534.

How can I get the pgAgent Service installed and started on a Windows 10 OS with an AzureAD login?


Note: I have seen all of the following SO posts and other instructions and none of them help at all.


Additionally, when installed, running either ./pgAgent REMOVE pgAgent or ./pgAgent REMOVE pgAgent-pg16 returns ERROR: Failed to uninstall source, and the following does nothing at all.

./pgAgent INSTALL pgAgent -u my_Win10_username -p my_Win10_password hostaddr=127.0.0.1 dbaname=postgres user=postgres password=***
0

There are 0 best solutions below