Bug Fix #58: Fail to assign MacSecureEnrol devices
Various code-paths *assumed* valid domain account ids as long as an id existed (simple null-check). Correct checks for valid domain account ids has been implemented.
This commit is contained in:
@@ -177,13 +177,11 @@ namespace Disco.BI.Extensions
|
||||
}
|
||||
|
||||
// Update AD Account
|
||||
if (!string.IsNullOrEmpty(d.DeviceDomainId))
|
||||
if (ActiveDirectory.IsValidDomainAccountId(d.DeviceDomainId))
|
||||
{
|
||||
var adMachineAccount = ActiveDirectory.RetrieveADMachineAccount(d.DeviceDomainId);
|
||||
if (adMachineAccount != null)
|
||||
{
|
||||
adMachineAccount.SetDescription(d);
|
||||
}
|
||||
}
|
||||
|
||||
return newDua;
|
||||
@@ -191,7 +189,7 @@ namespace Disco.BI.Extensions
|
||||
|
||||
public static ADMachineAccount ActiveDirectoryAccount(this Device Device, params string[] AdditionalProperties)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Device.DeviceDomainId))
|
||||
if (ActiveDirectory.IsValidDomainAccountId(Device.DeviceDomainId))
|
||||
return ActiveDirectory.RetrieveADMachineAccount(Device.DeviceDomainId, AdditionalProperties: AdditionalProperties);
|
||||
else
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user