The command works well, I get a list of all users in that specific OU in a text file. Each user is listed in 1 line. But the problem is before the username and after the user name there are white space... How do I remove these whitespaces?
DSQUERY USER OU=firstou,OU=secondou,OU=thirdou,DC=child,DC=domain,DC=domain,DC=com| DSGET USER –SAMID >USERSLIST.TXT
Join the community of 500,000 technology professionals and ask your questions.