Edition
Power BI comes with an Enterprise or Enterprise+ licence. See Editions: Professional, Enterprise and Enterprise+
- Why the PCs must be let in
- Let the PCs in by hand
- Or run the server script
- A read-only user is safer
- When it does not work
Why the PCs must be let in
Section titled “Why the PCs must be let in”The SMART Migration installer sets PostgreSQL up for the SMART Migration server itself: after installation it accepts connections from that machine only. A PC that is to refresh SMART BI.pbix — set up with Set up Power BI on your own PC — reaches the BI database only once an administrator of the SMART Migration server has let the PCs' network in. It is done once, on the server; the PCs still sign in with a PostgreSQL user and password.
The installer's defaults, which the steps below use:
| Setting | Default |
|---|---|
| Port | 5432 |
| Database | SMARTBI |
| Windows service | postgresql-x64-18 |
Let the PCs in by hand
Section titled “Let the PCs in by hand”Many organisations make such changes by hand, under their own change control. On the SMART Migration server, as administrator:
Find PostgreSQL's data folder
Open Services (
services.msc), double-clickpostgresql-x64-18and read Path to executable: the data folder is the one after-D, by defaultC:\Program Files\PostgreSQL\18\data.Keep a copy of both files
Copy
postgresql.confandpg_hba.conf, in the data folder, to a safe place before changing them.Listen on the network
In
postgresql.conf— opened in an editor started as administrator — find the line withlisten_addresses, remove the#in front of it if there is one, and set it tolisten_addresses = '*'. To listen on one address of the server only, put that address between the quotes instead.Let the PCs' network in
At the end of
pg_hba.conf, add a line for the network the PCs are on, with your own network in place of10.0.0.0/16:host all all 10.0.0.0/16 scram-sha-256scram-sha-256means the PCs still sign in with a user and password.Open port 5432 in Windows Firewall
In Windows Defender Firewall with Advanced Security, add an Inbound Rule: Port, TCP
5432, Allow the connection, and under Scope the PCs' network as the remote IP addresses. Or, in PowerShell as administrator:New-NetFirewallRule -DisplayName 'PostgreSQL 5432 (SMART Migration BI)' -Direction Inbound -Protocol TCP -LocalPort 5432 -RemoteAddress 10.0.0.0/16 -Action AllowRestart PostgreSQL
Restart the
postgresql-x64-18service in Services, or in PowerShell as administrator:Restart-Service postgresql-x64-18. PostgreSQL reads both files as it starts.Check from a PC
On a PC in that network, in PowerShell:
Test-NetConnection <SMART Migration server> -Port 5432.TcpTestSucceeded : Truemeans the PC reaches the BI database; run its setup script now.
Or run the server script
Section titled “Or run the server script”The same can be done by a script, as an option: in the Set up Power BI on this PC … dialog — Power BI, after Refresh at the top of the app, or the Settings tab — under the note on letting the PC in, Show the server script (optional) shows it. Copy it with the button in its corner and run it once on the SMART Migration server, as administrator, in PowerShell 5.1 or later. It:
- Finds PostgreSQL's data folder from its Windows service,
postgresql-x64-18. - Keeps a copy of
postgresql.confandpg_hba.confbeside them, named with the time. - Makes PostgreSQL listen on the network:
listen_addresses = '*'. - Lets the PCs' network in: the
pg_hba.confline above. It asks for the network, offering the server's own. - Opens port
5432in Windows Firewall, to that network only. - Restarts PostgreSQL and checks it listens for other PCs.
Nothing already in place is changed again, so it can run as often as needed — with another network, for instance. Each step says [OK] or why it stopped; the last line is green when the PCs can be set up.
A read-only user is safer
Section titled “A read-only user is safer”The PC's setup script uses the installer's PostgreSQL user, postgres — the database's superuser — with its default password. Where the PCs should only read the BI data, create a user that can only read it, and put its name and password at the top of the PC's setup script before running it. As postgres, in pgAdmin or psql, connected to the SMARTBI database:
CREATE ROLE powerbi LOGIN PASSWORD 'choose-a-strong-one';GRANT CONNECT ON DATABASE "SMARTBI" TO powerbi;GRANT USAGE ON SCHEMA public TO powerbi;GRANT SELECT ON ALL TABLES IN SCHEMA public TO powerbi;ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO powerbi;When it does not work
Section titled “When it does not work”| What you see | What to do |
|---|---|
Test-NetConnection says False | The firewall rule is missing, or its remote addresses leave the PC out; or PostgreSQL does not listen on the network — check listen_addresses and restart the service. |
| PostgreSQL does not start after the change | A typing error in one of the files: the log in the data folder's log folder names the line. Put the copies back and try again. |
Power BI says no pg_hba.conf entry for host | The PC's address is outside the network in the pg_hba.conf line: widen it, or add a line for the PC's network, and restart the service. |
| Power BI says the password is wrong | The user and password in the PC's SMARTBI data source do not match PostgreSQL's: see The user and password in SMARTBI |
See also