I am wondering if it is possible to see, through the inventory, if a user is a local admin of thier machine?

Is this possible? I've done a lot of poking around on the inventory pages but no luck.

Thanks,

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

5

Create a custom inventory rule.

ShellCommandTextReturn(cmd.exe /c net localgroup Administrators)
Answered 01/27/2014 by: dugullett
Red Belt

  • Thanks. I found something very similar. Do you know what the differece between your script and the one I found is?

    It is: ShellCommandTextReturn(net.exe localgroup administrators)
    • Not sure. I just know that's the one I'm using, and it works.
      • OK. Mine seems to be working.

        Did it take some time for your report to full propagate? It seems like an item is only being added when the agent checks in...
      • Yes it will run that rule on next agent check in.
    • it does the same. cmd /c runs a new cmd-instance to get the info, if you run net localgroup ... directly this may fail sometimes.
Please log in to comment

Answers

2

The version of the kbox determines if you can call the command direct or need the cmd command.  Prior to 5.5 you could use ShellCommandTextReturn(net.exe localgroup administrators).

I export my list to a csv and run a macro that deletes the garbage out so I end up with a clean spreadsheet to give to the helpdesk.

Answered 01/27/2014 by: SMal.tmcc
Red Belt

  • Sounds good - thanks!

    Do you know if it is possible to find see local groups/ users set as admin from the inventory tab?

    I want to be able to go to Inventory, Select a machine, and see all of the local users on that machine and whether or not they are admin. I like the idea of having the entire list, but it would be more useful from the Inventory Information section.
    • see new answer for picture of one machine and html report
  • can you please share your macro with me
    • I run two macro's one to cleanup and one to remove approved admin accounts. I run the first and scan the sheet to make sure someone has not deleted or disabled our TMCC admin accounts. Users are admins on their laptops so they could do this. Then I run the second macro after that. You can use the "Record Macro" function to create these. Practice what you want once before you record so you know the steps in your head, the record function is not forgiving for mistakes. It is easier to start over then try to edit unless you know excell macro language.

      The starting string come from kace in csv format like this:

      Alias name administrators\n\nComment Administrators have complete and unrestricted access to the computer/domain\n\n\n\nMembers\n\n\n\n-------------------------------------------------------------------------------\n\nAdministrator\n\ndfault\n\nTMCCADMN\Desktop Local Admins\n\nTMCCADMN\Domain Admins\n\nTMCCADMN\Domain Users\n\nTMCCADMN\ITO PC Admins\n\nThe command completed successfully.\n\n\n\n

      Then I run this cleanup macro:

      Sub Cleanup()
      '
      ' Cleanup Macro
      ' cleans up extra text from export
      '
      ' Keyboard Shortcut: Ctrl+c
      '
      Cells.Replace What:= _
      "Alias name administrators\nComment Administrators have complete and unrestricted access to the computer/domain\n\nMembers\n\n-------------------------------------------------------------------------------\n\n" _
      , Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:= _
      False, SearchFormat:=False, ReplaceFormat:=False
      Range("B1").Select
      ActiveCell.FormulaR1C1 = _
      "Alias name administrators\nComment Administrators have complete and unrestricted access to the computer/domain\n\nMembers\n\n-------------------------------------------------------------------------------\n0\nAdministrator\ndfault\nTMCCADMN\Desktop Local Admins\nTMCCADMN\Domain Admins\nTMCCADMN\ITO PC Admins\nThe command completed successfully.\n\n"
      Cells.Replace What:= _
      "Alias name administrators\nComment Administrators have complete and unrestricted access to the computer/domain\n\nMembers\n\n-------------------------------------------------------------------------------" _
      , Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:= _
      False, SearchFormat:=False, ReplaceFormat:=False
      Cells.Replace What:="\nThe command completed successfully.", Replacement:= _
      "", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
      SearchFormat:=False, ReplaceFormat:=False
      Cells.Replace What:="\n\n", Replacement:="", LookAt:=xlPart, SearchOrder _
      :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
      Cells.Replace What:="\n", Replacement:=" username ", LookAt:=xlPart, _
      SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
      ReplaceFormat:=False
      End Sub
      Sub names()
      '
      ' names Macro
      ' get rid of known names and groups
      '
      ' Keyboard Shortcut: Ctrl+n
      '
      Cells.Replace What:="username backup", Replacement:="", LookAt:=xlPart, _
      SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
      ReplaceFormat:=False
      Cells.Replace What:="username Administrator", Replacement:="", LookAt:= _
      xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
      ReplaceFormat:=False
      Cells.Replace What:="username dfault", Replacement:="", LookAt:=xlPart, _
      SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
      ReplaceFormat:=False
      Cells.Replace What:="username TMCCADMN\Desktop Local Admins", Replacement:= _
      "", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
      SearchFormat:=False, ReplaceFormat:=False
      Cells.Replace What:="username TMCCADMN\Domain Admins", Replacement:="", _
      LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
      False, ReplaceFormat:=False
      Cells.Replace What:="username TMCCADMN\ITO PC Admins", Replacement:="", _
      LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
      False, ReplaceFormat:=False
      End Sub


      The remove names I do as single names since they may not be in the same order always for each machine.
Please log in to comment
1

Answered 01/28/2014 by: SMal.tmcc
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity