Sign in to follow this  
Followers 0
Naveed

StdoutRead convert output to list

2 posts in this topic

Hi Peeps,

First of all here is what i am currently trying to do. I am using the dsget command to get information from the active directory for a security group or computer.

However the information returned from stdoutread is a long list and i dont know how to take this list and display in a gui window list?

I suppose i could try and include a loop system which uses the string commands but that would be very longwinded, which is why i need some help with this.

Here is the code i am using.

#include <Constants.au3>

$securitygroup = "SecurityGroup"

Local $foo = Run(@ComSpec & " /c " & "dsget group " & '"cn=' & $securitygroup & ',ou=global groups,dc=test,dc=com,"' & " -members -expand", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

Local $line
Sleep(2000)

While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
MsgBox(0, "STDOUT read:", $line)
Wend

While 1
    $line = StderrRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

And here is what the output looks like (see output.bmp)

Any ideas?

Output.bmp

Share this post


Link to post
Share on other sites



That's the awkward hard way to do it. Why not just use the COM interface to ADSI? There is a whole AD UDF (more than one actually) based on that. You can simply get the data without trying to tease it out of STDOUT.

:blink:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0