Creating Smart Group for number of Local User Accounts

Dwetzel94
New Contributor

I am looking to identify shared computers by creating a smart group that detects more than 4 local user accounts. It is not a sure fire way to know if they are shared but that works for us.

My idea is that the smart computer group criteria is "computers with more than 4 local user accounts"

Is this possible?

4 REPLIES 4

mm2270
Legendary Contributor III

Unfortunately, the criteria labeled "Local User Accounts" does not offer a count option. It can only be used to locate machines that have this or that local account on them. I don't think there is a native criteria option for this, so you may need to put together an Extension Attribute, then give it some time for your Macs to submit inventory back to the JSS.
If you need help with an Extension Attribute script for this, just holler.

Dwetzel94
New Contributor

Will do. Thanks @mm2270

matt4836
Contributor II

All Local Accounts

#!/bin/sh
echo "<result>$(dscl . list /Users | wc -l | sed 's/^ *//g')</result>"

All Accounts Above 500

#!/bin/sh
echo "<result>$(dscl . list /Users UniqueID | awk '$2>500{print $1}' | wc -l | sed 's/^ *//g')</result>"

seansb
New Contributor III

I know this is an old thread, but if you've stumbled across it and this is something you'd like to see:

Number of Local Users Searchable Criteria