cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.

[PowerShell] macOS 15 Sequoia compatibility script to check your fleet with optional System Group creation

JuergenKlaassen
Rising Star III
Rising Star III

Hi Folks

Excited about the upcoming macOS 15 Sequoia? 
You might want to do a sanity check on your fleet of macOS devices ahead of it to plan the update and deployment process. Pretty sure you will get requests from users and some might be unlucky if they're running incompatible systems. 
I have a script for you to determine the status for each system and optionally create a System Group on JumpCloud with compatible devices. 
SCR-20240613-hzyb.png

 

# List of compatible Mac models for macOS Sequoia
$compatibleModels = @(
    "Mac13,1", "Mac13,2", "Mac14,10", "Mac14,12", "Mac14,13", "Mac14,14", "Mac14,15",
    "Mac14,2", "Mac14,3", "Mac14,5", "Mac14,6", "Mac14,7", "Mac14,8", "Mac14,9",
    "Mac15,10", "Mac15,11", "Mac15,12", "Mac15,13", "Mac15,3", "Mac15,4", "Mac15,5",
    "Mac15,6", "Mac15,7", "Mac15,8", "Mac15,9", "MacBookAir10,1", "MacBookAir9,1",
    "MacBookPro15,1", "MacBookPro15,2", "MacBookPro15,3", "MacBookPro15,4",
    "MacBookPro16,1", "MacBookPro16,2", "MacBookPro16,3", "MacBookPro16,4",
    "MacBookPro17,1", "MacBookPro18,1", "MacBookPro18,2", "MacBookPro18,3",
    "MacBookPro18,4", "MacPro7,1", "Macmini8,1", "Macmini9,1", "VirtualMac2,1",
    "iMac19,1", "iMac19,2", "iMac20,1", "iMac20,2", "iMac21,1", "iMac21,2", "iMacPro1,1"
)

# Get system insights
$sysinfo = Get-JCSystemInsights -Table SystemInfo

# Filter systems by Apple Inc.
$appleSystems = $sysinfo | Where-Object { $_.HardwareVendor -eq "Apple Inc." }

# Filter systems that match compatible models
$compatibleSystems = $appleSystems | Where-Object { $compatibleModels -contains $_.HardwareModel }
$incompatibleSystems = $appleSystems | Where-Object { $compatibleModels -notcontains $_.HardwareModel }

# Display compatible systems
Write-Host "Compatible Systems:" -ForegroundColor Green
$compatibleSystems | Select-Object ComputerName, Hostname, CpuBrand, HardwareModel, HardwareSerial, PhysicalMemory |
    Format-Table -AutoSize

# Display incompatible systems
Write-Host "Incompatible Systems:" -ForegroundColor Red
$incompatibleSystems | Select-Object ComputerName, Hostname, CpuBrand, HardwareModel, HardwareSerial, PhysicalMemory |
    Format-Table -AutoSize

# Ask to create a new group for compatible systems
$createGroup = Read-Host "Do you want to create a new group for the compatible systems? (yes/no)"

if ($createGroup -eq "yes") {
    # Get group name from the user
    $groupName = Read-Host "Enter the name for the new group"
    
    # Create the new group
    $group = New-JCSystemGroup -GroupName $groupName
    
    # Check if group creation was successful
    if ($group) {
        # Add compatible systems to the new group
        foreach ($system in $compatibleSystems) {
            Add-JCSystemGroupMember -GroupName $groupName -SystemID $system.SystemId
        }
        Write-Host "Compatible systems have been added to the new group: $groupName" -ForegroundColor Green
    } else {
        Write-Host "Failed to create the new group: $groupName" -ForegroundColor Red
    }
} else {
    Write-Host "No new group created." -ForegroundColor Yellow
}

# Ask to save the results in a CSV file
$saveCSV = Read-Host "Do you want to save the results in a CSV file? (yes/no)"

if ($saveCSV -eq "yes") {
    # Save compatible and incompatible systems to CSV files in the current folder
    $compatibleSystems | Select-Object ComputerName, Hostname, CpuBrand, HardwareModel, HardwareSerial, PhysicalMemory |
        Export-Csv -Path "./macOS15_compatible_systems.csv" -NoTypeInformation
    $incompatibleSystems | Select-Object ComputerName, Hostname, CpuBrand, HardwareModel, HardwareSerial, PhysicalMemory |
        Export-Csv -Path "./macOS15_incompatible_systems.csv" -NoTypeInformation

    Write-Host "Results have been saved to CSV files: ./macOS15_compatible_systems.csv and ./macOS15_incompatible_systems.csv" -ForegroundColor Green
} else {
    Write-Host "Results not saved to CSV." -ForegroundColor Yellow
}

P.S.: If you need a Dynamic Group with devices running on Sequoia (i.e. for evaluation purposes), here you go: 
SCR-20240613-hzbw.png

 
Cheers
-Juergen

1 REPLY 1

Roto31
Novitiate II

Instead of this:

# List of compatible Mac models for macOS Sequoia
$compatibleModels = @(
    "Mac13,1", "Mac13,2", "Mac14,10", "Mac14,12", "Mac14,13", "Mac14,14", "Mac14,15",
    "Mac14,2", "Mac14,3", "Mac14,5", "Mac14,6", "Mac14,7", "Mac14,8", "Mac14,9",
    "Mac15,10", "Mac15,11", "Mac15,12", "Mac15,13", "Mac15,3", "Mac15,4", "Mac15,5",
    "Mac15,6", "Mac15,7", "Mac15,8", "Mac15,9", "MacBookAir10,1", "MacBookAir9,1",
    "MacBookPro15,1", "MacBookPro15,2", "MacBookPro15,3", "MacBookPro15,4",
    "MacBookPro16,1", "MacBookPro16,2", "MacBookPro16,3", "MacBookPro16,4",
    "MacBookPro17,1", "MacBookPro18,1", "MacBookPro18,2", "MacBookPro18,3",
    "MacBookPro18,4", "MacPro7,1", "Macmini8,1", "Macmini9,1", "VirtualMac2,1",
    "iMac19,1", "iMac19,2", "iMac20,1", "iMac20,2", "iMac21,1", "iMac21,2", "iMacPro1,1"

which is cumbersome, wouldn't a regex be more efficient? Less text and less space for error when copying and pasting.