Jump to content

List Computer In Ad


ioliver
 Share

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
  objFSO.DeleteFile("C:\ADComputers.csv")
End If
Set txtOutput = objFSO.CreateTextFile ("C:\ADComputers.csv")

On Error Resume Next

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

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.

Ian

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...