How to get Local Admin accounts info using VB Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdfidahussain
    New Member
    • Oct 2007
    • 40

    How to get Local Admin accounts info using VB Script

    Hello Friends,

    Any help in how to get Local Administrators group accounts info using VB Script?

    Thnx

    FH
    Last edited by mdfidahussain; Nov 7 '07, 04:33 AM. Reason: Add on to the question
  • mdfidahussain
    New Member
    • Oct 2007
    • 40

    #2
    Thanks for all those have looking into this.....I got it....


    strComputer = "XXXXX"
    Set colGroups = GetObject("WinN T://" & strComputer & "")
    colGroups.Filte r = Array("group")
    For Each objGroup In colGroups
    For Each objUser in objGroup.Member s
    If objUser.name = "hgjhhgj" Then
    Wscript.Echo objGroup.Name
    End If
    Next
    Next

    Reference: http://www.activexpert s.com/activmonitor/windowsmanageme nt/adminscripts/usersgroups/localgroups/#EnumLocalUser. htm

    Comment

    Working...