I'll be the first to admit I am not a linux guru, but I do know some basics.
I am working on scraping local user information from servers to see what accounts exist, their state, last login and from which computer they're from. For windows and powershell, this is super simple and I've put it into a pscustomobject/table which can be easily exported - example below.
I am having trouble pulling this information from Linux in a usable way - I can use the 'last' command to pull the last login time, and will need to parse that, so that's not a big problem.
Getting a full list of local user accounts is proving a little difficult though. I have tried:
awk -F: '$3 >= 1000 {print $1}' /etc/passwd
This does print out my user, which is great, but doesn't help with any account status information, and it excludes system accounts which have ID's 0-999. But without the supporting data, just simply "viewing" the accounts isn't very useful.
Having not worked with linux command line much, also not sure the best way to store the variables to extract it out to CSV. Am I missing some kind of useful toolset that would pull this information?