Function New-AltirisASDKConnection { Param ( [Parameter(Mandatory = $true)] [ValidateSet('SERVERNAME1.YOURDOMAIN.LOCAL','SERVERNAME2.YOURNAME.LOCAL')] [string]$ServerName , [Parameter(Mandatory = $true)] [ValidateSet('CollectionManagementService' ,'HierarchyManagementService' ,'ItemManagementService' ,'ReportManagementService' ,'ScopingManagementService' ,'SecurityManagementService' ,'ResourceManagementService' ,'DSTaskManagementService' ,'swdSolnAdvertisementManagementService' ,'swdSolnPackageManagementService' ,'swdSolnProgramManagementService' ,'InventoryRuleManagementService' ,'SoftwareCommandLineManagementService' ,'SoftwareComponentManagementService' ,'SoftwarePackageManagementService' ,'SoftwareProductManagementService' ,'SoftwareDeliveryPolicyManagementService' ,'SoftwarePortalManagementService' ,'SoftwareTasksManagementService' ,'TaskManagementService')] [string]$Service , [Parameter(Mandatory = $false)]$Credential) if ( $Service -in @( 'CollectionManagementService' ,'HierarchyManagementService' ,'ItemManagementService' ,'ReportManagementService' ,'ScopingManagementService' ,'SecurityManagementService' ,'ResourceManagementService' ) ) { $Sub = "ASDK.NS" } elseif ( $Service -in @( 'DSTaskManagementService' ) ) { $sub = "ASDK.DeploymentSolution" } elseif ( $Service -in @( ,'swdSolnAdvertisementManagementService' ,'swdSolnPackageManagementService' ,'swdSolnProgramManagementService' ) ) { $sub = "ASDK.NS.SoftwareDelivery" } elseif ( $Service -in @( ,'InventoryRuleManagementService' ,'SoftwareCommandLineManagementService' ,'SoftwareComponentManagementService' ,'SoftwarePackageManagementService' ,'SoftwareProductManagementService' ) ) { $sub = 'ASDK.SMF' } elseif ( $Service -in @( ,'SoftwareDeliveryPolicyManagementService' ,'SoftwarePortalManagementService' ,'SoftwareTasksManagementService' ) ) { $sub = 'ASDK.SWM' } elseif ( $Service -in @( 'TaskManagementService' ) ){ $sub = 'ASDK.Task' } else { throw "Bad Service" } $URL = 'https://' + $ServerName + '/Altiris/' + $sub + '/' + $Service + ".asmx" if (-not $Credential) { New-WebServiceProxy -uri "$URL" -class AltirisItem -namespace WebServiceProxy -usedefaultcredential } else { New-WebServiceProxy -uri "$URL" -class AltirisItem -namespace WebServiceProxy -Credential $Credential } } $ReportManagement = New-AltirisASDKConnection -ServerName SERVERNAME1.YOURDOMAIN.LOCAL -Service ReportManagementService $Report = @($ReportManagement.RunReportWithParameters('ae809dac-7a58-42a2-a443-5b5ab3dfc0e2','COMPUTERNAME1=bhpappaltns01v'))[0] Write-host ("UserId: " + ($Report.Table.UserId)) Write-host ("User Display Name: " + ($Report.table.'User_x0020_Display_x0020_Name'))