Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-UiPath Robot Error machine already Taken #102

Open
Xyclade opened this issue Mar 26, 2020 · 2 comments
Open

Add-UiPath Robot Error machine already Taken #102

Xyclade opened this issue Mar 26, 2020 · 2 comments

Comments

@Xyclade
Copy link

Xyclade commented Mar 26, 2020

I am adding a UiPath Robots using powershell, but it is giving me an error that the machine name is already taken. Is there a way to create UiPath Robots using the scripts where it in this case picks the already created machine?

Error:

powershell : Add-UiPathRobot : The operation returned an error: 1001: The machine name ROBOT01 is already taken

I used below command:

Add-UiPathRobot -Name $robotName -Username $username -MachineName $machineName -Password $password -Type  $robotLicenseType -LicenseKey $licenseKey
@sorincalin
Copy link

The way it worked for me was to add the LicenseKey from the Machine I was adding the robot to. However even that is not straightforward, as you can get the licenseKey only if you Get the machine by Id:


$existingMachine = Get-UiPathMachine -Name $robot.MachineName
$existingMachine = Get-UiPathMachine -Id $existingMachine.Id

Add-UiPathRobot -Name $robot.Name -MachineName $robot.MachineName -Username $robot.Username -Type $robot.Type -HostingType $robot.HostingType -Description $robot.Description -CredentialType "Default" -LicenseKey $existingMachine.LicenseKey > $null
           

@codemonkee
Copy link

Thank you @sorincalin - I didn't pick up on that as the the errors are very generic and Get-Help is lacking in description and examples.

Is there a reason not to return the LicenseKey when requesting by Name rather than Id?

Seems silly to have to do it twice or not be able to pipe the i/o

(Get-UiPathMachine -Id ((Get-UiPathMachine -Name $machine).Id)).LicenseKey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants