Skip to content
Contact us

Let other PCs reach the BI database

Edition

Power BI comes with an Enterprise or Enterprise+ licence. See Editions: Professional, Enterprise and Enterprise+

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:

SettingDefault
Port5432
DatabaseSMARTBI
Windows servicepostgresql-x64-18

Many organisations make such changes by hand, under their own change control. On the SMART Migration server, as administrator:

  1. Find PostgreSQL's data folder

    Open Services (services.msc), double-click postgresql-x64-18 and read Path to executable: the data folder is the one after -D, by default C:\Program Files\PostgreSQL\18\data.

  2. Keep a copy of both files

    Copy postgresql.conf and pg_hba.conf, in the data folder, to a safe place before changing them.

  3. Listen on the network

    In postgresql.conf — opened in an editor started as administrator — find the line with listen_addresses, remove the # in front of it if there is one, and set it to listen_addresses = '*'. To listen on one address of the server only, put that address between the quotes instead.

  4. 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 of 10.0.0.0/16:

    host all all 10.0.0.0/16 scram-sha-256

    scram-sha-256 means the PCs still sign in with a user and password.

  5. 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 Allow
  6. Restart PostgreSQL

    Restart the postgresql-x64-18 service in Services, or in PowerShell as administrator: Restart-Service postgresql-x64-18. PostgreSQL reads both files as it starts.

  7. Check from a PC

    On a PC in that network, in PowerShell: Test-NetConnection <SMART Migration server> -Port 5432. TcpTestSucceeded : True means the PC reaches the BI database; run its setup script now.

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.conf and pg_hba.conf beside them, named with the time.
  • Makes PostgreSQL listen on the network: listen_addresses = '*'.
  • Lets the PCs' network in: the pg_hba.conf line above. It asks for the network, offering the server's own.
  • Opens port 5432 in 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.

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;
What you seeWhat to do
Test-NetConnection says FalseThe 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 changeA 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 hostThe 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 wrongThe user and password in the PC's SMARTBI data source do not match PostgreSQL's: see The user and password in SMARTBI

See also