Feature #42: Active Directory Interop Upgrade

AD Interop moved to Disco.Services; Supports multi-domain environments,
sites, and searching restricted with OUs.
This commit is contained in:
Gary Sharp
2014-04-10 17:58:04 +10:00
parent b841c6b2c0
commit db73cc1a12
218 changed files with 6383 additions and 2535 deletions
@@ -1,37 +1,37 @@
using Disco.Models.Interop.ActiveDirectory;
using System;
using Disco.Models.Repository;
namespace Disco.BI.Interop.ActiveDirectory
{
internal static class ActiveDirectoryUserAccountExtensions
{
public static object GetPropertyValue(this ActiveDirectoryUserAccount account, string PropertyName, int Index = 0)
{
switch (PropertyName.ToLower())
{
case "name":
return account.Name;
case "samaccountname":
return account.SamAccountName;
case "distinguishedname":
return account.DistinguishedName;
case "objectsid":
return account.SecurityIdentifier;
case "sn":
return account.Surname;
case "givenname":
return account.GivenName;
case "mail":
return account.Email;
case "telephonenumber":
return account.Phone;
default:
object[] adProperty;
if (account.LoadedProperties.TryGetValue(PropertyName, out adProperty) && Index <= adProperty.Length)
return adProperty[Index];
else
return null;
}
}
}
}
//using Disco.Models.Interop.ActiveDirectory;
//using System;
//using Disco.Models.Repository;
//namespace Disco.BI.Interop.ActiveDirectory
//{
// internal static class ActiveDirectoryUserAccountExtensions
// {
// public static object GetPropertyValue(this ActiveDirectoryUserAccount account, string PropertyName, int Index = 0)
// {
// switch (PropertyName.ToLower())
// {
// case "name":
// return account.Name;
// case "samaccountname":
// return account.SamAccountName;
// case "distinguishedname":
// return account.DistinguishedName;
// case "objectsid":
// return account.SecurityIdentifier;
// case "sn":
// return account.Surname;
// case "givenname":
// return account.GivenName;
// case "mail":
// return account.Email;
// case "telephonenumber":
// return account.Phone;
// default:
// object[] adProperty;
// if (account.LoadedProperties.TryGetValue(PropertyName, out adProperty) && Index <= adProperty.Length)
// return adProperty[Index];
// else
// return null;
// }
// }
// }
//}