Using SCCM Compliance Settings to Install Root Certificate on Macs

Here is one of my old shell scrips…it is very hard to use sccm to manage Macs, as Microsoft really doesn’t support Mac platform that well…last year, I even discovered a bug that SCCM has…and they gave me free credit for that support case 🙂

Discovery Script:

#!/bin/bash

# Rui Qiu’s Root CA Script
# V3
# 07212015
FILE=/var/sccm/cert.txt

if [ -f $FILE ];
then
echo 1
else
echo 0
fi

Redemption Script:

#!/bin/bash

# Rui Qiu’s Root CA Script
# V3
# 07212015
# Download Root Cert
curl http://xxx.com/tools/root.cer -o /tmp/root.cer

# Add cert
sudo security add-trusted-cert -d -r trustRoot -k “/Library/Keychains/System.keychain” “/private/tmp/root.cer”
# Create custom folder and copy file
sudo mkdir -p /var/sccm
sudo curl http://xxx.com/tools/cert.txt -o /var/sccm/cert.txt

# Remove cert
sudo rm /tmp/root.cer

Leave a Comment