Scripting List of Local Administrators

  • Thread starter Thread starter Carl Hilton
  • Start date Start date
C

Carl Hilton

OK, I have seen quite a few scripts that list the names of members of Local
Administrators Groups on Workstations, however they do not list it in the
format of DOMAIN\NAME, just NAME. I need to see the SID resolved to
DOMAIN\NAME...What properties of ACCOUNT will give me that informaiton using
VBS? Where can I find this list of properties that are used in all these
scripts I have seen or better yet, there must be a script that I can pass an
object to that will returne the list of properties?



Thanks
 
Can you not simply insert "machine\" or "domain\" in the output? Since
you're script is doing the calling, it would seem to me to be the easiest
way to achieve this end.
 
Not if I have the same name in the group, but the SID is for different
domains. If I have several domains all with an admin id of HELPDESK. I want
to ensure that DOM1\HELPDESK, DOM2\HELPDESK and DOM3\HELPDESK are all
represented in the workstation's LOCAL ADMIN group. If I run the script as
is.. I might get HELPDESK, HELPDESK... Now, I know that there is one missing
but no way of knowing which domain is NOT represented.
 
As long as you don't need a script solution you can check out lg from my free
win32 tools page of www.joeware.net


[Wed 05/12/2004 15:04:09.30]
F:\DEV\cpp\SecData>adsiedit.msc

[Wed 05/12/2004 15:04:35.11]
F:\DEV\cpp\SecData>lg administrators

LG V01.01.00cpp Joe Richards ([email protected]) August 2002

USER : FASTMOFO\Administrator
USER : FASTMOFO\$jricha34
GROUP : JOE\Domain Admins
USER : FASTMOFO\jricha34
USER : FASTMOFO\joe
USER : JOE\$jricha34

6 members listed

The command completed successfully.


[Wed 05/12/2004 15:21:34.13]
F:\DEV\cpp\SecData>
 
"net localgroup administrators" doesn't already do this for you?

I don't know how to that in VBS, though I would bet that there's a way to
have your script use WMI to find out. Worst case scenario, you could use
the output from net localgroup.
 
Back
Top