tonyflora63
MIS
Hi
I'm trying to get the attributes from the sub trees of an AD container. Is there a way that you could pass a CN from a txt file as a variable. Here is my code so far:
DIM fso, TxtFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set TxtFile = fso.CreateTextFile("EA-Computers.txt", True)
'Enumerate Computer GUID's
Set objOU = GetObject("LDAP://mtb0120vledepii:389/ou=EncryptionAnywhereComputers,dc=ede,dc=irs,dc=gov")
For Each objUser in objOU
TxtFile.WriteLine (ObjUser.Name)
Next
TxtFile.Close
'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
'open the data file
Set oTextStream = oFSO.OpenTextFile("EA-Computers.txt")
'make an array from the data file
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close
For Each strComputer In RemotePC
'Do something useful with strComputer here
Set obj = GetObject("LDAP://mtb0120vledepii:389/OU=EncryptionAnywhereComputers,DC=EDE,DC=irs,DC=gov")
Wscript.Echo obj.Get("ea-ComputerName")
Next
I need the variable to be plugged in before
OU=EncryptionAnywhereComputers,DC=EDE,DC=irs,DC=gov")
I've tried this but no luck:
dim CN
CN = strcomputer
I'm trying to get the attributes from the sub trees of an AD container. Is there a way that you could pass a CN from a txt file as a variable. Here is my code so far:
DIM fso, TxtFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set TxtFile = fso.CreateTextFile("EA-Computers.txt", True)
'Enumerate Computer GUID's
Set objOU = GetObject("LDAP://mtb0120vledepii:389/ou=EncryptionAnywhereComputers,dc=ede,dc=irs,dc=gov")
For Each objUser in objOU
TxtFile.WriteLine (ObjUser.Name)
Next
TxtFile.Close
'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
'open the data file
Set oTextStream = oFSO.OpenTextFile("EA-Computers.txt")
'make an array from the data file
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close
For Each strComputer In RemotePC
'Do something useful with strComputer here
Set obj = GetObject("LDAP://mtb0120vledepii:389/OU=EncryptionAnywhereComputers,DC=EDE,DC=irs,DC=gov")
Wscript.Echo obj.Get("ea-ComputerName")
Next
I need the variable to be plugged in before
OU=EncryptionAnywhereComputers,DC=EDE,DC=irs,DC=gov")
I've tried this but no luck:
dim CN
CN = strcomputer