DSQUERY sending output to .txt file.

MichaelK2 used Ask the Experts™
Hi guys

I am trying to send the result of a DSQUERY to a .txt file.
I am running the following command on a DC from the start/run command.
dsquery user - inactive 6
I want to see what users have not logged on to the doamin for the last few weeks.
I am not very cleued up with this type of thing, so any solution put forward you will have to spell it out please.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
That's rather simple: add
at the end of your command:
dsquery user -inactive 6 >"SomeTextFile.txt"

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial