Read objects from OU and write out error

by Dec 31, 2010

Hi,

How do I read in objects such as computernames or users from not only the top selected OU but the the child OU's as well

The following example will only retrieve what is in the tokyo clients OU but what if there was a windows 7 & then an XP OU etc below the top level OU

get-user -OrganizationalUnit 'OU=Tokyo,OU=clients,OU=Domain X,OU=Managed xx,DC=x,DC=x'|export-csv c:bla.csv

Also – I know it's a big ask for my first post but if I wanted then to pipe the results in to say an audit of computers found script or perform some other operation with the results retrieved from the OU's, how would I know or is there a way to export to a file the computers that were not found or contactable from the first part of the script that retrieved the objects.

I hope this makes sense

Happy New Year!!