Skip to content

Instantly share code, notes, and snippets.

@poundbangbash
poundbangbash / munkitools5.munki.recipe
Created May 13, 2020 04:34
Munki 5 pre-release recipe for autopkg
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Note: munkitools does not include a code signature. If your
organization requires code signature, it is recommend to internally sign
the application.
Downloads and imports version 5 of the Munki tools via
@poundbangbash
poundbangbash / enable-private-log.mobileconfig
Created February 20, 2020 16:19
Enable Private logging in Catalina
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>ManagedClient logging</string>
<key>PayloadEnabled</key>
@poundbangbash
poundbangbash / secure_token_list.py
Created March 9, 2019 05:10
Secure Token user list for munkireport
#!/usr/bin/python
"""
Devtools for munkireport.
Will return array of strings of users with Secure Tokens
"""
import subprocess
import os
import plistlib
@poundbangbash
poundbangbash / isMDMEnrolled.py
Created February 11, 2019 16:29
Munki fact to check if MDM is Enrolled
#!/usr/bin/python
import platform
import plistlib
import subprocess
from distutils.version import LooseVersion
def get_os_version():
'''Return OS version.'''
return LooseVersion(platform.mac_ver()[0])
@poundbangbash
poundbangbash / isMDMInstalled.py
Created February 11, 2019 16:27
Munki fact to check if MDM is Installed
'''Check MDM install status'''
import subprocess
import plistlib
import sys
def fact():
'''Check MDM install status'''
cmd = ['/usr/bin/profiles', '-C', '-o', 'stdout-xml']
run = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@poundbangbash
poundbangbash / isFileVaultActive.py
Created February 11, 2019 16:26
Munki fact to check FileVault Status
'''Check if FileVault is Active'''
import subprocess
def fact():
'''Check if FileVault is Active'''
cmd = ['/usr/bin/fdesetup', 'isactive']
run = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = run.communicate()
try:
@poundbangbash
poundbangbash / com.microsoft.word
Last active April 19, 2017 22:03
MS example Word profile for version 15.32+
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.microsoft.Word</key>
@poundbangbash
poundbangbash / com.microsoft.office.mobileconfig
Last active March 6, 2018 09:08
com.microsoft.office preference management mobileconfig for Office 15.33+
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.microsoft.office</key>
@poundbangbash
poundbangbash / manifestutil
Created October 21, 2016 03:45
manifestutil with refresh-cache subcommand attempt
#!/usr/bin/python
# encoding: utf-8
#
# Copyright 2011-2016 Greg Neagle.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0