Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to show all Local Administrators in Domain

Status
Not open for further replies.

Daveyd123

MIS
Joined
Aug 25, 2004
Messages
413
Location
US
We are a XP/2003 AD Domain. I would like to know what users are members of the local administrators group on each of the 500+ PCs in our Domain.

Are there any scripts to do that?
 
Do a google search for EZADScriptomatic

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
if you have access to a logonscript i would go with that way. when a user logs on then bind to the administrators groups, check out the WinNT provider
 
I am a scripting n00b so bear with me. I do have a logon script I use via a GPO

I'm not sure how to "bind" to the local admin group.
 
have a search on the forum for GetObject("WinNT:
you are looking for something like

Set objAdmin = GetObject("WinNT://" & strComputerName & "/Administrators,group")
For Each aMember In objAdmin.Members
Wscript.Echo aMember.Name
Next

you will need to sort out strComputerName, from something like WshShell.ExpandEnvironmentStrings("%computername%")

then you will need to sort some logging out
Set tsLog = FSO.OpenTextFile("\\serverA\audit$\admins\" & strComputerName & ".log", 8, True)
tsLog.WriteLine..... aMember.Name etc

anyway, i think this should get you started.
try and write something and see how you get on, post back if you have probs or want someone to give you some pointers on style
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top