VBS output to text

210 pts.
Tags:
VBScript
VBScript Functions
VBScript Statements
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following