I see okay got it, thank you. I notice the other script uses ADSI. Can this script be created as custom command and then use a business rule to schedule or trigger this.
Overall here is our goal
We want to maintain a list of unique departments within Adaxes.
Currently we are achieving this through property patterns, where we have a list of department values which we enforce on user object creation form.
Now the idea is to make this automated where we update that property pattern and then our report parameter where we are using department parameter gets updated automatically.
This is the first step in achieveing this goal where I will first learn to auto populate the report parameter in a automatd fashion, if this goes well then the second step is to provide a mehtod in Adaxes UI for our helpdesk team to update the property pattern which is our primary source for all list of departments.
I am still learning ADSI combination with powershell so I will try to use the example script you have provided, will comment back with more questions. As always appreciate Adaxes supports quick responses.