Back Again,
Having mixed results here. I can get the command working by providing the DN as you described.
What I really desired was some flexbility (no having to know the DN for the machine and only supplying a name).
So I tried Piping DSQuery into DSRM (A Common Admin Practice)
var commandTxt = "dsquery.exe computer -name " + computer + " -u " + username + " -p " + password + " | dsrm -noprompt " + " -u " + username + " -p " + password + ""
Doesnt work. I cut it down first to check that DSQuery Was working and it was returning the correct DN - that part was fine.
I could copy and paste the commandTxt into a Windows Command Line and Execute it OK.
If anyone has some ideas I would love to hear them. I can only hazard a guess that the Command() object doesnt like Piping maybe or executing multiple programs.