Re: Reading and Writing to a Text file
anonymous_at_discussions.microsoft.com
Date: 04/28/04
- Previous message: Jeff Cochran: "Re: Change DNS on NT 4.0"
- In reply to: Al Dunbar [MS-MVP]: "Re: Reading and Writing to a Text file"
- Next in thread: Al Dunbar [MS-MVP]: "Re: Reading and Writing to a Text file"
- Reply: Al Dunbar [MS-MVP]: "Re: Reading and Writing to a Text file"
- Reply: Spyke: "Re: Reading and Writing to a Text file"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 13:55:07 -0700
I have accomplished my task. I am running into a problem
though. After my script runs it puts information into a
text file. Example of the info:
CN=Hall\, Ronald,OU=0001,OU=Florida,OU=Car,DC=car,DC=com
CN=Johnson\, George,OU=0019,OU=Texas,OU=Car,DC=car,DC=com
What I am wanting to do is strip everything out and just
leave last name, first name in my text file. I have
looked at functions such left, right, mid, len, etc but
am unable to accomplish this.
anybody have any ideas?
>-----Original Message-----
>
><anonymous@discussions.microsoft.com> wrote in message
>news:5a0d01c42d44$8d7f6920$a001280a@phx.gbl...
>> I am trying to write a script that will return a list
of
>> Group members for multiple groups. I am declaring a
>> variable GROUP and passing it into the LDAP line. I
want
>> to read in each group from a text file and output the
>> members to a text file.
>>
>> Here is my script in progress.
>
>Be sure to let us know when you either accomplish the
task, or run into a
>problem with it.
>
>/Al
>
>> DIM fso
>> DIM dL
>> DIM group
>> DIM SInFile
>> DIM oTextFile
>>
>> 'On Error Resume Next
>>
>>
>> sInFile = "C:\temp\DL\DL.txt"
>> set fso = CreateObject("Scripting.FileSystemObject")
>> Set oTextFile = fso.OpenTextFile(sInFile, ForReading,
>> true)
>>
>> Do Until oTextFile.AtEndOfStream
>> sNextLine = Trim(oTextFile.ReadLine)
>> If sNextLine <> "" Then
>> 'wscript.Echo "Name: " & sNextLine
>>
>> Set objGroup = GetObject _
>> ("LDAP://cn=Group,ou=Distribution
>> Lists,ou=fss,dc=car,dc=com")
>> objGroup.GetInfo
>>
>> arrMemberOf = objGroup.GetEx("member")
>>
>> set fso = CreateObject("Scripting.FileSystemObject")
>> Set dL = fso.CreateTextFile("C:\Documents and
>> Settings\butter\Desktop\dL.txt", true)
>>
>> For Each strMember in arrMemberOf
>> dL.writeline strMember
>> Next
>> End IF
>> Loop
>>
>
>
>.
>
- Previous message: Jeff Cochran: "Re: Change DNS on NT 4.0"
- In reply to: Al Dunbar [MS-MVP]: "Re: Reading and Writing to a Text file"
- Next in thread: Al Dunbar [MS-MVP]: "Re: Reading and Writing to a Text file"
- Reply: Al Dunbar [MS-MVP]: "Re: Reading and Writing to a Text file"
- Reply: Spyke: "Re: Reading and Writing to a Text file"
- Messages sorted by: [ date ] [ thread ]