0 votes

Hello,

I have a small question about executing custom commands remotely with powershell.
We are now using Adaxes custom commands through orchestrator with remote powershell, but when u execute a custom command like this u don't get any result/log. Is there any way to receive the logs for a command u have just executed in powershell?

Here is an example script we use...:


import-module ActiveDirectory
import-module Adaxes

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("adaxes_server")

$command_example = "{e14bfad4-5234-4ec7-bcd3-ead9b8a9c7ee}"

$UserAD= Get-AdmUser User1   #### Reference user
$UserAD_DN = $UserAD.distinguishedName
$UserAD = $admService.OpenObject("Adaxes://$UserAD_DN", $NULL, $NULL, 0)
$UserAD.ExecuteCustomCommand($command_example)

Kr,
Serge

by (470 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello Serge,

You won't be able to retrieve the results directly, however you can get the result of executing the Custom Command via Adaxes logs. For example, right after executing the Custom Command, you can pull the last operation executed on the user account via the Management History of the user. For information on how to access the Management History of an AD object via PowerShell, see section Getting Operations Performed on a Specific Object in the following SDK article: http://www.adaxes.com/sdk/?AccessingLog ... icationLog.

Related questions

0 votes
1 answer

Hi, I followed this example: https://www.adaxes.com/sdk/IAdmTop6.html, but because the Custom Command is disabled, I get the following error message: System.Management.Automation ... if I enable the Custom Command. I am using Adaxes 2018.2 Best Regards Martin

asked Feb 19, 2020 by Martin (150 points)
0 votes
1 answer

I have a scheduled task that runs a custom command that itself has multiple custom commands that run in a specific timed order. I would like the scheduler to run that top level ... , but Command B and C will wait for Command A to finish. Is this possible?

asked Jul 23 by DA-symplr (100 points)
0 votes
1 answer

We've the following script we want to use in Adaxes to create as part of user creation, to ask if the user will need a AWS workspace, then asks employeetype for different ... "Error") exit(-1) } else { $Context.LogMessage("Created workspace", "Information") }

asked May 3 by Plusa (20 points)
0 votes
1 answer

I have a few reports that I want to add to a custom command workflow such that the report is executed and exported to a csv in a pre-defined (variable) path. I was ... a script to run the report and export it, but could not locate information on that process.

asked Oct 28 by aweight (60 points)
0 votes
1 answer

Hello, Is it possible to execute a custom command after creating a user, with the intention to prompt the end user for more information? For example we have a User ... would then prompt for a 'Country' to be specified from a param dropdown list. Thanks

asked Mar 10, 2022 by bavery (250 points)
3,538 questions
3,229 answers
8,222 comments
547,736 users