1.

Solve : Redirect dsget to file?

Answer»

Hi peeps

I'm hoping you can help me.
I'm a tech with 10+ yrs experience so am not new to DOS batch programming but this one is CONFUSING the $^% out of me!

I am trying to run a dsget through a batch file which will send the output to a file, simple you'd think.

I test the command in dos (dsget user cn=%username%,OU=USERS,ou=our ou,dc=our dc,dc=intranet -email > c:\email.txt) and all works fine. The right info is sent to the file.
However, when I put this into a batch file the file is empty, anything which MAY have been in there is wiped out so I know the file is being modified but the output from the command is not there.

I have tried modifying the command to 1> (though whether the 1 is in the batch file or not it is shown on screen) or >> to APPEND but the result is the same, the file is empty.

I have tried various quotes in various places to see if it is a spacing issue but again with no joy.

Has anyone tried this before, has anyone managed to get it working? Can anyone help me?
I don't fancy visiting 500+ users to run it manually and lets face it, what's the chance of them doing it themselves?!!?

Many thanks in advance.

Mattyou could try prefix all comas "," with escape char "^"
so, your batchfile should be this :
-------------------
dsget user cn=%username%^,ou=users^,ou=our ou^,dc=our dc^,dc=intranet -email > c:\email.txt
-------------------
hope this work
Hi Fen_Li

Thanks for the suggestion but unfortunately no joy.

Matt



Discussion

No Comment Found