Try Now
More in this section

Forums / Bugs & Issues / Running the No Admins Analytic fix

Running the No Admins Analytic fix

2 posts, 0 answered
  1. shane
    shane avatar
    1 posts
    07 Jan 2015
    08 Jan 2015
    Link to this post


    We run sitefinity 5.1 and for some time now I have been trying to get the No administrator users are listed when configuring Sitefintiy Analytics Fix to work, but I keep getting errors. I have dodged a few errors but this new one I can't seem to get past. Below I have attached my C# code, aspx file, and the error presented on the page. I have also maxed out the connection time out on my application pool. 

    C# Code(FileName: FixSFAnalyticsNoAdminUsers.aspx.cs):

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Sitefinity;
    using Telerik.Sitefinity.Security;
    using Telerik.Sitefinity.Security.Model;
    namespace SitefinityWebApp
        public partial class FixSFAnalyticsNoAdminUsers : System.Web.UI.Page
            protected void Page_Load(object sender, EventArgs e)
                var count = 0;
                //Get the collection of registered providers
                var providers = UserManager.GetManager().Providers;
                foreach (var provider in providers)
                    //Load managers
                    UserManager customproviderUsersManager = UserManager.GetManager(provider.Name);
                    customproviderUsersManager.Provider.SuppressSecurityChecks = true;
                    UserProfileManager profileManager = UserProfileManager.GetManager();
                    profileManager.Provider.SuppressSecurityChecks = true;
                    //Get all users for this provider
                    var customproviderUsers = customproviderUsersManager.GetUsers();
                    foreach (var user in customproviderUsers)
                        //Load the user profile for each user
                        var userProfile = profileManager.GetUserProfile(user.Id, typeof(SitefinityProfile).FullName);
                        //If there's no profile, create one
                        if (userProfile == null)
                            SitefinityProfile sfProfile = profileManager.CreateProfile(user, Guid.NewGuid(), typeof(SitefinityProfile)) as SitefinityProfile;
                            sfProfile.FirstName = user.FirstName;
                            sfProfile.LastName = user.LastName;
                    //Commit changes
                totalCount.Text = count.ToString();

    aspx code (FileName: Fix.aspx):

    <%@ Page Language="C#" AutoEventWireup="true" Debug="true" CodeFile="FixSFAnalyticsNoAdminUsers.aspx.cs" Inherits="SitefinityWebApp.FixSFAnalyticsNoAdminUsers" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <form id="form1" runat="server">
        <span>Total UserProfiles created:</span>
            <asp:Label ID="totalCount" runat="server" />


     The error is attached in the form of a .PNG

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    17 Oct 2016
    13 Jan 2015
    Link to this post
    Hi Shane,

    The error seems related to missing users returned or issue with the data read on that provider.

    Please check and ensure that you have such users and/or ensure you can get the users from that provider.

    Svetoslav Manchev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered