Add branded default provider and enforced enrollment

This commit is contained in:
2026-09-01 11:20:06 -06:00
parent da01343985
commit f3afd62993
22 changed files with 787 additions and 17 deletions
@@ -100,7 +100,7 @@ public sealed class ActiveDirectorySynchronizer(BrokerOptions options) : IActive
user.Properties["pwdLastSet"].Value = -1;
user.CommitChanges();
TryApplyProfile(user, identity, profile);
TryApplyProfile(user, identity, profile, options.DefaultCompany);
TryEnsureRemoteDesktopGroupMembership(user);
return new DirectorySyncResult(
@@ -119,23 +119,23 @@ public sealed class ActiveDirectorySynchronizer(BrokerOptions options) : IActive
private static void TryApplyProfile(
DirectoryEntry user,
UserIdentity identity,
InstitutionalProfile? profile)
InstitutionalProfile? profile,
string defaultCompany)
{
if (profile is null)
{
return;
}
try
{
SetOptionalProperty(user, "displayName", profile.DisplayName);
SetOptionalProperty(user, "mail", profile.Email);
SetOptionalProperty(user, "title", profile.JobTitle);
SetOptionalProperty(user, "department", profile.Department);
SetOptionalProperty(user, "employeeType", profile.EmployeeType);
if (string.Equals(profile.EmployeeNumber, identity.NumericId, StringComparison.Ordinal))
SetOptionalProperty(user, "company", defaultCompany);
if (profile is not null)
{
SetOptionalProperty(user, "employeeID", profile.EmployeeNumber);
SetOptionalProperty(user, "displayName", profile.DisplayName);
SetOptionalProperty(user, "mail", profile.Email);
SetOptionalProperty(user, "title", profile.JobTitle);
SetOptionalProperty(user, "department", profile.Department);
SetOptionalProperty(user, "employeeType", profile.EmployeeType);
if (string.Equals(profile.EmployeeNumber, identity.NumericId, StringComparison.Ordinal))
{
SetOptionalProperty(user, "employeeID", profile.EmployeeNumber);
}
}
user.CommitChanges();