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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Samaneh
Frequent Visitor

Configuring Power BI Server through Power shell

Hi,

If you want to install Power BI Server through powershell (SQL Server 2016 and PoweBI Server(March 2018))

you can use following commands

 

 

 

$rsConfig = Get-WmiObject –namespace "root\Microsoft\SqlServer\ReportServer\RS_PBIRS\v15\Admin" -class MSReportServer_ConfigurationSetting   -filter "InstanceName='PBIRS'"

 

$methResult = $rsConfig.GenerateDatabaseCreationScript($PowerBIDatabaseName, 1033, "true")

Invoke-SqlCmd

Set-Location SQLSERVER:\SQL\$SQLServerName\$InstanceName

invoke-sqlcmd -Query $methResult["Script"] -Username $UserName -Password $Password -OutputSqlErrors $true | Out-Null

 

Set-Location -Path C:\Windows\System32

$methResult = $rsconfig.GenerateDatabaseRightsScript("NT Service\PowerBIReportServer", $PowerBIDatabaseName, $false, $true)

Set-Location SQLSERVER:\SQL\$SQLServerName\$InstanceName

invoke-sqlcmd -Query $methResult["Script"] -Username $UserName -Password $Password -OutputSqlErrors $true | Out-Null

 

Set-Location -Path C:\Windows\System32

$rsConfig.SetDatabaseConnection($SQLServerInstanceName,$PowerBIDatabaseName, 2, "NT Service\PowerBIReportServer", "")

 

$rsConfig.SetVirtualDirectory("ReportServerWebService",$WebServiceVirtualDirectoryName,0)

$rsConfig.ReserveURL("ReportServerWebService", "http://+:80", 1033)

$rsConfig.SetVirtualDirectory("ReportServerWebApp",$WebPortalVirtualDirectoryName,0)

$rsConfig.ReserveURL("ReportServerWebApp", "http://+:80", 1033)

$rsConfig.ReserveURL("PowerBIWebApp", "http://+:80", 1033)

$rsConfig.ReserveURL("OfficeWebApp", "http://+:80", 1033)

 

$rsconfig.SetServiceState($false, $false, $false)

Restart-Service $rsConfig.ServiceName

$rsconfig.SetServiceState($true, $true, $true)

 

 

Older SQL 

The version in following command must be updated

$rsConfig = Get-WmiObject –namespace "root\Microsoft\SqlServer\ReportServer\RS_PBIRS\v15\Admin" -class MSReportServer_ConfigurationSetting   -filter "InstanceName='PBIRS'"
To get the version use following command:      

gwmi -namespace "root\Microsoft\SqlServer\ReportServer\RS_PBIRS" -class "__Namespace"

 

Also in following commands: 

$rsConfig.SetVirtualDirectory("ReportServerWebApp",$WebPortalVirtualDirectoryName,0)

$rsConfig.ReserveURL("ReportServerWebApp", "http://+:80", 1033)

"ReportServerWebApp"

should be changed to 

"ReportManager"

 

 

 

0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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