The task is to make the bat-file a list of local users with parameters like the last login time and password effect.

How can I combine the execution of net user user1 net user user2, etc.

and filter the output to specific parameters.

  • ActiveDirectory in stock? - Viktor Tomilov
  • No, local users like Administrator needed - Miwa
  • Then WMI without AD does not help, or you need specials. module install - Viktor Tomilov

1 answer 1

The net user command displays the usernames of the table: in 3 columns 25 characters wide. It turns out, you need to collect all the rows of the table in a string variable, and then parse it. It's easier to use the command that immediately displays the names of local users: wmic useraccount where (localaccount = "True") get Name . And for each received name, it is necessary to make the loop output the command: net user <name>