Sortir resultat script txt

Sortir resultat script txt - VB/VBA/VBS - Programmation

Marsh Posté le 25-10-2007 à 13:45:25    

Bonjour à tous,
 
Le script ci-dessous me sort le résultat de la requête en messagebox or je voudrais le sortir dans un fichier .txt ou mieux .csv
 
 
On Error Resume Next
 
Set objGroup = GetObject _
  ("LDAP://cn=xxx,ou=xxxx,ou=xxx,dc=xxx,dc=xxx" )
objGroup.GetInfo
 
arrMemberOf = objGroup.GetEx("member" )
 
WScript.Echo "Members:"
For Each strMember in arrMemberOf
    WScript.echo strMember
Next
 
 
 
Merci de votre aide  :)


---------------
We must fight, injustice system ; have no right, injustice system
Reply

Marsh Posté le 25-10-2007 à 13:45:25   

Reply

Marsh Posté le 25-10-2007 à 16:47:27    

Ajouter les lignes de couleurs :
 
On Error Resume Next  
   
Set objGroup = GetObject _  
  ("LDAP://cn=xxx,ou=xxxx,ou=xxx,dc=xxx,dc=xxx" )  
objGroup.GetInfo  
   
arrMemberOf = objGroup.GetEx("member" )  
 
Set fso = CreateObject("Scripting.FileSystemObject" )  
Set f = fso.OpenTextFile("toto.txt", 2,True)  
 
WScript.Echo "Members:"  
For Each strMember in arrMemberOf  
    WScript.echo strMember  
    f.Write strMember  
Next  
 
f.Close


Message édité par olivthill le 25-10-2007 à 16:48:55
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed