Hi,
Not sure if I'm asking the right question but here we go..!
I am looking to run a PowerShell Script that remotely triggers an Adaxes Custom Command and I would like to get direct feedback on the success\failure of the command to use in my pipeline.
In my simple test the Custom Command tests if the supplied user is a member of a group, and if so runs a PS script that logs the message 'True'.
Using the below PS script remotely I can execute this Command by passing it a user DN and then return the log message as my 'feedback', but was wondering if there was a more elegant way of doing this?
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("server")
$user = $admService.OpenObject("Adaxes:/CN=Joe Bloggs,DC=network,DC=net", $NULL, $NULL, 0)
$user.ExecuteCustomCommand({command GUID})
$operationInfo = $user.GetLastOperationInfo()
$executionLog = $operationInfo.ExecutionLog
$executionLog.SubEntries.SubEntries.Message