Auto Deploy new VDI in xendesktop catalog
As part of day to day tasks, one of the major activity for citrix admins is to maintain free VDIs in xendesktop delivery groups. If we dont have registered free VDI machines, and when new users try to connect to VDI, they would get errors like “Cannot start VM”. So, we have to make sure we have enough free VDIs in delivery groups. As a part of this process, I wrote a powershell script that would auto provision new VDIs to a given catalog and add them to delivery group.
You can remove or change some of the delay commands like start-sleep values, but I updated it as per my current scenario. Feel fee to change them as per your need.
What do you need to update in the script
- Controller Name, Machine Catalog Name, Delivery Group Name
- Vcenter Server Name
- To and From email address, SMTP server name
- Number of free VDIs you need in your XenDesktop site.
Note: You should have access to create AD accounts and you should be full admin on citrix site. If you schedule this script, user id that you use to run this script should have the same.
Checkout the script available here: https://github.com/ChayScripts/Auto-Deploy-New-VDI-In-Xendesktop-Catalog
Pros and Cons in using this script
If you are in a IT company, a dedicated L1(Helpdesk) team would add new users to AD groups to get access to Apps and Desktops. L1 team can’t verify if there are free VDIs in the pool (unless they have enough rights, normally L2 team does that). When new users try to access their VDI, it throws errors if there are no free VDIs in the delivery groups. With this script, you can automate the whole process of creating VDI, adding it to machine catalog, and delivery group. You can set a limit on how many VDIs you want in the pool so that it makes sure that there are those many free VDIs in pool all the time. Modify the parameters as explained in the script, and create a scheduled task to run it every hour or twice per day etc..
Cons: Just kidding… There are no cons in using the script. If you dont need it anymore, just remove the task scheduler.
Feel free to use it and share your feedback!!
Want to learn more on Citrix Automations and solutions???
Subscribe to get our latest content by email.