Work with the Perfecto Lab User Management Utility
Admin users in a private or public lab could do Add/Delete User, Add/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 become painful when a bulk update is required.
This article explains a Python UI utility to Create/Update bulk user details in public and private labs.
Prerequisites
- Admin credentials for a private or public lab
- Python
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
. -
Add the <PythonInstallationDirectory> and <PythonInstallationDirectory>\Scripts paths in the Environment variable under the "PATH" system variable.
Mac/Unix:
Mac/Unix comes with a pre-existing Python installation, so you do not need to install Python. However, you can update the Python version by downloading the latest version from https://www.python.org/downloads/mac-osx/.
Package installation
Use the SUDO
command if you are installing on Mac/Unix.
To install:
- Open a command prompt or terminal window in Windows or Mac, respectively.
- Run/Install the package withthe following commands sequentially:
- pip install requests
- pip install openpyxl
- pip install Tkinter
Utility usage
- Download the utility: PerfectoUserUtility_6.py
- Download sample Excel user data: SampleUserDetails.xlsx
- Open a command prompt/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 users and enrolled roles from the cloud and save them in the Excel file.
Deletes users from the cloud.
The delete action deletes the users from the cloud. They cannot be retrieved again. Double-check before you delete.
- Select Single User, All Active User or FromExcel radio button.
- Click "DeleteUser" button to delete users from cloud
- Single User selection deletes given userId in Single User text box. (UserID should be with email ID EX: abc@company.com)
-
All Active User selection deletes all Active users in the cloud.
Note:Based on number of user in the cloud this action would take couple of minutes to complete and UI will be unresponsive during operation.
-
From Excel selection, delete the given Username in excel sheet. (Attached sample user list above)
-
Excel File can be selected by "OPEN FILE" button or by providing complete path in "FromExcel" text box
-
First page of the excel should be named as "ActiveUser")
-
-
Log.txt will be generated in working directory and tracking all events in 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.
Note:Based on the number of user in the cloud, this action may take a few minutes to complete. The UI will 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.
Log.txt
will be generated in the working directory and tracking all events in the UI.
Deletes 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.
Note:Based on the number of user in the cloud, this action may take a few minutes to complete. The UI will 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.
Log.txt
will be generated in the working directory and tracking all events in the UI.