Replace the code on the AresForm.cs with the following: using System; using System.Drawing; using System.Windows.Forms; using System.Security.Principal; namespace Ares { public partial class AresForm : Form { public AresForm() { InitializeComponent(); //Make the form go Full Screen GoFullscreen(true); } public void Wipe_Clean() { //Reset all of the variables ready for the next User. Globals.siteVar...
Create the class that will print the user’s details to the till printer. Copy the method used to create the Globals.cs class but this time call it ‘PCPrint.cs’. Change the code inside PCPrint.cs to the following: using System; using System.Drawing; using System.Drawing.Printing; namespace Ares { public class PCPrint : System.Drawing.Printing.PrintDocument { #region Property Variables...
Create the class that will create the user’s email account. Once again, this example uses the AresAdmin account used in the ChangePassword.cs class. The AresAdmin account will need edit permission to your exchange system. Copy the method used to create the Globals.cs class but this time call it ‘Enable_Mailbox.cs’. Change the code inside Enable_Mailbox.cs...
Create the class that will check if the user is currently allowed on the system. Once again, this example uses the AresAdmin account used in the ChangePassword.cs class. The AresAdmin account will need read permission to whatever database system you use to record your users. Create a SQL view that retrieves the details for...
Create the class that will create the user account in Active Directory. Once again, this example uses the AresAdmin account used in the ChangePassword.cs class. Copy the method used to create the Globals.cs class but this time call it ‘CreateAccount.cs’. Change the code inside CreateAccount.cs to the following: using System; using System.DirectoryServices; using System.DirectoryServices.AccountManagement;...
Create the class that will check if the user exists in Active Directory. Once again, this example uses the AresAdmin account used in the ChangePassword.cs class. Copy the method used to create the Globals.cs class but this time call it ‘CheckIfExists.cs’. Change the code inside CheckIfExists.cs to the following: using System; using System.DirectoryServices.AccountManagement; using...
For the purposes of this example I am using mydomain.local to represent my domain name. Please insert your own domain name instead. You will also require a user account capable of editing active directory. In this example I am using an account called AresAdmin which has a password of ‘123456789012345’. Substitute the details of...
Create Globals.cs Ares uses a number of static variables to hold information about the current user. These are set up in a class called Globals.cs In the Solution Explorer window right click on ‘Ares’, select ‘Add’ and ‘Class’. In the ‘Add New Item – Ares’ window that pops up, change the name of the...
Creating the Project This example was built using Visual Studio 2015. Different versions of Visual Studio may look different from the screenshots included and some options may not appear. Using Visual Studio, create a New Project, select Visual C#, Windows Forms Application and supply a name and location for the project files. In this...
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...