Can I see who is a local admin on their machine?
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
Answers (3)
Please log in to answer
Posted by:
dugullett
10 years ago
Create a custom inventory rule.
ShellCommandTextReturn(cmd.exe /c net localgroup Administrators)
Comments:
-
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) - JF524 10 years ago
Posted by:
SMal.tmcc
10 years ago
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.
Comments:
-
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. - JF524 10 years ago-
see new answer for picture of one machine and html report - SMal.tmcc 10 years ago
-
can you please share your macro with me - brighstarcuit 10 years ago
-
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. - SMal.tmcc 10 years ago