winexe execute command on windows with pipe and quotes

838 views Asked by At
1- dsquery user -disabled | dsget user -display -email -dept -title
2- dsquery computer  -limit 1000 | sort
3- dsquery user "dc=YOURDOMAINNAME" -inactive 2 | dsget user -display -email -dept -title'

Using WINEXE on Linux, I am trying to execute above commands on remote windows 2008 but getting error.

winexe -U DOMAIN/ADMIN%"PASSWORD" //10.0.0.1 "dsquery user -disabled | dsget user -display -email -dept -title"

ERROR
dsquery failed:'dsget' is an unknown parameter.
type dsquery /? for help.root@linux:/temp#

 winexe -U DOMAIN/ADMIN%"PASSWORD" //10.0.0.1 "dsquery user "dc=MYDOMAIN" -inactive 2 | dsget user -display -email -dept -title'"

dsquery failed:'|' is an unknown parameter.
0

There are 0 answers