Skip to content

Instantly share code, notes, and snippets.

View PeetMcK's full-sized avatar
👾

Peet McKinney PeetMcK

👾
View GitHub Profile
@PeetMcK
PeetMcK / Get-LocalMembers.sh
Created July 15, 2021 23:54
usage -- Get-LocalMembers GROUPNAME
# (usage -- Get-LocalMembers GROUPNAME)
Get-LocalMembers () {
if ! dscl . list /Groups/"$1" >> /dev/null 2>&1;then
echo "A Local Group with the name $1 does not exist."
exit 1
else
dscl . -list /Users | \
while read user
do printf "$user "
dsmemberutil checkmembership -U "$user" -G "$1"
@PeetMcK
PeetMcK / convert.sh
Last active July 23, 2020 23:40 — forked from calum-github/convert.sh
AD Plugin UID calculation from ObjectGUID
#!/bin/bash
#
# Author: Calum Hunter
# Date: 28/11/2016
# Version: 1.0
# Purpose: To generate a Mac UID from the objectGUID attribute
# (GeneratedUID) in AD.
# This uses the same method that the Apple
# AD Plugin uses