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 (100 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)
0 votes
1 answer

Is there a way to use the "Super Manager" role and only allow the execution of certain Custom Commands? Right now I think if I want to do that I need to create ... 't want to Deny individual actions. Can you restrict access to a container or custom commands?

asked Aug 17, 2020 by ComputerHabit (790 points)
0 votes
1 answer

I would like to add the following logic into a Powershell script that will be triggered on 'After Create User'. Read the value of the 'title' property of the user just created ... 'True' or 'False'. Could you assist with how to script this please? Many thanks.

asked May 1, 2020 by Bernie (310 points)
0 votes
1 answer

Is it possible to have custom command that doesn't execute on a specific (or any) AD object? I realize Adaxes is for AD management, but I was wondering if it would be ... to execute against and AD object, I just need it to talk to the SQL server. Thanks

asked Nov 9, 2012 by bemho (520 points)
3,326 questions
3,026 answers
7,727 comments
544,678 users