applehelpwriter

reveal hidden users

May 21st, 2017
1,567
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×