Add RDP user via vRO workflow – Step by Step

Share this:

Working on a solution for automating virtual desktop provisioning, I had to find a easy and fast way to add a user who will be able to access the desktop via RDP. I wanted this to be as simple as possible, so it could be easy for maintain and edit.

Here are the pre-requisites for creating the workflow:

  1. Installed an configured vRealize Orchestrator
  2. vCenter Server is added to the vRealize Orchestrator
  3. Virtual Machine (or Template) user with Administrator right
  4. You Virtual Machine (or Template) has installed VMware Tool and it is running on ESX/ESXi

Let’s get started

  1. Login to your vRO via vRO clientlogin to vRO
  2. Be sure you on the Run view. Create a separate folder where you will put your new Workflow. In my case this is a folder called VDI. Once the folder is created, right click on it and choose New workflow
    Folder and new workflow
  3. Type a Name for the new workflow. In my case it will ‘Add RDP User’workflow name
  4. After that, navigate to Schema, expand the Generic collection, choose Workflow element and drag-and-drop to the location shown on the screenshot. After that you will be asked to choose a workflow, where you need to type Run program in guest  and click OK. After that click on the Setup4
  5. Here you need to put some data, which will be static and you will not have to add it every time you run the workflow.
    • vmUsername – a local or domain user name, which has administrator roles on the VM’s OS which you are going to modify
    • vmPassword – the password of the user, which is used as vmUsername
    • vm – this will be the only Input for this workflow for now.
    • interactiveSession – No
    • programPatch – C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
    • arguments – just select Value and keep it empty.
    • workignDirectory – skip
    • environment – skip
    • Click Promote5
  6. Now we need to add a new Input for RDP user name. Navigate to Input tab, then select the narrow and add new argument. After that you can rename it to RDPUser and also add a proper description like – New RDP User.6
  7. Go back to Schema and add a new Scriptable task using again drag-and-drop. After that click pencil to edit it.add input
  8. Naviate to IN tab, to add new Input. Select RDPUser and click Select.add new input
  9. Navigate to OUT tab, to add new Output. We need to create a brand new attribute, so click on Create paramenter/attribute in workflow. After that type a name compiledarg and click OK.add output
  10. Go to Scripting tab and add compiledarg = “-command C:\\temp\\vRO_AddRDPUser.ps1 -RDPUser ” + RDPUser  10
  11. Click OK to go back to the previous workflow. Now we need to edit the Run program in guest workflow to use our new argument as an input. Click on the pencil to edit it.11
  12. Navigate to Visual Banding. First we need to remove the current binding between In Attribute argument and IN attribute as shown on the screenshot12After that we need to build another binding between compeiledarg and arguemnt13
  13. Last thing to do before testing is to create a local scrip on the VM or template which will be run from the workflow with the additional argument
    param($RDPUser)
    net localgroup "Remote Desktop Users" /add $RDPUser

    14

  14. Let’s Run the workflow. As my goal was to set a minimum inputs when the workflow is being run, I was able to minimize just to VM name and RDP User Name. 15

 

This work flow could be added to your Cloning workflow, so right after clone and sysprep, the desired user will be added to the remote desktop group, so the user can login and use his/her desktop.

Hopefully this will be as useful for you as it was for me.

The following two tabs change content below.

Nikolay Nikolov

VDI Engineer
Nikolay has 9 years work experience in IT and 5 of them in the Virtualization technologies mainly based on VMware products. Currently works as VDI Engineer at MSD IT Global Innovation Center and he is an ex-member of VMware CoE at IBM. He holds VCIX6-DCV, VCIX6-DTM and VCP on DCV, DTM, NV and Cloud, Nutanix NPP certificate and also Master Degree of Computer Systems and Networks. Honored with vExpert 2015/2016 by VMware and Nutanix Technology Champion 2016/2017.

Latest posts by Nikolay Nikolov (see all)

About Nikolay Nikolov

Nikolay has 9 years work experience in IT and 5 of them in the Virtualization technologies mainly based on VMware products. Currently works as VDI Engineer at MSD IT Global Innovation Center and he is an ex-member of VMware CoE at IBM. He holds VCIX6-DCV, VCIX6-DTM and VCP on DCV, DTM, NV and Cloud, Nutanix NPP certificate and also Master Degree of Computer Systems and Networks. Honored with vExpert 2015/2016 by VMware and Nutanix Technology Champion 2016/2017.
Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.