This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Run AD scan via script file

Hi,

is there a way to trigger an AD scan via script file?

When an AD account is locked, this is not visible in ARM in real time.
However, it is possible to activate an alarm which is triggered when an AD account is locked. The alarm can then be used to start a script.

In this way, locked AD accounts would be immediately visible in the ARM.

Kind regards

Jonas

Parents
  • Cool Idea, and yes there is an unofficial way to trigger. Look into the ARM installation directory and look for the file "app8ManCommand.exe --help". There is a recan for the OnPrem AD. Unfortunately, it is unofficial and could be "removed" every release :-(. It would be great if all that function would go into the official Web API.

  • I have created a script that triggers the AD scan.
    When I run the script manually, it works fine.
    However, when the script is run as a result of an account lockout alert, the execution always fails with the message that the collector is unreachable.

    Do you have any idea what the problem could be?

  • I believe it is the user which runs the script. In user mode you are using an account which has admin rights in ARM. In your alert script, you might be running the script in system context or a user which does not have any access right in ARM. You would see it in the "pnJob.log" which user is used for calling the alert script. You need to configure a user in the script configuration page within the configuration of ARM. 

    If you already configured a user, be sure that this user is an administrator of ARM.

    Hope that helps.

  • Thanks for the suggestion, I had already tried that. Unfortunately, the same error still occurs.

    By the way, the error message refers to the FQDN of the collector.
    But in the collector overview in the ARM configuration the collector is only set up under its simple name, not as FQDN.

    The collector is the ARM server itself.
    Do you know if it is possible to rename the collector in the ARM configuration?
    When I right click on the collector, all entries in the menu are grayed out.
    I can rename additional collectors without any problem, but not the ARM server collector.

  • Which version are you using? It should be fixed with 2022.

  • Thanks for the hint!

    We still have 2021.4.2 installed, but I will upgrade to 2022 soon.

Reply Children
  • Could you update and is it working now?

  • Thanks for asking, unfortunately I have not been able to update yet.

    I will keep you informed.

  • FYI:
    I just installed version 2022.4, but I still can't change the name of the collector.

  • Where do you want to change the name of the collector? In the collector page? Or in the alerts page? The collector in the alert page will be used from the AD Logga configuration.

  • I tried to change the name directly in the collector overview. However, all entries of the main collector (ARM server itself) are grayed out:

    For the second collector the name can be changed without any problems:

  • Das ist Richtig. Der ARM Server selber wird immer aus Environment:ComputerName gebildet. Den kann man nicht umbenennen. Das machen wir immer via SQL. Warum willst du den Namen eigentlich ändern?

  • Die ursprüngliche Frage war ja, ob man einen AD-Scan per Script anstoßen kann.

    Du hattest die Idee geäußert, hierfür app8ManCommand.exe zu verwenden, auch wenn es eine inoffizielle Lösung ist, die jederzeit abgeschaltet werden könnte.

    Ich hatte ein entsprechendes Skript gebaut, welches bei manueller Ausführung auch prima funktioniert.

    Wenn ich das Skript im ARM über einen Alarm triggern lasse, funktioniert das Skript allerdings nicht. Die Fehlermeldung im Log sagt aus, dass der Kollektor nicht erreichbar ist.

    Dabei ist mir aufgefallen, dass die Fehlermeldung sich aber nicht auf den einfachen Servernamen, sondern auf den FQDN bezieht (warum auch immer). Ich hatte also die Hoffnung, wenn ich den Namen des Kollektors (ARM Server) auf den FQDN drehe, dass die Meldung somit nicht mehr erscheint und die Ausführung des Skripts über einen ARM-Alarm funktioniert.

  • Das sollte aber in der neuen Version gelöst sein. Damals war das Problem, dass er seinen eigenen Kollektor nicht findet. Wir können aber auch gerne mal unverbindlich raufschauen. Einfach unsere Webseite unter https://termine.cusatum.de schauen und einen Termin Erstberatung mit Mike buchen. Wir haben das ja bei vielen Kunden lauffähig.

    Ach so noch eins ist wichtig, dass die Scripts auf alle Kollektoren auch manuell kopiert werden muss, da diese nicht durch ARM kopiert werden. Das ist bei verteilten Systemen etwas "anstrengend".

  • Danke für das nette Angebot, mein Problem hat sich damit aber gerade erledigt. :-)

    Nach Installation des aktuellen Updates habe ich nur überprüft, ob ich den Kollektornamen verändern kann - was nicht funktioniert, wie du es richtig beschrieben hast.

    Ich habe die Skriptausführung über den Alarm selbst gar nicht getestet, weil ich davon ausgegangen bin, dass derselbe Fehler wieder auftreten wird. Aber auch hier hast du Recht: Die Skriptausführung funktioniert nun, weil er den Kollektornamen offenbar korrekt auflöst.

    Vielen Dank nochmal für deine Hilfe!

  • gerne :-), noch einen schönen Tag