210 pts.
 VBS output to text
How do I change this code to: instead of poping up a window, to output the results to a text file?

''create a connection object set connObj = CreateObject("ADODB.Connection")

''create a command object set cmdObj =   CreateObject("ADODB.Command")

''set the properties connObj.Provider = "ADsDSOObject" connObj.Open "Active Directory Provider" set cmdObj.ActiveConnection = connObj cmdObj.Properties("Page Size") = 25

''create the LDAP query for your domain - userAccountCountrol with a value of 2 = disabled cmdObj.CommandText = "<LDAP://dc=abc,dc=main>;(&(objectCategory=User)(userAccountControl:1.2.840.113556.1.4.803:=2));Name;Subtree" ''execute the query set rsObj = cmdObj.Execute

''place the cursor at the first record and loop over the records until we hit the end of file marker rsObj.MoveFirst do until rsObj.EOF     Wscript.Echo rsObj.Fields("Name").Value     rsObj.MoveNext loop



Software/Hardware used:
ASKED: March 2, 2012  10:30 PM
UPDATED: March 5, 2012  2:51 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. Michael Tidmarsh   14,030 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _