Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
AUaero
Responsive Resident
Responsive Resident

Automate opening Power BI report via Powershell

I'm posting this in case someone has a similar requirement and finds this useful.  

 

We have a requirement to display KPIs on large monitors in a warehouse environment.  We installed monitors and PCs and set the PCs to auto logon after bootup.  After the user is logged on, the following Powershell script runs to open the KPI report in IE and set Power BI to full screen.  We didn't attempt to script login to Power BI, so you'll need to make sure Power BI is set to remember the current user credentials before using this script.

 

 

# Set report URL
$URL = "https://app.powerbi.com/" #replace this URL with a direct URL to the report you want to open

 

# Open an IE window and navigate to the URL
$ie = New-Object -com internetexplorer.application
$ie.visible = $true
$ie.FullScreen = $true
$ie.navigate($URL)

 

# Wait on IE to load page
while ($ie.Busy -eq $true)
{
Start-Sleep -Milliseconds 100
}

 

# Bring IE to the foreground
$code=@'
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

static public class Win32{
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static public extern bool SetForegroundWindow(IntPtr hWnd);
}
'@
Add-Type $code

$handles=(get-process iexplore).MainWindowHandle
$handles|%{[win32]::SetForegroundWindow($_)}

 

# Set Power BI Fullscreen
$fs = $ie.Document.DocumentElement.getElementsByClassName('glyphicon glyph-small pbi-glyph-fullscreen') | Select-Object -first 1
$fs.click()

 

0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.