I am stuck, I have constructed the below command.
FOR /F %a IN (C:\file.csv) DO dsquery user -samid "%a" | dsget user -fn –ln >> C:\result.csv
Now what this is meant to do is take the samid's in C:\file.csv and use them in the dsquery and then output the first and last name of the account associated to the samid into C:\result.csv.
This isn't happening and I don't know why.
basically i get errors like this...
C:\>dsquery user -samid "11492" | dsget user -fn -ln 1>>C:\result.csv
dsget failed:Value for `Target object for this command' has incorrect format.
Where if I enter...
dsquery user -samid "11492" | dsget user -fn -ln 1>>C:\result.csv
as its own command it works great!
can someone please help me!?!