Need to type Query in command prompt by using Type Into Activity

Hi,

I need to type the below query in comman prompt by using type into activity but i am gettinng errors. can anyone help me out?

dsquery * -filter “(&(objectcategory=person)(employeeid= ))”

@shyam.sankar

What was the error you are facing?

hi @shyam.sankar
I have created basic workflow, type into is working.OpenCMD_RunCommand.xaml (6.9 KB)

  1. Win + R (Run)
  2. Type cmd then enter
  3. change directory
    4.Close Cmd

Thanks
Latika

Thank you!

I didn’t get the exact solution for my problem…Actually i need to type this query in cmd by type into activity to get the details of the employee

dsquery * -filter “(&(objectcategory=person)(employeeid= ID))”

ID- i will replace the value from variable…

While entering this query i am getting one small error…I guess its very basic mistake but i couldn’t find
Can you help me out please?

Small validation error

can you share the error screenshot?

dsquery * -filter “(&(objectcategory=person)(employeeid= ID))”

ID should be variable, but in Command prompt it shoud be %ID%.
Can you please Run the query once manually in cmd. if the output came then no problm with query.

Example:
Reading Value from a Variable in Cmd,

C:\> SET foo=bar
C:\> ECHO %foo%
bar

Thanks
Latika

Hi,

Please find the attached screenshot

@shyam.sankar

Check as below

You are missing the double quote at end

Hope this helps

Thanks

Write the full Query in between " "
Type into allows string type.

Thanks
Latika

I have already tried with “” but same error.

image.png

“dsquery * -filter“(&(objectcategory=person)(employeeid=ID))”

(or)

“dsquery * -filter (&(objectcategory=person)(employeeid=ID))”

Thanks
Latika

Double quotes between the query is mandatory.Below is the exact structure of the query.I have tried yours but not working.Please do the needful

dsquery * -filter “(&(objectcategory=person)(employeeid= ID))”

Any update?

Hi @shyam.sankar

Just paste the below line and check
“dsquery * -filter “+” “”(&(objectcategory=person)(employeeid= ID))”" "

While typing the above query i am not getting errors,its fine.
But the value in the variable is not typing in CMD…Its just simply typing ID…

Can you please change ID as %ID% and check it once.
Let me know if you found any errors.

Thanks
Latika

Hi @shyam.sankar

By assign and replace you can change the ID
e.g.

Assign
query = “dsquery * -filter “+” “”(&(objectcategory=person)(employeeid= ID))”" "
ID = 32

Then use
query.Replace(“ID”,ID.ToString)

Its working fine…Thanks for the great help!!!