Skip to content

Commit

Permalink
Merge pull request #16 from bitai-cs/fix/ms-ad-useraccount-handling
Browse files Browse the repository at this point in the history
Fix Ms AD user account handling.
  • Loading branch information
bitai-cs authored Jan 27, 2023
2 parents 43eb5fa + a80bb04 commit 1c27500
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/Bitai.LDAPHelper/AccountManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ public AccountManager(ConnectionInfo connectionInfo, SearchLimits searchLimits,



public void InitializeMissingMsADUserAccountDN(LDAPMsADUserAccount userAccount)
{
if (string.IsNullOrEmpty(userAccount.DistinguishedName))
userAccount.DistinguishedName = $"CN={userAccount.Cn},{userAccount.DistinguishedNameOfContainer}";
}

/// <summary>
/// Create a user account in MS Active Directory service
/// https://www.rlmueller.net/Name_Attributes.htm
Expand Down Expand Up @@ -57,7 +63,7 @@ public async Task<LDAPCreateMsADUserAccountResult> CreateUserAccountForMsAD(LDAP
#endregion

//Generate user account DistinguishedName LDAP attribute
newUserAccount.DistinguishedName = $"CN={newUserAccount.Cn},{newUserAccount.DistinguishedNameOfContainer}";
InitializeMissingMsADUserAccountDN(newUserAccount);

#region Initialize and populate LDAP attribute set
LdapAttributeSet ldapAttributeSet = new LdapAttributeSet();
Expand Down
6 changes: 3 additions & 3 deletions src/Bitai.LDAPHelper/Bitai.LDAPHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<Product>LDAP Services Wrappers</Product>
<Description>Library to wrap Novell.Directory.Ldap.NETStandard functionality to make LDAP common queries to search accounts and objects in a Directory Service.</Description>
<Copyright></Copyright>
<Version>6.1.12</Version>
<AssemblyVersion>6.1.12.7</AssemblyVersion>
<Version>6.1.13</Version>
<AssemblyVersion>6.1.13.7</AssemblyVersion>
<PackageIcon>hierarchy_32.png</PackageIcon>
<FileVersion>6.1.12.7</FileVersion>
<FileVersion>6.1.13.7</FileVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>Bitai.LDAPHelper</PackageId>
<AssemblyName>Bitai.LDAPHelper</AssemblyName>
Expand Down

0 comments on commit 1c27500

Please sign in to comment.