I am relatively new to perforce. I have been asked to look into a way to automate the process of user account creation through a script. That is because during each Term we have so far been going in manually and making accounts for each new student ourselves, a process that is incredibly tedious.
I think I have a reasonably clear idea of what some of the Python code for this may look like, in terms of reading data from the spreadsheet. However, I am unsure about the second part - actually creating user accounts and tying them to the Perforce server we have. How would I go about doing that? The other thing I am confused about is how to prevent duplicate users from being made?
Here is some code for the first part of the process.
import csv
# Read in user data from the CSV file
with open('user_data.csv', 'r') as csv_file:
reader = csv.DictReader(csv_file)
for row in reader:
first_name = row['First Name']
last_name = row['Last Name']
username = row['Username']
email = row['Email']
password = row['Default Password']