Jump to content

What accounts/groups in Local Admin group


Recommended Posts

Guest Olivier
Posted

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.

  • Replies 2
  • Created
  • Last Reply
Guest S. Pidgorny
Posted

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

 

Local group access from scripts - standard winnt: provider:

 

http://www.microsoft.com/technet/scriptcen...08/hey0107.mspx

 

 

--

Svyatoslav Pidgorny, MS MVP - Security, MCSE

-= F1 is the key =-

 

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

 

"Olivier"

  1. wrote in message

news:409F97BD-D0F4-4C88-B525-0564E8BF83A3@microsoft.com...<span style="color:blue">

> 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. </span>

Guest Masterplan
Posted

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:

<span style="color:blue">

> 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.</span>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...