Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
i've this issue:
i need to get the data (or graph) contained in a PowerBi dashboard.
The pbix. report is published directly in PowerBi Report Server (i don't use Microsoft cloud).
Is it possible to get data or graph using powershell?
Thanks in advance,
Daniele
Hi @DaniEMIT ,
Reports sent to the pull server are entered into a database on the server. The reports are available through calls to the web service. To retrieve reports for a specific node, send an HTTP request to the report web service in the following form:
http://CONTOSO-REPORT:8080/PSDSCReportServer.svc/Nodes(AgentId='MyNodeAgentId')/Reports
Where MyNodeAgentId is the AgentId of the node for which you want to get reports. You can get the AgentID for a node by calling Get-DscLocalConfigurationManager on that node.
The reports are returned as an array of JSON objects.
The following script returns the reports for the node on which it is run:
function GetReport
{
param
(
$AgentId = "$((glcm).AgentId)",
$serviceURL = "http://CONTOSO-REPORT:8080/PSDSCPullServer.svc"
)
$requestUri = "$serviceURL/Nodes(AgentId= '$AgentId')/Reports"
$request = Invoke-WebRequest -Uri $requestUri -ContentType "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" `
-UseBasicParsing -Headers @{Accept = "application/json";ProtocolVersion = "2.0"} `
-ErrorAction SilentlyContinue -ErrorVariable ev
$object = ConvertFrom-Json $request.content
return $object.value
}
refer:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi Lucien,
first of all thanks for you reply.
With the powershell i 2 problem:
1) i can't recover the "AgentId" and i haven't (or i don't know how to reach it) the PSDSCPULLServer;
2) with this powershell i can't get graph directly from the report.
Can you help me in these issue?
Thanks,
Daniele
User | Count |
---|---|
11 | |
10 | |
8 | |
2 | |
2 |
User | Count |
---|---|
15 | |
11 | |
4 | |
2 | |
2 |