I want to write a batch file that saves specific user account information's by using the windows command "net user account /domain". Problem is when I use the findstr the output is not written into the file:
set userlist = user1 user2 user3
for %x in (userlist) do (
net user %x /domain | findstr /B /C:"Last logon" > D:\userInfoList.txt
)
This is just an example. At the end I want for every user an entry like this but with the actual informations. username; lastLogin; nextPasswortChange etc. How can I build such an output?
Thanks in advance!