Using ASDK ReportManagementService with PowerShell
search cancel

Using ASDK ReportManagementService with PowerShell

book

Article ID: 445013

calendar_today

Updated On:

Products

Patch Management Solution

Issue/Introduction

This article describes how to use the Altiris Software Development Kit (ASDK) ReportManagementService.asmx web service to run reports with parameters using PowerShell. This method allows for automated data retrieval from the Symantec Management Platform (SMP).

Environment

ITMS 8.x

Cause

n/a

Resolution

The RunReportWithParameters method is utilized to execute a specific report and pass necessary filter criteria.

Use the following script as a template for calling the report service. Ensure you replace `$AltirisServer` and `$ReportGUID` with your environment's specific details.

 

Clear-Host
$null = $Hostname,$Body,$FilteredReportData

# Configure server and web service path
$AltirisServer = "https://server_fqdn"
$WebService_ReportManagement = "/Altiris/ASDK.NS/ReportManagementService.asmx"

# Define the Report GUID and Parameters
# Example parameter: VendorGuid=00000000-0000-0000-0000-000000000000
$ReportGUID = "6cc399cf-414a-4cc9-a180-d9ff2bfead35"
$ReportParameters = "VendorGuid=00000000-0000-0000-0000-000000000000"

# Build the request body
$Body = @{
    reportItemGuid = $ReportGUID
    nameValuePairs = $ReportParameters
}

# Construct URI and invoke the REST method using Windows Credentials
$URI = $AltirisServer + $WebService_ReportManagement + "/RunReportWithParameters"
$RM = Invoke-RestMethod -Uri $URI -Method Post -Body $Body -UseDefaultCredentials

# Extract and display the report data table
$ReportData = $RM.NewDataSet.Table
$ReportData