Created
November 25, 2016 10:47
-
-
Save carlashley/65c05b91fa8923b6138018819745e212 to your computer and use it in GitHub Desktop.
List all local users and exclude system accounts and dump out as CSV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This will also work with /Search/Users instead of /Local/Users | |
/usr/bin/dscl localhost -list /Local/Users UniqueID | awk '$2 >= 100 { print $1 "," }' | grep -v "^_" > users.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment