Feature #49: Active Directory Managed Groups
Document Template Attachments, Device Batches, Device Profiles and User Flags can be associated with an Active Directory group. This AD group is then automatically synchronized with relevant User/Machine accounts. Contains various other UI tweaks and configuration enhancements.
This commit is contained in:
@@ -104,26 +104,35 @@ namespace Disco.Services.Interop.ActiveDirectory
|
||||
};
|
||||
}
|
||||
|
||||
[Obsolete("Use generic equivalents: GetPropertyValue<T>(string PropertyName)")]
|
||||
public object GetPropertyValue(string PropertyName, int Index = 0)
|
||||
{
|
||||
return GetPropertyValues<object>(PropertyName).Skip(Index).FirstOrDefault();
|
||||
}
|
||||
public T GetPropertyValue<T>(string PropertyName)
|
||||
{
|
||||
return GetPropertyValues<T>(PropertyName).FirstOrDefault();
|
||||
}
|
||||
public IEnumerable<T> GetPropertyValues<T>(string PropertyName)
|
||||
{
|
||||
switch (PropertyName.ToLower())
|
||||
{
|
||||
case "name":
|
||||
return this.Name;
|
||||
return new string[] { this.Name }.OfType<T>();
|
||||
case "samaccountname":
|
||||
return this.SamAccountName;
|
||||
return new string[] { this.SamAccountName }.OfType<T>();
|
||||
case "distinguishedname":
|
||||
return this.DistinguishedName;
|
||||
return new string[] { this.DistinguishedName }.OfType<T>();
|
||||
case "objectsid":
|
||||
return this.SecurityIdentifier.ToString();
|
||||
return new SecurityIdentifier[] { this.SecurityIdentifier }.OfType<T>();
|
||||
case "netbootguid":
|
||||
return this.NetbootGUID;
|
||||
return new Guid[] { this.NetbootGUID }.OfType<T>();
|
||||
default:
|
||||
object[] adProperty;
|
||||
if (this.LoadedProperties.TryGetValue(PropertyName, out adProperty) && Index <= adProperty.Length)
|
||||
return adProperty[Index];
|
||||
if (this.LoadedProperties.TryGetValue(PropertyName, out adProperty))
|
||||
return adProperty.OfType<T>();
|
||||
else
|
||||
return null;
|
||||
return Enumerable.Empty<T>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user