Hello Morten,
Thank you for clarifying. You need to bind to the report and then use the corresponding properties to obtain the script used to generate the report. The script will look like below. You can check section API documentation\ADSI provider\Reports of our SDK for details.
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$reportDN = "CN=My Report,CN=Reports,CN=Reports Root,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes" # TODO: modify me
# Connect to Adaxes service
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")
# Get report generator
$report = $service.OpenObject("Adaxes://$reportDN", $null, $null, 0)
$reportConfig = $report.GetConfiguration()
# Get report script
$reportScript = $reportConfig.Generator.Script