Skip to content

Instantly share code, notes, and snippets.

@rustymyers
Last active August 29, 2015 14:02
Show Gist options
  • Save rustymyers/f245c42f784b13fe4b48 to your computer and use it in GitHub Desktop.
Save rustymyers/f245c42f784b13fe4b48 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
import os
# import subprocess
# import re
ProfileInstalled = False
getprofile='/usr/bin/profiles -C'
print("GetProfile: "+getprofile)
profileDump = os.popen("/usr/bin/profiles -C")
for line in profileDump:
if "com.meraki.smasdf" in line:
ProfileInstalled = True
# Split the line into three parts
lineSplit = line.rsplit(":")
# Set the third element as variable
profileName = lineSplit[2]
if ":" in line:
print("Found profile: {0}".format(profileName))
#os.system("/usr/bin/profiles -R -p "+profileName)
if ProfileInstalled == False:
print("There are no Apple Profile Manager Profiles installed on the system. Uninstall not Required.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment