CSVDE doesn't query child domains

I'm trying to generate a report for a customer that lists out display name, office and description for each member of each distribution list they have in AD.

I hacked something together using csvde but it's giving me unexpected results...  The Forest at this customer consists of a parent (root) domain and two child domains.  All the distribution lists are located in the parent/root domain.  When I run my mini-script against the OU that contains all of the distribution lists though, I only get results if the user account is found in the parent domain.  Any users that are in child domains simply don't show up in the report...  I feel like I'm missing something simple here but I can't find it for the life of me.

Attached is my little script that I've been running so far.

@echo off
if exist groups.txt del groups.txt
dsquery group "OU=DistributionLists,DC=domain,DC=com" >groups.txt
for /f "tokens=*" %%g in (groups.txt) do csvde -f %%g-report.txt -s rootdc2 -r (memberof=%%g) -l displayname,physicaldeliveryofficename,description,mail

Open in new window

Who is Participating?
trturner123Connect With a Mentor Author Commented:
Solved this a different way...


The evaluation version was enough to get the report my customer needed.
All Courses

From novice to tech pro — start learning today.