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


JUser: :_load: Unable to load user with ID: 17524

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.


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


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.


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.


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.


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


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 price or get your trial below, and benefit from our award-winning services.

Request Price  Request 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 new addition 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.


About the author

Tags: Login PI

Popular Blogs

Login VSI Blog Article - Microsoft Windows 10 Default FTA Associations - Teaser Image

Windows 10 Default File Type Associations and Login VSI

When Login VSI 4.1 was released, the majority of desktops were running Windows 7 and life was easy. We’d set the default filetype for an application and it would simply work. Continue Reading
Login VSI - Press Release - IGEL - Login VSI Partner to Optimize End User Computing Experience Image

[Press Release] IGEL Partners with Login VSI to Optimize the End User Computing Experience

Login PI enables organizations to better protect the performance and availability of their IGEL OS-powered virtual desktop environments Continue Reading
Login VSI - Blog - Login PI Blog Teaser Image - Windows Virtual Desktop: How To Monitor User Experience With Login PI

Windows Virtual Desktop – How to Monitor User Experience?

Microsoft has just announced the public preview of their new Windows Virtual Desktop (WVD) offering at Microsoft Ignite on Tour in Amsterdam today. For those of you who’ve not followed the rumors or the private beta, here’s the outline... Continue Reading
Login VSI Blog - Teaser Image - A Practical Guide to VDI Change Management - Part 1

A Practical Guide to VDI Change Management

Part 1: IT Change Management in general The first in an 8-part series, this practical guide to VDI Change Management will guide you through the transformation of the IT department from a back-end function into a core competency for every modern organization. Continue Reading
Investigating Online Application Performance with Login PI

Investigating Online Application Performance with Login PI

As many companies do, we use a CRM system. Recently, I have been getting complaints about our cloud CRM system, Microsoft Dynamics, being slow. I tried to investigate this by shadowing one of our users to see what was wrong. Continue Reading
Login VSI Blog - How-To Update, Protect Against RIDL, Fallout MDS Vulnerability

How-To: Update, Protect Against RIDL, Fallout MDS Vulnerability

RIDL & Fallout MDS vulnerabilities, impact on VDI performance & actions to take. FAQs we’re receiving & updates on performance tests executed to patch flaws Intel calls “Microarchitectural Data Sampling (M.D.S.)” aka: Rogue In-Flight Data Load (RIDL), Fallout, ZombieLoad & Store-to-Leak Forwarding. Continue Reading
Cookie Settings