.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Enymerating users from the group name

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net

Can i use the code below to retreive the users from a group.....the only think i am missing is authentication .....

Please let me know what i have done wrong,,,,

i used the same path to retreive groups and all and it works gr8 but cant retreive users from a group....

please let me know how i can do it.................................

public partial class Users : System.Web.UI.Page
        static Hashtable searchedGroups = null;
        protected void Page_Load(object sender, EventArgs e)
            StringCollection groups = this.getUsersInGroup("groupname");
            foreach (string gp in groups)
                Response.Write("<br><b>" + gp + "</b>");


View Complete Post

More Related Resource Links

Customized list views and permissions to specific group users

Hi, I have created a custom list with 20 field/columns in wss3.0. I had four user groups(group1, group2,....3.....4) in my site collection with various levels of permissions. I have created four custom views (Group 1 view, Group2 view,...etc)in my list. Each view contains only certain fields out of 20. For example group 1 view contains field 1, 5, 7,10 and 13 of every item in my list.  My requirement is that when a user login, who is a member of group1. he should be able to view only Group1 view fields. He should not able to view other field/columns. I tried creating another field/column called as restricted users and wrote group names in that. In the View edit page I selected " show item when the column 'restricted users' is equl to [Me]. But I did not get it. Kindly help it out any one either programmatically or UI based. Thanks   

How to add a user to "Debug Users" group

I want a given user to be added to "Debug Users" group. This is what the requirement is. To be very frank I am not sure where I can see this group in the computer. I tried to locate this in "computer management" -> Groups but couldn't find it. Can any body please throw some light on this. Whats the use of this group, where can i find this & how to add a user to this group?

In a group calendar, can items be made visiable to all users by default without adding them as atten

Well the title says it all really. We have a functioning sp 2010 site, setup this weekend, that's working great so far.  Primarily its being used for the company manual and procedures (a wiki site).  Search is working well and so on. I added a calendar with the intention of showing key company activities, plus holiday information and who's out at meetings.  We're a small company and this is unlikely to get ridiculously except on exceptional days. As it stands, when i create an item (for example someone out for a weeks holiday) unless another user adds one of the 'attendees' of the holiday event to the calendar it doesn't show up.  If I add all users as attendees then they can all see it by default. However, if I show that our chairman is attending a meeting at a client, then I can't explicitly say that the chairman is an attendee because for everyone to see it, they have to be attendees as well. I nsoed around a little and thought target audiences might be the way to go.  I configured all users and manager relationships, compiled the audience (it shows the right number of users).  However, if I setup a meeting with the chairman as an attendee, and the whole company audience as the target audience, then people still can't see it. Back to square one. So, is there an actual answer to this?  A different type of calendar, a query that

Problem sending an email to all users of a sharepoint group

Here is what we did so far: 1. created an OU in AD and delegated full control to Sp service account 2. Configured incoming email settings 3. on sp site created a new group with full control permission 4. created an email distribution group for this group with an email address 5. in CA approved the distribution group to be created in OU 6. In Ad we can check the OU is there with the specified email address 7. added users to the group, but when we send an email to the group email address it does not forward to the group members. Please advice  

Make a list field ediable by a group of users or hidden to everyone else.


I understand how to hide a field, but this hides it for everyone. My team want to hide it for the users and show it for our team. The field we want hidden from other users are Assigned to, Due Date, and Due Date, but we want our team to be able to edit these fields; not the other users. Is it any way to do this? Thanks for the help.



Profile synchronization problem - can successfully import single users but not from a group - can yo


I can successfully import a single user into SharePoint 2010 from AD (proves settings permissions are correct) and the number of user profiles increases and I can locate the user including profile data from active Directory. But when I try to import an Active Directory global security group no users get migrated. In fact the single users profile gets deleted.

Can somebody explain whether it is possible to migrate users into SharePoint 2010 from with security groups in Active Directory?

Also when I retried to import the group of users it deleted the single user that I had successfully imported, I didn’t think this was possible, I ran an incremental synchronization, i need to import roughly 2000 users and was going to do it in stages to make sure all users were imported but if the process can remove users then each sync run could be adding users and removing users, how will I ever keep track?

Below is the synchronization run report, are there logs files that could give me more information?

