Guest Olivier Posted June 16, 2008 Posted June 16, 2008 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. Quote
Guest S. Pidgorny Posted June 17, 2008 Posted June 17, 2008 "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" 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> Quote
Guest Masterplan Posted June 18, 2008 Posted June 18, 2008 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> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.