How to run powershell query in studio

Hello,

i have below cmd query -
dsquery * domainroot -filter “(&(objectCategory=User)(sAMAccountName=“kmathkar”))” -attr cn

which is working in cmd and by opening cmd using UiPath also working but issue is when i am scrapping data from cmd using get visible text, it is not scrapping properly , randompy it skips some values.

so i converted my cmd query to powershell using chatgpt and it is workin in power shell -
converted working query -
Get-ADUser -LDAPFilter ‘(&(objectCategory=User)(sAMAccountName=kmathkar))’ -Properties cn |
Select-Object -ExpandProperty cn

i need to run this using invoke powersehll command so i can avoid cmd interaction and directly get output.
but when i pass this command in invoke powersehll in comand text as a string it is giving me error, i have selected type argument as string.

pleaes help me how can i execute this query so i can get output.

help me same.

It looks like you need Active Directory, UiPath has a Library to work with this, maybe you can try to see if that would work for you?

image

1 Like

@Mathkar_kunal

Duplicate topic

Kindly refrain from creating multiple topics for same problem statement, instead you can post your comment on the same topic to seek further inputs.

Thanks.

1 Like