Re: Rights on computer objects through AD
- From: "Solo" <solo*remove*weap@xxxxxxxxxxx*remove*>
- Date: Thu, 30 Mar 2006 22:13:36 +0100
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
.
- References:
- Rights on computer objects through AD
- From: Solo
- Re: Rights on computer objects through AD
- From: Chris Malone
- Re: Rights on computer objects through AD
- From: Solo
- Re: Rights on computer objects through AD
- From: Tim.Olsen
- Re: Rights on computer objects through AD
- From: Solo
- Re: Rights on computer objects through AD
- From: Tim.Olsen
- Rights on computer objects through AD
- Prev by Date: Problems after demoting DC's
- Next by Date: Re: Problems after demoting DC's
- Previous by thread: Re: Rights on computer objects through AD
- Next by thread: Adprep /forestprep failed x500uniqueIdentifier attrubute value wrong
- Index(es):
Relevant Pages
|