Skip to content

Instantly share code, notes, and snippets.

@jonmannn
jonmannn / listWin32Apps.ps1
Created August 7, 2018 19:10
Pulls a list of all Win32 apps (filter optional)
Get-WmiObject -Class Win32_Product `
-Filter "Name = 'Sophos SafeGuard Client Configuration 8.00.2.16'"
#!/bin/bash
# Get username of current logged in user
# This method breaks if you allow multiple accounts logged in.
USERNAME=$(ls -l /dev/console | awk '{print $3}')
membership=$(dsmemberutil checkmembership -U $USERNAME -G admin)
if [ "$membership" == "user is not a member of the group" ];
then
if ! launchctl list|grep -q com.apple.atrun; then launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist; fi