none
Local Admin group members - Rajendra prasad.Anumolu RRS feed

  • Question

  • With CreateObject("Scripting.FileSystemObject")
      Set inFile = .OpenTextFile("c:\comps.txt")
      Set objLogFile = .OpenTextFile("c:\output.log", 8, True, 0)
    End With

    Do Until inFile.AtEndOfStream
      computer = inFile.ReadLine
      objLogFile.WriteLine "************************************************************" _
      & vbNewLine & computer
      With GetObject("WinNT://" & computer & "/Administrators,Group")
        objLogFile.WriteLine vbTab & .Name
        For Each objUser in .Members
          objLogFile.WriteLine vbTab & vbTab & objUser.Name
        Next
      End With
    Loop
    objLogFile.close
    WScript.Echo "Done"


    rajendra prasad.Anumolu
    Wednesday, November 30, 2011 4:13 PM

Answers

  • While this might be a useful script - you really should add commentary to describe:

    • What kind of script it is
    • The script's purpose
    • The files "comps.txt" and "output.log"
    • How it is run and what to expect

    Would you please share this?  Thank you.

    Kevin


    Kevin Remde US DPE - IT Evangelism - Microsoft Corporation http://blogs.technet.com/kevinremde http://twitter.com/kevinremde
    • Marked as answer by Kevin Remde Sunday, December 11, 2011 1:53 PM
    Thursday, December 1, 2011 1:53 PM

All replies

  • While this might be a useful script - you really should add commentary to describe:

    • What kind of script it is
    • The script's purpose
    • The files "comps.txt" and "output.log"
    • How it is run and what to expect

    Would you please share this?  Thank you.

    Kevin


    Kevin Remde US DPE - IT Evangelism - Microsoft Corporation http://blogs.technet.com/kevinremde http://twitter.com/kevinremde
    • Marked as answer by Kevin Remde Sunday, December 11, 2011 1:53 PM
    Thursday, December 1, 2011 1:53 PM
  • interesting..
    Guowen Su
    Cisco Certified Network Associate
    Cisco Certified Internetwork professional - MPLS
    Certified Information Systems Security Professional
    Microsoft Partner Network 2011
    Microsoft Certified Professional
    Microsoft Certified Systems Administrator:Security
    Microsoft Certified Systems Engineer: Security
    Microsoft Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows 7, Configuring
    Microsoft Certified IT Professional: Enterprise Administrator
    Microsoft Certified IT Professional: Server Administrator
    Certified Ethical Hacker
    Computer Hacking Forensics Investigator
    http://www.microsoft.com/en/sg/default.aspx Our Goal? VERY SATISFIED
    Wednesday, December 7, 2011 6:18 AM