find local administrator account 
Author Message
 find local administrator account

Help,

I'm trying to write a VBScript that will find all the local administrator
account on every computer in the domain (of course, computer need to be
power on). I've found a few hints in the archives but nothing that really
help me. I'm still trying to find a way to do it...

I'm looking for some feedback or maybe just being point in the right
direction.

Thanks in advance,
Rich



Mon, 28 Nov 2005 10:53:16 GMT  
 find local administrator account


Quote:
> Help,

> I'm trying to write a VBscript that will find all the local administrator
> account on every computer in the domain (of course, computer need to be
> power on). I've found a few hints in the archives but nothing that really
> help me. I'm still trying to find a way to do it...

> I'm looking for some feedback or maybe just being point in the right
> direction.

Hi,

The script below might work. It reveals nested group memberships. You could
skip that by removing the recursive call in the Subroutine.

Option Explicit
Dim objGroup, strComputer

strComputer = "cmptr01"

Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Wscript.Echo "Members of local Administrators group on computer " &
strComputer
Call EnumGroup(objGroup, "")

Sub EnumGroup(objGroup, strOffset)
  Dim objMember
  For Each objMember In objGroup.Members
    Wscript.Echo strOffset & objMember.Name & " (" & objMember.Class & ")"
    If objMember.Class = "Group" Then
      Call EnumGroup(objMember, strOffSet & "--")
    End If
  Next
End Sub

I can't get the above to work from one client to another. There may be a
registry setting that will permit this, as others have claimed it can be
done. For me it works from a client to a server only (or on the local
machine).

--
Richard
Microsoft MVP Scripting and ADSI
http://www.rlmueller.net
--



Tue, 29 Nov 2005 01:40:09 GMT  
 find local administrator account



Quote:



> > Help,

> > I'm trying to write a VBscript that will find all the local
administrator
> > account on every computer in the domain (of course, computer need to be
> > power on). I've found a few hints in the archives but nothing that
really
> > help me. I'm still trying to find a way to do it...

> > I'm looking for some feedback or maybe just being point in the right
> > direction.

> Hi,

> The script below might work. It reveals nested group memberships. You
could
> skip that by removing the recursive call in the Subroutine.

> Option Explicit
> Dim objGroup, strComputer

> strComputer = "cmptr01"

> Set objGroup = GetObject("WinNT://" & strComputer &

"/Administrators,group")

- Show quoted text -

Quote:
> Wscript.Echo "Members of local Administrators group on computer " &
> strComputer
> Call EnumGroup(objGroup, "")

> Sub EnumGroup(objGroup, strOffset)
>   Dim objMember
>   For Each objMember In objGroup.Members
>     Wscript.Echo strOffset & objMember.Name & " (" & objMember.Class & ")"
>     If objMember.Class = "Group" Then
>       Call EnumGroup(objMember, strOffSet & "--")
>     End If
>   Next
> End Sub

> I can't get the above to work from one client to another. There may be a
> registry setting that will permit this, as others have claimed it can be
> done. For me it works from a client to a server only (or on the local
> machine).

> --
> Richard
> Microsoft MVP Scripting and ADSI
> http://www.rlmueller.net
> --

Thanks a lot,

I'm going to "play" with this script

Rich



Tue, 29 Nov 2005 10:09:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Removing local Administrator account from Administrators group

2. Rename Local Administrator account

3. How can I add a Domain Account to the Local Administrators Group

4. Administrator Account (NT)

5. Script for rename account administrator

6. rename administrator account

7. Script that remotely moves local users from Administrators to Power Users group

8. VB script: adding AD group to local administrators group

9. add user to local win2k administrator group

10. VbScript and changing local administrator password

11. Adding domain groups to gthe local administrator group

12. Adding a domain group to local administrators group

 

 
Powered by phpBB® Forum Software