Report entry support for importing PowerShell modules within script
0 vote
Hello,
The Report type entriy allows for defining custom powershell commands within a script to populate the report content. While this works well when quering with the properties of RDM entries, it doesnt seem to accomodate retrieving external data.
For example, within the Report Script code, I'd like to be able to load the AD PowerShell module, and query AD for inactive accounts.
Please let me know if you would like any additional info.
Thanks
Joe
import-module activedirectory
$DaysInactive = 90
$time = (Get-Date).Adddays(-($DaysInactive))
$Accounts = get-aduser -filter {LastLogonTimeStamp -lt $time -and enabled -eq $true}
ForEach ($User in $Accounts){
$Report.NewRow();
$Report.SetValue("Name", $User.Name)
}
Hello,
I have opened a ticket to see what we can do to add support for this. We will post back here once we have more information.
Regards,
Hubert Mireault
Thanks Hubert