Report of Computer Count by OU

(imported topic written by ErnieF91)

I would like to run a report that would list the count of computers in all my various Active Directy OUs. I see that the Filter Panel in the Consoles shows them that way. There is a Web Reports parameter that includes a “Active Directory Path”, but that includes the actual Computer Name, so it created a new line for every single computer and not the count I’m looking for.

Is there a way to display the computer count this way?

(imported comment written by BenKus)

Hey Ernie,

Try making a Custom Web Report with the following code:

Active Directory Path

<?Relevance trs of (td of it & td of (multiplicity of it as string)) of unique values of (concatenation "." of substrings separated by ",DC=" of it as lowercase) of (following texts of lasts ",OU=" of ( values of results of bes property "Active Directory path"))?>
OU Number of computers

I am not sure if I parsed the active directory path properly, but try that out and see if it works.

Ben

(imported comment written by BenKus)

Here is an example output of that report:

Active Directory Path

OU Number of computers

development.test.com 10

domain controllers.test.com 2

execs.test.com 3

finance.test.com 6

it.test.com 2

marketing.test.com 1

sales.test.com 8

servers.test.com 7

support.test.com 2

(imported comment written by ErnieF91)

Thanks for the info.

I found that only returned the top level OUs. I changed the code as follows and it now reports every OU.

Thanks again for your help.

Active Directory Path

<?Relevance trs of (td of it & td of (multiplicity of it as string)) of unique values of (following texts of firsts ",OU=" of (values of results of bes property "Active Directory path"))?>
OU Number of computers