Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 720787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:47:55+00:00 2026-05-14T05:47:55+00:00

I have code which as been working against an older Active Directory server and

  • 0

I have code which as been working against an older Active Directory server and now I have pointed it to a new Windows Server 2008 AD system. Now the group names are coming back with SIDs and not names. I do not know enough about the AD side to know if there is a way to make the new AD server work like the older AD server.

My code is based on the Active Directory Role Provider for BlogEngine.NET on Codeplex.

http://blogengineadrp.codeplex.com/sourcecontrol/network/Show?projectName=BlogEngineADRP&changeSetId=5843#138380

I believe this the line that I will need to adjust.

IdentityReferenceCollection irc = ExpandTokenGroups(user).Translate(typeof(NTAccount));

Right now ExpandTokenGroups is returning the SID value while Translate has worked to change it into the human readable group name. I would like to know if I should pass in a different type than NTAccount to Translate.

What can I do to get the group name?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:47:56+00:00Added an answer on May 14, 2026 at 5:47 am

    This is my solution in C# which is not optimal but it is working.

        public override string[] GetRolesForUser(string username)
        {
            // list to store names of roles
            List<String> roles = new List<string>();
    
            // get the user directory entry
            DirectoryEntry user = getUser(username);
    
            foreach (String prop in user.Properties["memberOf"])
            {
                if (prop.IndexOf("CN=") == 0 && prop.IndexOf(",") != -1)
                {
                    var groupName = prop.Substring("CN=".Length, prop.IndexOf(",") - "CN=".Length);
                    roles.Add(groupName);
                }
            }
    
            return roles.ToArray();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code below which has been working on devices of type Windows Mobile
I'm new to concurrent programing and have been working on code which has a
I have several of these in my code which have been working fine so
I have been working on a multiple inheritance code which looks similar to this:
I have some code which is been running by a backgroundworker I'd like some
I have been refactoring throwaway code which I wrote some years ago in a
I have been given some generated code which looks like so: <form id=form1 method=post
I have code which performs query on Jboss server. It has JNDI based datasource
I already have code which lazy loads scripts on request. My issue now is
I have a code that has been working for almost 4 years (since boost

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.