I need to know how to get the result in VBA Excel from Active Directory using shell, cmd, dsquery and dsget filtering by email in this way:
---> dsquery user -name m * | dsget user -email
If I write the above commands in a cmd (it doesn't need admin for the query) it returns what I ask for, now if I send it from VBA in Excel with the Shell command like this:
---> R = Shell ("cmd dsquery user -name m * | dsget user -email", vbNormalNoFocus)
a cmd opens but it does nothing else and the most curious thing is that I use those same commands in the cmd opened from VBA Excel then appears the following:
---> 'dsquery' is not recognized as an internal or external command, operable program or batch file
What am I doing wrong? Thanks very much!