Mac Management Group

Mac Package Verification Script 

Jan 20, 2016 12:25 PM

Mac Managed Software Delivery now includes Detection or Compliance rules. Often, it is helpful to verify the packages installed on mac clients. The default command is to find the package name, then run 'pkgutil ---pkginfo <pkg name>'. It's a bit difficult to do this for every component of a package. 

The following script simplifies listing pkg info. It defaults to search for package with 'altiris' in the name. If you put any other string in the command line, it will search for that, instead. 

I named it 'pkgutilx' and put in the mac's /usr/sbin/ directory so it's available from anywhere. 

========================================================================
#!/bin/sh 

# mac only

curName=$1
if [ -z $curName ]; then
  curName='altiris'
fi

echo
echo 'Installed Packages'
echo '===================================' 
pkglist=`pkgutil --packages | grep -i $curName` 
echo "$pkglist"
echo
echo 'Package Details...'
echo '===================================' 

for i in $pkglist; do 
  echo "`pkgutil --pkg-info $i`"
  echo 
done
echo '==================================='
echo
========================================================================

Statistics
0 Favorited
2 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
txt file
pkgutilx.txt   418 B   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Jan 20, 2016 02:43 PM

Also, pretty sure /usr/sbin is off limits on 10.11.x and higher, so it is probably better to save it to /usr/local/sbin instead to make it future proof.

Jan 20, 2016 02:36 PM

Would love to see an article or documentation detailing how the detection rules actually work, (or don't work) on Mac. We've had very limited success in utilizing them.

Related Entries and Links

No Related Resource entered.