using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.DirectoryServices;
using Core;
using Microsoft.MetadirectoryServices;
namespace pwdsync
{
class Client:IMAPasswordManagement
{
public static void Main(string[] args)
{
}
public void BeginConnectionToServer(string connectTo, string user, string password)
{
throw new NotImplementedException();
}
public void ChangePassword(CSEntry csentry, string OldPassword, string NewPassword)
{
User x = new User();
try
{
string UserDN = csentry.DN.ToString();
if ((UserDN != null) && (OldPassword != String.Empty) && (NewPassword != String.Empty))
{
x.changeEEUserPassword(UserDN, OldPassword, NewPassword);
}
else
{
}
}
catch (Exception ex)
{
//TODO: Write Exceptions to Log files.
System.Diagnostics.EventLog.WriteEntry("ChangePassword", "Change Password Method Threw" + ex.Message.ToString());
}
}
public void EndConnectionToServer()
{
throw new NotImplementedException();
}
public ConnectionSecurityLevel GetConnectionSecurityLevel()
{
throw new NotImplementedException();
}
public void RequireChangePasswordOnNextLogin(CSEntry csentry, bool fRequireChangePasswordOnNextLogin)
{
throw new NotImplementedException();
}
public void SetPassword(CSEntry csentry, string NewPassword)
{
User x = new User();
string UserDN = csentry.DN.ToString();
if ((UserDN != null) && (NewPassword != String.Empty))
{
x.changeEEUserPassword(UserDN, NewPassword);
}
else
{
//TODO: Write Exceptions to Log files.
throw new Exception("One of the parameters was missing: UserDN or newpassword cannot be empty");
}
}
}
}
Note: The user is a custom class I have created in an different file. I think I might have to create .dll by "Create Extension Projects"
and import all the code there.