Need Script to view who has local admin rights on domain xp pro workstations.

2003 Active Directory Domain.
Windows XP Professional workstations

Need to be able to run a script which shows the Local Administrator rights on each XP Pro workstation.

Thank you!
LVL 4
advserverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

johnb6767Commented:
Script to Collect Local Administrators Membership from List of Machines
http://briandesmond.com/blog/script-to-collect-local-administrators-membership-from-list-of-machines/

Popular answer here....
0
advserverAuthor Commented:
John,
Thank you very much for your post!  Sorry for the delay!  The client stated that they are looking for something like what is pasted below.  The code is almost complete but it needs the ability to write in the file over and over again.  Can you see what it is missing?


'create an instance of the Wscript Network object; using the (2) objects
Set objNetwork = CreateObject("Wscript.Network")

'set your strings
strComputer = objNetwork.ComputerName
strUser = objNetwork.UserName

'set variables for the write process
Dim Filesys, WriteFiletxt

Set Filesys = CreateObject("Scripting.FileSystemObject") 
Set WriteFiletxt = Filesys.CreateTextFile("c:\local-admin.txt", false)

'use the WinNT provider to bind to the Administrators group on the computer in question
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")

'set up For Each loop to walk through the group membership
For Each objUser in objGroup.Members
    If objUser.Name = strUser Then

'Write output to the text file listed above
     WriteFiletxt.WriteLine strUser & " Has Administrator Rights. "

 End If
Next

Open in new window

0
krishnasmtpport25Commented:
Hi,

Please find the Easy powershell to get the list computer in the given input txt file

http://powershellneedfulthings.blogspot.com/2009/03/audit-local-administrators-group-on.html

Regards,
Krishna
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

advserverAuthor Commented:
Thank you Krishna.

Do I put the workstations in the txt document instead of server names?  Also, will the workstations need Powershell installed on them?  Thank you!

0
advserverAuthor Commented:
Worked well enough for me.  Thank you very much!
0
krishnasmtpport25Commented:
Hi,

Yes, you can put Workstation name in place of desktop. You don't need to install powershell on the work stations.

Regards,
Krishna
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.