MacOS Ventura Hardware Compatibility regex

Eltord
Contributor

Edit: Replaced beginning with updated Mac Studio and M2 Mac details now that i've finally gotten some in my environment to confirm.

Hi all, 

I've gone ahead and taken the liberty to modify the existing Regex from @talkingmoose to account for the devices that are currently being listed as compatible with macOS Ventura, along with a little bit of future proofing:

(^Mac1[3-9]|MacBook\d{2}|MacBookAir([8-9]|\d{2})|Macmini([8-9]|\d{2})|MacPro([7-9]|1\d)|iMacPro[1-9]|iMac(1[8-9]|2[0-9]),\d|MacBookPro(1[4-9]|2[0-9]),\d)

This can be used in a smart group or inventory report using the criteria item Model Identifier and then selecting "does not match regex" operator. Copy/paste the regex into the value and save the Smart Group to view all mac's that ARE NOT compatible with Ventura, or set the operator to "matches regex" to see devices that ARE compatible.

Screen Shot 2022-06-07 at 12.56.30.png

Let me know if I made any mistakes. Thanks all!

 

25 REPLIES 25

obi-k
Valued Contributor III

Thanks for posting this @Eltord! Saved me some work and time!

 

Do you happen to have a Regex for iOS 16 available?

skeenan07
New Contributor III

I posted a regex for iOS 16, iPadOS 16, and tvOS 16 here

Eltord
Contributor

I do not, but I also don't have any mobile devices in my environment so I wouldn't be able to properly test and confirm it anyways. Sorry.

dgreening
Valued Contributor II

YTMND!

Anonymous
Not applicable

@Eltord  thanks a lot for sharing this!

AJPinto
Honored Contributor III

You are a saint, thank you!!!

ajaysutton
New Contributor III

Very cool.  Thank you sir.

dstranathan
Valued Contributor II

I found a similar version on MacAdmins Slack #ventura channel by @jmahlman 

Model Identifier does not match regex iMac(1[8-9]|[2-9]\d)|^MacPro[7-9]|iMacPro|Macmini([8-9]|\d\d)|MacBookAir([8-9]|\d\d)|MacBook(\d\d)|MacBookPro(1[4-9])|^Mac1[3-9]

Here's an EA version by Laurent Pertois: https://github.com/laurentpertois/Ventura-Compatibility-Checker/

I prefer this method personally as I like to customize the EA to add a third value of "Installed", so I ultimately have 3 possible results:

-Compatible with Ventura
-Not Compatible with Ventura
-Ventura Installed

I do this because I don't want the EA reporting a 'false positive' from a Mac that is technically compatible but already has Ventura installed.

Do you mind sharing the script lines you added for "Ventura" installed? I suspect something along the lines of a check for OSVersion =22 then COMPATIBILITY = "Already Installed"... after line 103?

dstranathan
Valued Contributor II

Baisically I just add this section before Laurent's "Let's Go" section:


################################################################################
#    Custom Logic June 2022: 
################################################################################

# If target Mac is already running macOS 13 Ventura, report "Installed" and exit 0. No need to contune with Jamf's compatibility logic.

# Otherwise, if target Mac is not running Ventura already, continue with Jamf logic to verify compatability.

# This allows this EA script to have 1 of 3 possible results: 'True', 'False' and 'Installed'.

OS_MAJOR_VERSION=$( sw_vers -productVersion | awk -F. '{print $1}' )

echo "QA: OS_MAJOR_VERSION = ${OS_MAJOR_VERSION}"

if [[ "${OS_MAJOR_VERSION}" -eq 13 ]]; then
    COMPATIBILITY="Installed"
    echo "<result>${COMPATIBILITY}</result>"

    exit 0
fi

 

This add here is AWESOME @dstranathan ! Thank you for this. I am not good with scripting like this but could one take this a step further to add a "Past Version" option and then have the check stop there if it were for said past version? So the thought is for this would be now that there is a new OS out we would add something to the Venturea checker here that if it is OS 14 report back as "Past" or "Past Version" and stop checking. Just trying to think through the we have older versions of this and instead of them reporting "false" which we would not be using anyway for anything new going forward, but would the need for JAMF to not check it help with the speed of a recon or does it not matter for that? And would only help us with the visual report back of "Past". 🤷🏻‍♂️ Thanks

I posted an update to make sure I include the Mac Studio:

iMac(1[8-9]|[2-9]\d)|^MacPro[7-9]|iMacPro|Macmini([8-9]|\d\d)|MacBookAir([8-9]|\d\d)|MacBook(\d\d)|MacBookPro(1[4-9])|^Mac1[3-9]

dstranathan
Valued Contributor II

(ignore)

Siggloo
New Contributor II

You also have this one I have used for a few years. Zack has made a great EA here

https://github.com/MLBZ521/MacAdmin/blob/master/Jamf%20Pro/Extension%20Attributes/Get-LatestOSSuppor... 

brunerd
Contributor

Awesome, thanks @Eltord using data already in Jamf is a lot quicker than waiting for an EA to come back! However years ago before I was any good at regex I approached this from the client side and made an EA to report compatible versions back to Jamf: macOSCompatibility.sh (now updated for Mac Studio and Ventura), it's still fun to run for all versions and models and see which ones got screwed over for number of OSes they support

dvasquez
Valued Contributor

Thank you for saving me some work here! 

Appreciated!

Aldo92500
New Contributor

Great ! Thx

M2 are not managed with this regex

brunerd
Contributor

@Aldo92500 Yeah it just needed "Mac14" added to the list by way of this range Mac1[3-9]... I went ahead and followed the future proofing feel of the original, although maybe it's too much, since some of these far flung future Mac Model IDs will be too new to run what will be ye olde Ventura by that point! And it seems that new models are now just "Macx,x" without any rhyme or reason?! 

Anyway this adds Mac14 to the list:

^Mac1[3-9]|MacBook\d{2}|MacBookAir([8-9]|\d{2})|Macmini([8-9]|\d{2})|MacPro([7-9]|1\d)|iMacPro[1-9]|iMac(1[8-9]|2[0-9]),\d|MacBookPro(1[4-9]|2[0-9]),\d

 I love the optimism of iMacPro[1-9] even though it never made it to iMacPro2! 🥲 

user-dgHsjsLugo
New Contributor

Hey what would have to be added to include M2 devices?

From a hardware model perspective this might help you:

https://derflounder.wordpress.com/?s=ventura+smart+groups

I was finally able to get an M2 MacBook Air in my environment yesterday for the first time actually, and in Jamf its showing as Mac14,2, so that will fall into the first piece of the regex "Mac1[3-9]" already. I'll monitor this for any changes, but at quick glance it appears that Apple is starting to consolidate their model identifiers in some fashion.

dvasquez
Valued Contributor

Fantastic thank you @Eltord 

tcandela
Valued Contributor II

will this need to be updated each time new mac models come out?

(^Mac1[3-9]|MacBook\d{2}|MacBookAir([8-9]|\d{2})|Macmini([8-9]|\d{2})|MacPro([7-9]|1\d)|iMacPro[1-9]|iMac(1[8-9]|2[0-9]),\d|MacBookPro(1[4-9]|2[0-9]),\d)

dvasquez
Valued Contributor

I think in small ways. Have you tested?

I will also look into this.