Find out which accounts have local administrative rights on each PC

Started by Hilton

Can we run the NetScanner to see which accounts have local administrative rights on the PCs?
Can it pull the contents of the "Administrators" group per PC?
SoftPerfect Support forum - Ann avatar image
Ann

Re: Find out which accounts have local administrative rights on each PC   14 May 2022, 12:10

Yes, Remote Groups - Members of a local group should work for the local PC as well:

SoftPerfect support forum
I found it, but I have a recurring problem, even before turning this option on. The Scanner can find all PCs, but is having a consistent hard time to pull some of the information. The first 4 columns are usually fine (IP address, MAC address, Response tome, and Host name). After those, it is just a few that get the details in full.

Any suggestions on what to do on the PCs or the application to improve this? Any idea on what should I check?
All PCs are Windows 10 and should have the same basic configuration.
SoftPerfect Support forum - Ann avatar image
Ann

Re: Find out which accounts have local administrative rights on each PC   18 May 2022, 10:04

It is hard to tell what's causing this in your case. This particular feature merely calls a Windows API function NetLocalGroupEnum, and for some reason it fails on many of your machines. We could add some code to display what error it returns, but it will likely return something like 'access is denied' without an explanation why.

If you have WMI enabled and working on your computers, you could instead execute this VBScript under Options - Remote Scripting. It simply connects to each computer's WMI system and executes a couple of queries to get local administrators.

'Input parameters
strComputer = Input.Current

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

'Get computer name
Set colItems = objWMIService.ExecQuery("Select Name from Win32_ComputerSystem")

If colItems.Count = 0 Then
  Output.Write "No name assigned"
Else
  For Each objItem in colItems
    'Get admins on that computer
    Set colUsers = objWMIService.ExecQuery("ASSOCIATORS OF {Win32_Group.Domain='" & objItem.Name & "',Name='Administrators'} WHERE AssocClass=Win32_GroupUser")
    For Each objUser in colUsers
      Output.Write objUser.Name
    Next
  Next
End If

SoftPerfect support forum

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **     **  **    **  **     **  ********   **     ** 
 **     **   **  **    **   **   **     **  **     ** 
 **     **    ****      ** **    **     **  **     ** 
 **     **     **        ***     **     **  **     ** 
  **   **      **       ** **    **     **  **     ** 
   ** **       **      **   **   **     **  **     ** 
    ***        **     **     **  ********    *******  

Message: