/build/static/layout/Breadcrumb_cap_w.png

Systems Management Question


Inventory rule to see who is a member of the Local Administrator group

04/30/2019 354 views

Is there a way for us to see who is part of the local administrators group on devices?

0 Comments   [ + ] Show comments

Comments


All Answers

0

I've got Custom Inventory Rules, for Windows, Linux and Mac. These were setup by the trainer when we purchased KACE.


Local Administrators Listing - Windows (CIF)

ShellCommandTextReturn(cmd /c net localgroup Administrators)


Local Administrators Listing - Linux (CIF)

ShellCommandTextReturn(grep wheel /etc/group | sed 's/^.*:root,//')


Local Administrators Listing - Mac (CIF)

ShellCommandTextReturn(dscl . -read /Groups/admin GroupMembership | sed 's/GroupMembership: root //' | sed 's/ / | /g')

Answered 04/30/2019 by: PaulGibson
Senior Yellow Belt

  • you need to be language sensitive on windows
    If your system is german or italian you need the matching administrators group name

    and i would add this to strip the text from result and just list the members
    this is for german Windows OS language but you get the idea to strip the text

    ShellCommandTextReturn(cmd /q /c for /f "tokens=* skip=6" %a in ('net localgroup administratoren ^| find /V "Der Befehl wurde erfolgreich ausgeführt."') do echo %a)

    This would be the output in the custom inventory rule field
    1) #Local_Admins_DE:
    Administrator
    BTM2000\Domänen-Admins
    BTM2000\Exchange Trusted Subsystem
    BTM2000\Organization Management
    [Zeichenfolge]
    • Is there a way to filter the output to exclude certain accounts?