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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing ALL users that have admin authority?

Status
Not open for further replies.

sparkbyte

Technical User
Sep 20, 2002
879
US
I have been looking for a way to get a list of all users, locan and domain, that have admin priv's on our servers but have not been able to locate a script to do this. I know I must not be searching correctly because this is a common required task and there "must" be something out there that I could use as a starting point.

Thanks!!

Thanks

John Fuhrman
Titan Global Services
 
you will need to do a recursive search through the members of the administrators group on each box.

there is an ADS.dll knocking around which might make like easier
 
You could run net localgroup against each of your member servers. For DCs you just need to look at the Domain Admins group to see who has membership since there is no local admin group.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Hi sparkbyte,

This might do what I think you are looking for.

Code:
Option Explicit

Main()

Sub Main
	Dim strComputer : strComputer = "."
	Dim strGroupName : strGroupName = "Administrators"
	GetGroupMembers GetObject("WinNT://" & strComputer & _
					"/" & strGroupName & ",Group")
End Sub

Sub GetGroupMembers(objGroup)
	Dim objGrpMember
	For Each objGrpMember In objGroup.Members
		Select Case UCase(objGrpMember.Class)
			Case "USER"
				WScript.Echo Replace(Replace(objGrpMember.ADSPath, "WinNT://", ""), "/", "\")
			Case "GROUP"
				GetGroupMembers GetObject(objGrpMember.ADSPath)
		End Select
	Next
End Sub

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top