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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
krishnasmtpport25Connect With a Mentor Commented:
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
 
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
Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

 
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
All Courses

From novice to tech pro — start learning today.