Unable to login to orchestrator from powershell command

Hi,

I am trying to control UiPath Assistant from PowerShell. I want to control a process run by UiPath Assistant using PowerShell .

From this thread I learn that processes can be controlled from PowerShell

However, I cant connect from PowerShell due to the below error.

Get-UiPathAuthToken : Use -CloudDeployment parameter to connect to UiPath Automation Cloud

Refer attached image, on the commands that I have tried so far. Somehow the parameter for CloudDeployment seems to be incorrect.

Any clue ? or what other method can I establish session with UiPath Assistant ?

Thank you for your time and suggestions.

Hi @Dwijadas_Senapati

Is API enabled in your orchestrator?

Thanks
Brij
MyChannel

1 Like

Thanks for your reply.

I think API is activated and I was able to execute the below command. However, it doesn’t get authenticated.

Hi @Dwijadas_Senapati

Did you checked with Postman as well?

I think in below command you are not passing all required parameter, please check ur command
PS C:>Get-UiPathAuthToken -Session -ClientId <your_client_id> -UserKey <your_user_key>

Thanks
Brij
MyChannel

Check this article as I think it will help you How To Start A Job In PowerShell Using Orchestrator API Endpoints?

Hi @brij.sharma @marian.platonov,

Thank you both for replying my topic. I think we are talking different method of using Powershell.

I was exploring UiPath/orchestrator-powershell library.

I have provided parameter as per the guide. seems like modules might have been updated but not the guide. First 2 example also doesnt work.

---------- EXAMPLE 1 ----------

Get-UiPathAuthToken -URL https://platform.uipath.com -Username <myuser> -Password <mypassword>

Connect to UiPath public platform Orchestrator, using user name and password.
----------  EXAMPLE 2  ----------

Get-UiPathAuthToken -URL https://platform.uipath.com -Username <myuser> -Password <mypassword> -Session

Connect to UiPath public platform Orchestrator, using user name and password and save the token for the current 
session.

I will try again, when I get some chance.

Thank you once again.

I stopped exploring using PowerShell. Instead, I was able to achieve using below.

Start-Process -FilePath “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\UiPath\UiPath Assistant.lnk”

Sleep 15
$Objshell = New-Object -COMObject wscript.shell; “UI Path Executor Not Running”

$Objshell.Exec(‘C:\Program Files\UiPath\Studio\uiRobot.exe connect --url UiPath --clientID xxxxxxxx35xxx7bd7xx7 --clientSecret v3xxxx5xxm9xx’);

Sleep 65
$Objshell.Exec(‘C:\Program Files\UiPath\Studio\uirobot.exe execute --process TasteBud.Order.Processing_v2’);

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.