Re: Rights on computer objects through AD

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for your help

much appreciated

S.

"Tim.Olsen" <TheBTG@xxxxxxxxx> wrote in message
news:1143732704.904278.119900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here you go... be careful with line wrap when you paste it into your
editor.


'Lists local admins
' requires ComputerNamelist.txt : a list of computers one per line, no
blank lines, no trailing spaces.
' creates FindUserinLocalAdmins.txt a list of all the admins on each
machine in Computernamelist.txt
'
' With appologies to Chris Malone, the original author.

On error resume next
const ForReading = 1, ForWriting = 2, ForAppending = 8

set oShell = CreateObject("wscript.shell")
set oFSO = CreateObject("Scripting.FileSystemObject")
set OutputFile = oFSO.CreateTextFile("FindUserinLocalAdmins.txt", TRUE)
set InputFile = oFSO.OpenTextFile("ComputerNameList.txt",ForReading)

'read the inputfile in it's entirety, convert it into an array
ListofMachines = split(inputfile.readall, vbcrlf)

For each strComputername in ListofMachines
'see if the machine is ~online:
Set objWMIService = GetObject("winmgmts:\\" & strComputername &
"\root\cimv2")
If err.number <> 0 Then
'it's not available so log it. the first line logs to a file, the
second the screen.
OutputFile.Writeline "Error connecting to WMI on " &
strComputername
wscript.stdout.writeline "Error connecting to WMI on " &
strComputername
Else
OutputFile.Writeline strComputername & " Administrators:"
wscript.stdout.writeline strComputername
'use the ADSI WinNT provider to connect to the machines admin
group.
Set oGroup = GetObject("WinNT://" & strComputername &
"/Administrators,group")
'dump out each admin name
For Each member In oGroup.members
OutputFile.Writeline vbtab & member.Name
wscript.stdout.writeline vbtab & member.Name
Next
End If
Next



.



Relevant Pages

  • Re: A smarter mergemaster
    ... I just couldn't decide between the two lists because I thought ... the admins will be responsible for the massive destruction ... > I'm inclined to alter this to hide the pauses behind an expert mode flag, ... is one of the reason I request pre-commit approval. ...
    (freebsd-hackers)
  • Re: Is there a way to Hide the Actions Link on the left side (more)
    ... SharePoint does provide security trimming for administration links if that helps at all for your client. ... everyone except Admins of SPS. ... you allow users to add to LISTS to respond to surveys etc... ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Rights on computer objects through AD
    ... 'Lists local admins ... For each strComputername in ListofMachines ... OutputFile.Writeline vbtab & member.Name ...
    (microsoft.public.win2000.active_directory)
  • Re: Removed Posts
    ... I admin several Surname lists and they aren't removed by Rootsweb. ... by the overzealous list-admins who are uptight about their own rules for ... admins take *ANY* conflict at all, about anything, as a reason to suppress you. ...
    (soc.genealogy.medieval)