Posted on 11-04-2022 01:30 PM
I am trying to create a smart group to find computers that have local user accounts that don't match the company standard user accounts. We have a specific format that our user accounts are so I need to be able to use wildcards.
Posted on 11-04-2022 01:51 PM
Can you provide examples of what it should look like and an example of non-company standard?
Posted on 11-07-2022 09:19 AM
name.name is the company standard, anything not that would be non standard.
Posted on 11-06-2022 09:15 PM
You can use EA with script to find all the local users and match your criteria and report it back. Create smart group with criteria.
#!/bin/bash
list=()
for username in $(dscl . list /Users UniqueID | awk '$2 > 500 && $2 < 1000 { print $1 }'); do
if [[ $(dsmemberutil checkmembership -U "${username}" -G admin) != not ]]; then
if [ ${username} does notmatches criteria ]; then #### add your criteria here in the if statement
list+=("${username}")
fi
fi
done
echo "<result>${list[@]}</result>"
Thanks