You must run UniFi OS Server using the account you initially set it up on. This is a Windows-specific limitation. On Linux/Docker, UniFi OS Server runs as a system service and does not have this constraint. If you would rather use a service account on Windows, create a service account then install UniFi OS Server under it.
Prerequisites
- Run this script as an Administrator
- UniFi OS Server must already be installed and working when launched manually
Usage
- Run the script in an elevated PowerShell session. It will prompt for credentials.
- The password is stored encrypted by Windows Task Scheduler and is not saved in plaintext
What it does Registers a scheduled task that launches UniFi OS Server 30 seconds after boot under the specified user account. The delay gives Windows time to finish initializing before the server starts. If the task already exists, it is removed and re-created.
Note: Running under the SYSTEM account will launch the process but UniFi OS Server will not function correctly. It requires the user context it was configured in.