Part 2 Automating Account Creation
Having made the decision to create a C# program to reset user passwords, it became clear that other tasks could be carried out by the same system.
Before the system could be allowed to attempt to change a password, it would first have to check that a user account existed that matched the details upon the user Id card. If the check found an account, then it could be allowed to continue and reset the password. If the check showed that no account existed, then the system could be tasked to check whatever management information system was used to store the details of valid users.
In this case, the example code takes into account that a SQL database is used to store the details of valid users but any database should in theory be usable.
If this second check showed that the card belonged to a valid user then a network account could be generated using the data retrieved from the database.
If multiple systems were used to store user details, these could be queried in turn until matching credentials could be found.
If neither of these checks returned a positive result, the user could be directed to contact someone who could record their details in the correct system.