I'm trying to execute a pipe on a remote server by using
The command that I'm trying to execute is
psexec \\servername DSQUERY USER -name *userpart* | DSGET USER -samid -display
Currently, the | pipe symbol get executed locally which is not what is wanted (since
dsget does not exist on my machine).
I tried to use quote around the whole command
psexec \\servername "DSQUERY USER -name *userpart* | DSGET USER -samid -display"
but that resulted in psexec trying to run that whole quoted sentence as one executable, which obviously does not exist.
How can I pass a pipe symbol to the remote server so that it can execute it?