Work with the Perfecto Lab User Management Utility
Admin users in private and public clouds can add or delete users, add or modify roles, create groups, and so on. A limited number of update or delete operations can easily be done using the cloud administrator window, but they become painful when a bulk update is required.
Learn how to use a Python UI utility to create and update bulk user details in public and private clouds.
Prerequisites
-
Admin credentials for a private or public cloud
-
Python (Windows only)
Mac/Unix comes with a pre-existing Python installation.
Python installation
Windows:
- Download the latest Python 2.7.* version (https://www.python.org/downloads/).
- Install the package. Consider installing it using the default directory path, for example
Python27
. -
In the Environment variable, under the "PATH" system variable, add the <PythonInstallationDirectory> and <PythonInstallationDirectory>\Scripts paths.
Mac/Unix:
If needed, update the Python version by downloading the latest version from https://www.python.org/downloads/mac-osx/.
Package installation
If you are installing on Mac/Unix, use the SUDO
command.
To install:
- Open a command prompt or terminal window in Windows or Mac, respectively.
- Install the package by running the following commands sequentially:
- pip install requests
- pip install openpyxl
- pip install Tkinter
Utility usage

Launch the Lab User Management utility.
-
Download the utility: PerfectoUserUtility_6.py
-
Download sample Excel user data: SampleUserDetails.xlsx
-
Open a command prompt or terminal window and navigate to the folder to which you downloaded the utility.
-
To open the utility, execute the following command:
Copypython PerfectoUserUtility.py
-
Provide the cloud address and the admin credentials or the Perfecto security token.

Retrieve the names of all active and enrolled roles from the cloud and save them in the Excel file.
-
Click the RetrieveActiveUser button to retrieve all active users in the cloud.
- To get username details, access the CloudRetrievedUser.xlsx file from the execution directory.
- Use the same file to feed the data for ExcelUser during Delete User and Add/Delete Roles operations.

Delete users from the cloud.
-
Select one of the following radio buttons: Single User, All Active Users, or From Excel.
-
Click the DeleteUser button to delete users from the cloud.
Depending on your selection in Step 1, clicking this button deletes the following:
-
Single User: Deletes the userId provided in the Single User text box. The userID should be an email address, for example abc@company.com.
-
All Active User: Deletes all active users in the cloud.
Based on the number of user in the cloud, this action may take a few minutes to complete. The UI may be unresponsive during this operation.
-
From Excel: Deletes the username given in the Excel sheet. See the attached sample user list at the beginning of this article.
Select the Excel file by clicking the OPEN FILE button or by providing the complete path in the FromExcel field.
The first page of the Excel file should be called ActiveUser.
A log file, Log.txt, will be generated in the working directory, tracking all events in the UI.
-

Add roles to a user.
-
Select one of the following:
-
Single User: This adds the provided roles in the Roles text box for a given userId in the Single User text box. The username should be an email address, for example abc@company.com.
-
All Active Users: This adds roles to all active users in the cloud.
Based on the number of user in the cloud, this action may take a few minutes to complete. The UI may be unresponsive during this operation.
-
FromExcel: Adds a given username from the Excel sheet. (See the downloadable sample user list above.)
To select the Excel file, click OPEN FILE or provide the complete path in the FromExcel text box.
The first page of the Excel file should be named ActiveUser.
-
-
Click Add Roles to add roles for the given userid in the cloud.
A log file, Log.txt, will be generated in the working directory, tracking all events in the UI.

Delete roles for given user.
-
Select one of the following:
-
Single User: Deletes the roles entered in the Roles text box for the userId entered in the Single User text box. The username should be an email address, for example abc@company.com.
-
All Active Users: Deletes the provided roles from all active users in the cloud.
Based on the number of user in the cloud, this action may take a few minutes to complete. The UI may be unresponsive during this operation.
-
FromExcel: Deletes a given username from the Excel sheet. (See the downloadable sample user list above.)
To select the Excel file, click OPEN FILE or provide the complete path in the FromExcel text box.
The first page of the Excel file should be named ActiveUser.
-
-
Click DeleteRoles to delete the roles for the given userid in the cloud.
A log file, Log.txt, will be generated in the working directory, tracking all events in the UI.