Advertisement
applehelpwriter

reveal hidden users

May 21st, 2017
3,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #! /bin/bash
  2. # script by Phil Stokes, applehelpwriter.com
  3.  
  4. lw="/Library/Preferences/com.apple.loginwindow"
  5. # dlu="/Library/Preferences/com.apple.preferences.accounts"
  6.  
  7. printf "Current users:\n%s `w`"
  8.  
  9. declare -a arr=("daemon" "nobody" "root" "Guest")
  10. printf " User\tID\n"
  11. for i in `dscl . -list /Users | grep -v '^_'`;
  12. do
  13.  
  14.         if [[ ! "${arr[@]}" =~ "$i" ]]; then
  15.             k=`id -u $i`
  16.             printf "\t%s\t\t%s\n $i $k"
  17.         fi
  18. done
  19. printf "\n\nLoginwindow: %s `defaults read "$lw"`"
  20. # printf "\n\nDeleted Users: %s `defaults read "$dlu"`"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement