Skip to content

Instantly share code, notes, and snippets.

View joshua-d-miller's full-sized avatar

Joshua D. Miller joshua-d-miller

View GitHub Profile
@joshua-d-miller
joshua-d-miller / MontereyPostInstall.sh
Last active October 22, 2023 11:13
Performs a macOS Upgrade to Monterey in munki by using this is a postinstall_script. Requires changing the type of installer from *startosinstall* to *copy_from_dmg*. Since we use Jamf Pro we make use of the jamfhelper to block out the screen as the upgrade begins.
#!/bin/sh
: '
------------------------
Penn State MacAdmins
------------------------
Performs the following:
- Installs the latest version of macOS by using the current copied
version from munki
Sources:
- https://scriptingosx.com/2019/09/get-current-user-in-shell-scripts-on-macos/
@joshua-d-miller
joshua-d-miller / ResetmacOSLAPS.sh
Last active October 22, 2023 11:46
Reset macOSLAPS back to the FirstPass key if you know the current password and the keychain item is broken
#!/bin/sh
: '
----------------------
Penn State MacAdmins
----------------------
Performs the following:
- Captures the current password of your local admin
if you know it and then changes the password to
the FirstPassKey
Notes:
@joshua-d-miller
joshua-d-miller / TeamViewer15PostInstall.py
Created July 22, 2021 18:26
TeamViewer 15 PostInstall
#!/usr/local/bin/psupython
# pylint:disable=C0103
'''TeamViewer 15 PostInstall Script'''
# This will add our congifuration ID to the application
# bundle so that any custom host module visual modifications
# will be downloaded from the site for each user. It will
# also create a launchagent that will keep the TeamViewer
# client running when a user is logged in even if they exit.
# Joshua D. Miller - josh@psu.edu
# August 13, 2020 - The Pennsylvania State University
@joshua-d-miller
joshua-d-miller / TeamViewer15PreInstall.py
Created July 22, 2021 18:23
TeamViewer 15 PreInstall Script
#!/usr/local/bin/psupython
# pylint:disable=C0103, W0703, E0611, W0107
'''TeamViewer 15 PreInstall Script'''
# This will configure our initial settings for
# TeamViewer version 15 and prepare for install
# Joshua D. Miller - josh@psu.edu
# August 13, 2020 - The Pennsylvania State University
from os import listdir, path, remove
from shutil import rmtree
@joshua-d-miller
joshua-d-miller / macOSLAPS-Utility
Last active October 3, 2018 13:05
Command Line utility to get LAPS passwords from AD for macOS
#!/usr/bin/python
'''Get LAPS password for AD Computers'''
# #################################################################
# This script will allow an admin user with
# the proper domain crednetials to get a LAPS
# password form Active Directory.
# ##################################################################
# Original script by barteardon
# https://github.com/bartreardon/macscripts/blob/master/lapssearch
# Updated script using pyObjC:
@joshua-d-miller
joshua-d-miller / 802.1x Extension Attribute.py
Last active December 17, 2020 16:17
This will read all Ethernet interfaces on a system and determine based on what you call your 802.1x Profile if it is present on all Ethernet interfaces and report it into jamf as a string. You can then create a SMART group that looks for the word false so if any are false you can then use a policy to make the profile apply to all interfaces
#!/usr/bin/python
# pylint: disable=E0611, E1101, E0602, C0103
''''Fix 802.1x When Using Config Profiles and PEAP-MSCHAPV2 or EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will find the system profile and determine whether it is attached
# to each interface and report that information. This is formated to be used
# with jamf as an Extension attribute. Expected output would be as follows:
# || en3 - True || en4 - False || en5 - False ||
#
@joshua-d-miller
joshua-d-miller / 802.1x System Fix.py
Last active February 4, 2022 14:42
This script will allow your 802.1x Configuration Profile to work on any other Ethernet interface at the System Level
#!/usr/bin/python
# pylint: disable=E0611, E1101, E0602
''''Fix 802.1x When Using Config Profiles and PEAP-MSCHAPV2 or EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will find the system profile that is attached to one ethernet
# interface from our configuration profile and then copy it to all other
# ethernet interfaces so that other ethernet interfaces can be used instead
# of just the FirstActiveEthernet at time of profile installation. This issue
# is still an issue as of 10.12.3
@joshua-d-miller
joshua-d-miller / 802.1x Read.py
Last active March 1, 2017 18:14
This script can be used an extension attribute in jamf that will determine if the User Identity Preference is present on the system with an 802.1x EAP-TLS profile. Note: Make this script have the same exclusion and target policy as your configuration profile.
#!/usr/bin/python
# pylint: disable=C0103, W0612, E1101, E0602, E0611
# pylint: disable=W0101, W0110, W0141
''''Report presence of 802.1x User Identity Preference for EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will determined if the KeyChain item that needs created
# for 802.1x EAP-TLS to work on all systems with multiple items is
# present. This information is then reported to jamf.
#
@joshua-d-miller
joshua-d-miller / 802.1x Fix.py
Last active January 18, 2019 12:46
When deploying an EAP-TLS profile for 802.1x Ethernet, this script will create a User Identity preference which will allow a logged in user to use any Ethernet interface that is connected to their machine.
#!/usr/bin/python
# pylint: disable=C0103, W0612, E1101, E0602, E0611
# pylint: disable=W0101, W0110, W0141
''''Fix 802.1x When Using Config Profiles and EAP-TLS'''
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# This script will determine the profile ID that was used when
# installing the 802.1x Ethernet Identity preference and make
# a copy of the keychain entry to be used as a user identity preference
# so that any Ethernet can be used when a user is logged in. As of 10.12.3
#!/usr/bin/python
# pylint:disable=C0103, E0611, E1101, W0703
'''Power User Preferences (With Location Services)'''
# This policy will unlock certain system prereference
# panes in macOS to allow users who do not have administrative
# privileges to access them.
# Joshua D. Miller - josh@psu.edu
# The Pennsylvania State University
# August 31, 2016 - Converted from Bash
# April 4, 2017 - Updates Location Services and tested with 10.12.4