stsadm to list users in a group


Hi all,

 Does anybody knows how to enumerate users in a Sharepoint 2007 group ? I have a particular case where users cannot be displayed in the UI.

 The closest I found is Enumusers but it lists users of a site collection or subsite.




Show users based on ad-security group or OU


Will it somehow be possible to show members of a AD group ?

We have some superusers, and they all have the ad-group: super_users.

Can i show all members somehow ?

Maybe by a search flag, so it is just a link to a search result ?

Jakob Olsen

How to handle a group of temporary users


I have a new site collection. Several hundreds of users will access it.  The user credentials are in an excel spread sheet.

How to add these users.  I don't want to mess up with current users.

I can think of 2 options

1. Using FBA and save these users into SQL database

2. Creating a new OU in Active Directory. And add  users to the AD.

I don't have much time and I prefer to do 2.

My questions are:

Is it doable? If there are identical user names in different OU, what is going to happen?

Getting list of users under a particular user group id


Given a particular user group id, how can we most quickly retrieve the list of users under that user group id?

Please provide sample code  and/or example links.

Thanks for any help.

Alert Me not working for AD group users



I have an AD Group. I have added this AD group to the permission level for list and the site that contain the list. These people were awarded the rights I set for the group and they are able to access the site and list. They are able to edit and change list as they have contribute rights. Only thing missing is the notification, when these people set an Alert me on the list, they receive the email stating their registration for the notification. Though, when they go and change the content of the list they receive no email notification. What is weird is that when I add users manually to SharePoint group all works fine. I have many users in my AD group. I would prefer to use my AD group. I have checked that AD group security list is email enabled and that exchange server does allow reception to everyone.  The Ad group list is working as I can send an email to all people within the Ad group. I looked at the log there were no related errors to the notification. I know that registration emails are handled, differently than alert emails as alert emails are handled by the timer job I checked if the timer job is ok too. 

Email Users In a Group


I am working on a membership confirmation system.

Three groups have been setup in Ldap for this confirmation process:

1. Account Registration Admins
2. Account Registration Cyber Security
3. Account Registration Sponsors

When the user first registers it sends an email out to their sponsor.  Once approved I need a new confirmation to be sent to all users in the Cyber Security group.

Can anyone help me pull all users from that group, loop through them, and send an email?  Ldap querying is not a strong point for me.

Missing profile pics for some users in Group lists


For some reason, most of the profile pics that people upload don't appear in Group lists.  The profile imagine appears just fine in My Site/My Profile, as well as in the Search Center, but we just see the default picture placeholder image for them in a Group list.  There are a few users, though, whose images appear just fine in all locations.

Not sure where to look...  any pointers?

Group Users


How can I extract only groups for which I have permission to read user list?


In above way I extract all groups:


public void GetAllUsersInGroups(string weburl)


            ClientContext ctx = new ClientContext(weburl);




Error 5566 using UserGroup.asmx to return current users SharePoint group memberships?


Hi all,

I am trying to return the groups that the current user is a member of using the Getgroupcollectionfromuser operator in data connection with InfoPath 2010. So I can use that data to determine who is able to see specific fields on the form, which will be a browser form.

I tried this way as a similar question was raised here.

When adding the data connection I use the method stated here, but select the Getgroupcollectionfromuser operator instead. But when I enter the a value in "Set sample value" and not in "Set value" I get the error below when I open a new item. I am also using a data connection to another list, that just has one field and one item, which will be used to set the conditions on the fields to hide them.

An error occurred while trying to connect to a Web service.

An entry has been added to the Windows event log of the server.

Log ID:5566

I have been looking around the web for a clue as to what I am not doing right, but have

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Enabling Users to Maintain SharePoint Content

When SharePoint is installed as a corporate intranet, there is a considerable amount of effort involved in maintaining the content to keep the site relevant. As we discussed in the first few parts of this series, SharePoint has many built-in features to reduce the burden on the site administrator.

Some areas of the site usually contain less-dynamic information. Internal memos and corporate policies are common examples of this information. One option for this information is to post these documents in a document library. Documents in a library are often stored in a few different formats: Word, Acrobat (PDF), or HTML. Each of these formats has its drawbacks.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend