Collect Mac OS Hardware Software Information - hewigovens/hewigovens.github.com GitHub Wiki

##How to find

  • man opensnoop
  • man fs_usage
  • man sysctl
  • otool -L
  • pplist=/usr/libexec/PlistBuddy -c 'Print'

###Basic Hardware/OS

  • system_profiler SPHardwareDataType -xml
  • system_profiler SPSoftwareDataType -xml
  • sysctl -A
  • [NSProcessInfo processInfo]
  • [[NSFileManager defaultManager] attributesOfFileSystemForPath:@"/" error:nil]
  • IOKit::IOServiceGetMatchingServices

###Full Mac ID

  • /System/Library/PrivateFrameworks/ServerInformation.framework/Versions/A/Resources/*.lproj/SIMachineAttributes.plist

  • Query Apple Support website e.g.:http://support-sp.apple.com/sp/product?cc=DJWR&lang=de_DE

    • cc means last 4 char of serial number

###Disk space

  • man statvfs

###Timezone

  • sudo systemsetup -gettimezone

###Application Version

  • osascript -e 'version of application "Google Chrome"'
  • mdls -name kMDItemVersion -raw /Applications/Google\ Chrome.app

###System update

  • /usr/libexec/PlistBuddy -c 'Print :ScheduleFrequency' /Library/Preferences/com.apple.SoftwareUpdate.plist

###Gatekeeper cat /var/db/SystemPolicy-prefs.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>enabled</key>
	<string>yes</string>
</dict>
</plist>

###TimeMachine

  • /usr/libexec/PlistBuddy -c 'Print :globalstate' /Library/Preferences/com.apple.alf.plist
  • /usr/libexec/PlistBuddy -c 'Print:AutoBackup' /Library/Preferences/com.apple.TimeMachine.plist
  • sudo launchctl list | grep softwareupdate
  • tmutil status

###Proxy

% scutil --proxy

<dictionary> {
ExceptionsList : <array> {
	0 : *.local
	1 : 127.0.0.1
}
FTPPassive : 1
HTTPEnable : 1
HTTPPort : 8087
HTTPProxy : 127.0.0.1
HTTPSEnable : 1
HTTPSPort : 8087
HTTPSProxy : 127.0.0.1
SOCKSEnable : 1
SOCKSPort : 7070
SOCKSProxy : 127.0.0.1
ProxyAutoConfigEnable : 1
ProxyAutoConfigURLString : http://wpad/wpad.dat
ProxyAutoDiscoveryEnable : 1
}

###Filevault

  • sudo fdesetup status
  • `diskutil cs list | grep -E "^CoreStorage logical volume groups"

###User Language

  • sudo -u users | cut -d ' ' -f1 defaults read -g AppleLanguages | sed -n '2p' |tr -d ', '

###Parental Control % dscl . read /Users/test MCXSettings`

MCXSettings:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>mcx_application_data</key>
<dict>
    <key>com.apple.Dictionary</key>
    <dict>
        <key>Forced</key>
        <array>
            <dict>
                <key>mcx_data_timestamp</key>
                <date>2013-03-13T08:39:03Z</date>
                <key>mcx_preference_settings</key>
                <dict>
                    <key>parentalControl</key>
                    <true/>
                </dict>
            </dict>
        </array>
    </dict>
</dict>
</dict>
</plist>

###All users

  • dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]'

###Current Active user

  • stat -f "%Su" /dev/console

###Default aplication % pplist /Users/user/Library/Preferences/com.apple.LaunchServices.plist

Dict {
LSHandlers = Array {
    Dict {
        LSHandlerURLScheme = http
        LSHandlerRoleAll = com.google.chrome
    }
    Dict {
        LSHandlerURLScheme = https
        LSHandlerRoleAll = com.google.chrome
	}
}

#Reference

⚠️ **GitHub.com Fallback** ⚠️