Jump to content
Sign in to follow this  

List Computer In Ad

Recommended Posts

I've got a script that creates a list of computers in my Active Directory, but I worte it in VBS.

' List Computers in AD
' July 16, 2004

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

Dim objDomain   'ADSI Domain object
Dim objComputer 'ADSI Computer object
Set objDomain = GetObject("WinNT://DomainName")
objDomain.Filter = Array("computer")

If objFSO.FileExists("C:\ADComputers.csv") = True Then
End If
Set txtOutput = objFSO.CreateTextFile ("C:\ADComputers.csv")

On Error Resume Next

For Each objComputer In objDomain
  strComputer = objComputer.Name
  txtOutput.Writeline strComputer

WScript.Echo "Done!"

Any ideas on how to Access AD from AutoIT? It's nothing that I need to do, I just wanted to try.


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...