Forum Discussion

Kelemvor's avatar
Kelemvor
Icon for Professor rankProfessor
2 months ago

Can LogicMonitor use Active Directory OU information for grouping?

Hi,

We have our servers organized in AD and use those OUs to group similar machines together.  Can I access that information in LM in any way?  I want to make a collection in LM of all the machines in a certain OU in AD but don't know if that's possible or not.

Thanks.

4 Replies

  • You may be able to write a custom PropertySource that does a Get-ADComputer to get the name of the OU into an auto property. Then you can use dynamic groups to look at that property to group them together.

    • Kelemvor's avatar
      Kelemvor
      Icon for Professor rankProfessor

      Is there a sample PropertySource that uses PowerShell that I could look at to see how it works?  This website says you can use Groovy or PowerShell, but every single one of the examples uses Groovy.

      https://www.logicmonitor.com/support/logicmodules/propertysources/creating-propertysources

      It's be great if there was at least one example showing PowerShell.

      Thanks

  • Taking a quick peak, there are few existing ones that have "powershell" in the name like addCategory_Veeam_BackupAndReplication_PowerShell. But really you just need to have it output the values and an exit code:

    if ($ComputerOU) {
        Write-Output "auto.activedirectory.ou=$ComputerOU"
        exit 0
    } else {
        exit 1
    }

    (Write-Host also works)

    • Kelemvor's avatar
      Kelemvor
      Icon for Professor rankProfessor

      Oh.  That's it?  That seems pretty simple.  I can think of a bunch of uses for this.

      Thanks.