How use PowerShell to start process

I managed to successfully get Postman working - thanks to the clear documentation. The technology group would prefer to use PowerShell though. I don’t really understand the syntax so I have been unable to puzzle out the documentation provided - GitHub - UiPath/orchestrator-powershell: UiPath Orchestrator PowerShell cmdlet library

I got the package installed and can send a Get-UiPathAuth token which returns the correct url, tenant, and says authenticated. However, when I run Get-UiPathProcess - I get an error - You are not authenticated!

What do I need to do to pass the initial authentication on?

Second:

Start-UiPathJob - orchestrator-powershell/Start-UiPathJob.md at master · UiPath/orchestrator-powershell · GitHub

I’m guessing that the following is equivalent to having Postman run the job on all bots:

Start-UiPathJob -All -Process [-AuthToken ] [-RequestTimeout ]
[]

I’m not real clear on what needs to go between each set of <>, besides Process. Should SwitchParameter be the Robot Id?

If someone has an example I’d really appreciate it.

Thank you.

1 Like

Hi @RR2,
Welcome to the Community!
Are we talking here about your our (on-premise) instance of Orchestrator or the Community one? If the answer is Community, then I think this might be blocker here.

@Pablito

Ah, yes I’m trying to build the POC with the community before messing around with our enterprise version. I’m guessing I have to jump right into the enterprise version then?

I think so. Community Orchestrator can have issue with proper authentication through powershell as in typical scenario to be able to “mess” around with powershell the computer to which you are sending commands needs to have scripting allowed from Active Directory or registry side. If Community Edition would have such thing allowed it could be used to other not specially good ways :smiley:

@Pablito

Point to the enterprise version fixed the authentication issue. I was able to run Get Robot & Process. However, when I try to run Start Job I haven’t been able to figure out the valid input for Process.

I get Cannot convert the X value of System.string to type UiPath.PowerShell.Models.Process.

I’ve tried the process key, ProcessId, and Id with no luck.

Start-UiPathJob -All
cmdlet Start-UiPathJob at command pipeline position 1
Supply values for the following parameters:
Process:

Let me invite @Remus_Rusanu to the discussion. I think he will be the right person to help us here :wink:

Hello @RR2 sorry I missed the earlier notification.

You should start by first authenticating your PowerShell session with your Orchestrator. For Platform, just run this:
PS:>Get-UiPathAuthtoken -Session

Next, you will need a reference to the Process you want to start. Use Get-UiPathProcess to list all processes. Then find the one you want to start and use the process name to get a reference and assign it to a PowerShell variable. In my case, the process name is QueueHandler_RERUSANU:
PS:>$process = Get-UiPathProcess -Name QueueHandler_RERUSANU
Now simply start the job:
PS:>Start-UiPathJob -RobotCount 1 -Process $process

2 Likes

Hi Remus.

That helped me zero in on the issue. When I try to use AD/SSO, it doesn’t appear to actually connect. When I use an actual name and password setup via Orchestrator it does.


We have Azure setup for SSO instead of separate credentials for most people with access. Does anything stand out as an issue with the following:

PS C:>Get-UiPathAuthToken -URL -TenantName -WindowsCredentials -Session

Thank you.

Yes, if you have a private Orchestrator then you use the syntax you provided (-Url -TenantName -WindowsCredentials, or -Url ... -UserName ... -Password ...). The syntax in my example is for the public Cloud Orchestrator.

1 Like

-TenantName and -WindowsCredentials were reported previously that don’t work together, Get-UiPathAuthToken with windows credentials and tenant · Issue #59 · UiPath/orchestrator-powershell · GitHub. It’s a bug and needs to be fixed.
When you use -WindowsCredentials there is no actual authentication that occurs, the auth will happen on the next cmdlet that you run. This is why you gte the error on the next Get-UiPathProcess cmdlet, I know is confusing and we have on the roadmap to make it somehow better.

1 Like

Thank you. For the time being it sounds like we need to create specific credentials to support these scenarios.

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