Hey Experts! It's been awhile since I posted a question on here and would appreciate any assistance you can offer in regards to this question. Our office is under-going an extensive reorg and users are being moved to different departments. Because of this, my memory of knowing which users are in which OU is no longer accurate. I came up with a quick batch script to find the users but I want to clean-up the export to include only a couple pieces of information.
First, the script:
set /p "findstring=Enter in user's first name or string: "
DSQUERY USER ou=blah -name *"%findstring%"*
That outputs this at the command prompt:
"CN=x\, y ,OU=1,OU=2,OU=3,OU=4,DC=5,
I only want the CN (which is the user name) and the ou that relates to OU=2 as the other information is irrelevant to what I need to gather. What would I use to output only those two values?
Thanks again for your help!