Fix #141 preserve computer names for non-domain joined devices

This commit is contained in:
Gary Sharp
2024-01-11 16:27:40 +11:00
parent 974a07f3bb
commit 85d51c0e45
6 changed files with 44 additions and 33 deletions
+8 -6
View File
@@ -189,14 +189,16 @@ namespace Disco.Services
if (ActiveDirectory.IsValidDomainAccountId(d.DeviceDomainId))
{
var adMachineAccount = ActiveDirectory.RetrieveADMachineAccount(d.DeviceDomainId);
try
if (adMachineAccount != null)
{
if (adMachineAccount != null)
try
{
adMachineAccount.SetDescription(d);
}
catch (Exception ex)
{
SystemLog.LogWarning($"Unable to update AD Machine Account Description for {d.DeviceDomainId}: {ex.Message}");
}
catch (Exception ex)
{
SystemLog.LogWarning($"Unable to update AD Machine Account Description for {d.DeviceDomainId}: {ex.Message}");
}
}
}