Skip to main content
Question

Report of all Local User Accounts in computer


Forum|alt.badge.img+5

We are trying to determine which computers are being shared in the company and to do so we need to know how many users there are per machine. Is there a way to report how many local user accounts per computer we have and list them? I tried some reports, scripts, etc but they only show me lastuser or duplicate computers with the same user. Thanks

6 replies

Forum|alt.badge.img+16
  • Honored Contributor
  • 330 replies
  • January 18, 2023

You may actually be able to take advantage of some Jamf Connect extension attributes for this goal even if your environment isn't deploying Jamf Connect.  The one below will show you all the local accounts that are not using Jamf Connect.  Combine that with some regex filtering and you should be able to track down any machine with more than one local user account.
https://github.com/jamf/jamfconnect/blob/main/additional_extension_attributes/Look%20for%20Unmigrated%20Users.sh 


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 33 replies
  • January 18, 2023
McAwesome wrote:

You may actually be able to take advantage of some Jamf Connect extension attributes for this goal even if your environment isn't deploying Jamf Connect.  The one below will show you all the local accounts that are not using Jamf Connect.  Combine that with some regex filtering and you should be able to track down any machine with more than one local user account.
https://github.com/jamf/jamfconnect/blob/main/additional_extension_attributes/Look%20for%20Unmigrated%20Users.sh 


Actually, we are using JAMF Connect! It's not on all of our computers yet tho.
Nice I'll take a look


Forum|alt.badge.img+7
  • Valued Contributor
  • 76 replies
  • January 19, 2023

You could also use an extension attribute for this, I believe. 


Forum|alt.badge.img+10
  • Valued Contributor
  • 108 replies
  • January 19, 2023

@Frank_Sonder , take a look at this thread: https://www.jamf.com/jamf-nation/discussions/18106/creating-smart-group-for-number-of-local-user-accounts.

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

You can use this for an Extension Attribute.


spesh
Forum|alt.badge.img+8
  • Jamf Heroes
  • 24 replies
  • March 29, 2023
joethedsa wrote:

@Frank_Sonder , take a look at this thread: https://www.jamf.com/jamf-nation/discussions/18106/creating-smart-group-for-number-of-local-user-accounts.

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

You can use this for an Extension Attribute.


This works great, thank you! Only tidbit to mention is when using this as an Extension Attribute, I initially had the output set to String. Found it best to have the output set to integer due to the wc -l command that way you can set the EA criteria to "greater than". 


Forum|alt.badge.img+13
  • Valued Contributor
  • 277 replies
  • September 26, 2023
McAwesome wrote:

You may actually be able to take advantage of some Jamf Connect extension attributes for this goal even if your environment isn't deploying Jamf Connect.  The one below will show you all the local accounts that are not using Jamf Connect.  Combine that with some regex filtering and you should be able to track down any machine with more than one local user account.
https://github.com/jamf/jamfconnect/blob/main/additional_extension_attributes/Look%20for%20Unmigrated%20Users.sh 


We use this script in our jamf connect environment, the intent is to use it to remove the jamf connect sign in post sign in so other users can't sign in against jamf connect on the same device, so the sign in is individualised, however the dscl value OIDCProvider is not added if the account was pre existing to having jamf connect connected.

Say if the device was installed with jamf connect with the existing user being the same credentials to the jamf connect account signed in. or if in abyss environment the first setup user is a mirror of credentials of the jamf connect account that would be created on sign in. Do you know if there is another location source of information for ?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings