SHARE
TWEET

reveal hidden users

applehelpwriter May 21st, 2017 (edited) 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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"`"
RAW Paste Data
Pastebin PRO Autumn Special!
Get 40% OFF on Pastebin PRO accounts!
Top