Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting Script Output 1

Status
Not open for further replies.

IAMINFO

MIS
Feb 21, 2002
62
US
Hello everyone I am trying to direct the output of this script to a file , it is currently going to the screen any help would be greatly appreciated. Thank You!!

Option Explicit

' Declare variables
Dim sDomain
Dim oDomain
Dim oComputer

' This string specifies the domain (change to suit your needs)
sDomain = "LDAP://cn=Computers,dc=testone,dc=local"

' Open the domain specified by sDomain
Set oDomain = GetObject(sDomain)

' Iterate through each computer in the domain
For Each oComputer In oDomain
' Display name and GUID text on the screen
WScript.Echo oComputer.Name & vbTab & oComputer.GUID
Next
 
Take a look at FileSystemObject.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Try invoking your script using:

CSCRIPT //nologo scriptname.vbs > logfile.txt

This will put all output in logfile.txt.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top