Forum Discussion
4 Replies
- Mike_Moniz
Professor
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
Professor
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
- Mike_Moniz
Professor
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
Professor
Oh. That's it? That seems pretty simple. I can think of a bunch of uses for this.
Thanks.