login vsi company logo login vsi company logo 250x40

 

Get the best possible VDI performance, density and availability with Login VSI
Our Solutions

  • Home
  • Blog
  • Login PI
  • How to: Login PI bulk administration – changing a profile’s workload using a CSV file

How to: Login PI bulk administration – changing a profile’s workload using a CSV file

The previous blog post explained the basics around using the Login PI RESTful API through Powershell. This blog post will build on that foundation to change the workload assigned to profiles based on a CSV file instead of assigning the same workload to each server.

The use case for this script is a large-scale Login PI customer that needs to change the workload assigned to profiles regularly. Since the PI interface is intended for small-scale changes the API is used. As the API allows large bulk operations with ease.

The first step is to define the variables that will be reused. This will be the same variable used in the previous blog post. The PIbaseURL points to the location where the PI backend is hosted. In this example, the default port of 8080 is used.

PIbaseURL

Next the script will retrieve all the available profiles. The profiles are stored in a variable for later reference.

PIbaseURL2

Now that the profiles are retrieved the CSV file needs to be read. Powershell has built-in mechanisms to deal with CSV files. Making it very easy to deal with CSV files. Please note that for this example the CSV file used has a very specific structure. The first row is the title for the column.

CSV file

By giving the column a title Powershell can refer to the row by using an object property after loading the CSV file.

csvFile

This tells Powershell to load a CSV file from the indicated path and store the content in a variable.

CSV file import

After the import the contents of the CSV file can be referenced to by using object properties.

The script will then iterate through the CSV file based on the server name specified. In this use case the customer had a profile for every server they wanted to directly connect to. The use case allows the script to identify the profile based on the server that is being connected to. As the name of the profile will match the server name. Your profile names may be different. Just be aware that this script will assign the workload based on the name of the profile.

foreach

This line tells Powershell that the script wants to do something with every line of the CSV file based on the server column.

At the point the script will retrieve the id assigned to the profile based on the name of the profile as stored in the CSV file. The script will also assign the workload name from the CSV file to the serverWorkload variable. That will allow the rest of the script to be copy/pasted from the previous script.

serverID

The rest of the script is the same as the script from the previous blog post. Except for the workload not being hardcoded but taken from the CSV file

profileURL

With the basics behind the Login PI RESTful API and taking information from a CSV file covered the next installment in this series will cover finding the API endpoints to automate pretty much anything in the Login PI configuration.

Do you have a use case for Login PI that may seem out of the range of the capabilities for Login PI? The Login VSI Professional Services team has completed thousands of custom fit solutions for challenging use cases. Feel free to reach out to us at support@loginvsi.com with your questions and how we can provide a solution that will improve your overall end user experience.

Disclaimer: many of the API endpoints mentioned in this blog post are not supported. Meaning they may change from release to release. This blog post is therefore provided AS-IS.

 


 

Start using Login VSI today

Our industry-standard software is built to help you avoid problems, lower costs and improve performance. Request a Quote or get your free Trial below, and benefit from our award-winning services.

Free Price Request  Your Free Trial

 


About the company Login VSI

The company Login VSI provides end-user performance insights for virtualized desktop and server-based computing environments. Enterprise IT departments use flagship product Login VSI (for load testing) and Login PI (for continuity testing) in all phases of their virtual desktop deployment—from planning to deployment to change management—to build and safeguard a good performance, a high availability, and (as a result) a good and consistent end-user experience. For more information about Login VSI or for a free test license contact us.

 

Tags: Login PI

Popular Blogs

Login VSI Blog - Ongoing Effects CPU Flaws

The Ongoing Effects of Intel CPU Flaws

The Ongoing Effects of Intel CPU Flaws Over the last year, we’ve seen many Intel CPU hardware flaws come to light and when news first broke about Meltdown & Spectre there was a lot of panic: "should we patch?", "What’s the performance impact?", "Can we still rely on this hardware?" Continue Reading
Login VSI Blog - Updating to Windows 10 1903? Make Sure to Test!

Updating to Windows 10 1903? Make Sure to Test!

Updating to Windows 10 1903? Make Sure to Test! It’s that time of the year again. Microsoft have released their spring update and the first IT-Pro’s are getting ready to move their VDI environment over. Continue Reading
Login AT Express offers Application Compatibility Testing for up to 50 applications for FREE

[Press Release] Login VSI introduces free license for award winning solution, Login AT

Login AT Express offers Application Compatibility Testing for up to 50 applications for FREE Atlanta, USA, May 22, 2019: Login VSI, the industry standard for VDI and SBC performance testing, announced today the availability of a new, free version of Login AT for Bulk Application Compatibility Testing. Continue Reading
Login VSI - Blog - Login VSI Help Center Blog Teaser Image - Improvements & Update Notifications

Login VSI Help Center – Improvements & Update Notifications

Login VSI announced the release of the Knowledge Center in June of 2017. Since then the utilization of the platform has evolved dramatically. In this blogpost we introduce a few of these improvements and updates. Continue Reading
Login VSI Blog - LVTE 2109 - Technology Advocates & Experts

Login VSI Technology Advocates and Experts 2019

About a year ago Login VSI, the industry standard in VDI performance testing, announced a new program Recognizing those individuals that have built and displayed extensive knowledge of the Login VSI software solutions, and visibly contribute to the End-User Computing (EUC) Community. Continue Reading
Introducing Login PI 3.4

Introducing Version 3.4 of Login PI

What’s New & Different - Introducing Version 3.4 of Login PI We've updated Login PI, the benchmark in unplanned-change and gradual-deterioration detection for VDI. New features include improving the way information is collected & distributed, the way customized workloads are created & the way actual tests are executed. Continue Reading
Cookie Settings