Skip to main content
Question

EA Script to pull Brew installs

  • Aug 22, 2024 5:32 PM UTC
  • 1 reply
  • 89 views

MPL
Forum|alt.badge.img+8
  • Valued Contributor

Hello All,

 

Looking to see if anyone has a bash script to pull brew installations and then use that in an Extension Attribute to pull from all machines.

 

Similar to this post: https://community.jamf.com/t5/jamf-pro/home-brew-and-collect-application-usage-information/m-p/249337

 

- Can't get the EA working from the post above though :(

 

1 reply

WickedSmaht
Forum|alt.badge.img+5
  • Contributor
  • Dec 2, 2026 9:30 AM UTC

One thing to keep in mind is that Jamf Extension Attributes run as root, whereas Homebrew generally refuses to run as root.

If you're only interested in inventorying installed formulae and casks, you can avoid calling the Homebrew binary altogether by inspecting the Cellar and Caskroom directories directly.

This also accommodates both Intel and Apple Silicon Macs:

#!/bin/bash

result=""

for prefix in /opt/homebrew /usr/local; do
for folder in Cellar Caskroom; do
if [[ -d "$prefix/$folder" ]];