/// <summary> /// Creates the principal. /// </summary> /// <param name="primaryKeyId">The primary key id.</param> /// <param name="name">The name.</param> internal static void CreatePrincipal(DirectoryPrincipalType principalType, PrimaryKeyId primaryKeyId, string name) { DirectoryPrincipalEntity principal = (DirectoryPrincipalEntity)BusinessManager.InitializeEntity(DirectoryPrincipalEntity.ClassName); principal["DirectoryPrincipalId"] = primaryKeyId; principal.Type = (int)principalType; principal.Name = name; BusinessManager.Create(principal); }