What accounts/groups in Local Admin group

O

Olivier

Dear all,

For an audit I need to know (for a large number a servers) what
accounts/groups are member of the local administrator group. Is there a
simple way to create this list (a script for example)? If so, how?

Any help would be highly appreciated.

O.
 
S

S. Pidgorny

"net localgroup [name]" lists members - that's a command line.

Local group access from scripts - standard winnt: provider:

http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan08/hey0107.mspx


--
Svyatoslav Pidgorny, MS MVP - Security, MCSE
-= F1 is the key =-

* http://sl.mvps.org * http://msmvps.com/blogs/sp *

"Olivier" <Olivier@discussions.microsoft.com> wrote in message
news:409F97BD-D0F4-4C88-B525-0564E8BF83A3@microsoft.com...
> Dear all,
>
> For an audit I need to know (for a large number a servers) what
> accounts/groups are member of the local administrator group. Is there a
> simple way to create this list (a script for example)? If so, how?
>
> Any help would be highly appreciated.
>
> O.
 
M

Masterplan

Hi Olivier,

I solved this problem with a logon script. This script puts in a shared
folder named public a .txt file with the computer name and users which are in
the local administrators group and are not domain admins or administrator:

Option Explicit
Const ForAppending = 8
Dim objGroup, strComputer, objMember, WshNetwork, objRecordSet, objFSO,
objFile, strFileName

strComputer = "."
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
For Each objMember In objGroup.Members
If objMember.Name <> "Administrator" and objMember.Name <> "Domain Admins"
Then

Set objFSO = CreateObject("Scripting.FileSystemObject")
strFileName = "C:\Public\" & WshNetwork.ComputerName & ".txt"
Set objFile = objFSO.OpenTextFile(strFileName, ForAppending, True)
objFile.WriteLine (objMember.Name)
objFile.Close
End If

Next

Hope this is what you're looking for!

"Olivier" wrote:

> Dear all,
>
> For an audit I need to know (for a large number a servers) what
> accounts/groups are member of the local administrator group. Is there a
> simple way to create this list (a script for example)? If so, how?
>
> Any help would be highly appreciated.
>
> O.
 
Back
Top Bottom