Questions tagged [spgroup]

12 questions
3
votes
4 answers

How to add AD group to SharePoint 2010 SPGroup programmatically?

Been trying to add an AD group to an SPGroup programmatically and it's not working. I've tried: SPGroup.AddUsers("myADgroup"); and SPGroupCollection.Add(groupName, currentUser, "myADgroup", groupDescription); I've tried it both with domain and…
Fongers
  • 155
  • 1
  • 1
  • 9
1
vote
1 answer

Changing SPRoleAssignment to SPList without affecting subfolders

When I remove the roleassignments for the group on the list, this also removes the roleassignments for the subfolders. (BreakInheritance == True for the subfolders. ) My code: //BreakRoleInheritance on…
Morten
  • 87
  • 1
  • 9
1
vote
1 answer

SharePoint - Updating "Person or Group" field with an SPGroup

As the title states, such a simple goal, yet nothing i try works and I can't find anything on the web. SPUser user = ... item["User"] = user; SPGroup grp = ... item["User"] = grp; Assigning an SPUser works, assigning an SPGroup fails, "Invalid…
Neovivacity
  • 109
  • 2
  • 15
0
votes
2 answers

Restrict users to view a particular page in sharepoint

i have a sharepoint site http://spp/sitepages/page2.aspx I have a group called "Group1" with full control. There are two users "User1" and "User2".So both the users will have full control and both of them can make any changes in page2.aspx. Now this…
John
  • 81
  • 1
  • 1
  • 10
0
votes
1 answer

Unable to Check Permission of a SharePoint Group

I tried to use examples from the net to check if a group has a specific permission in my SP site. Below is my code snippet: if (roleAssignment.Member is SPGroup) { //displays as 1 …
gymcode
  • 4,431
  • 15
  • 72
  • 128
0
votes
1 answer

SPGroup - Get Child groups

I am currently getting a list of groups a user is a member of using the following code: SPUser user = SPContext.Current.Web.CurrentUser; var groupNames = (from SPGroup userGroup in user.Groups select userGroup.Name).ToList(); What I now need to do,…
Mick Walker
  • 3,862
  • 6
  • 47
  • 72
0
votes
1 answer

Adding Collection of SPUsers into SPGroup

We can add an SPUser into an SPGroup by objSPGroup.Users.Add(objSPUser). I need to add SPUserCollection into one SPGroup. How can i do it?
john
  • 121
  • 1
  • 3
  • 17
0
votes
2 answers

membership requests e-mail address for SPGroup sharepoint

While creating Group in sharepoint we have an option "Send membership requests to the following e-mail address" It is used to send membership request to the SPGroup. But how can we set the e-mail address programmatically
john
  • 121
  • 1
  • 3
  • 17
0
votes
2 answers

How can I list all SPUser objects in a SPGroup?

I need to retrieve all SPUser's from a SPGroup. Unfortunately, the group may contain Active Directory groups, so a simple SPGroup.Users is not enough (I'd just get a single SPUser for the AD group, with the IsDomainGroup property set to true). Does…
skolima
  • 31,963
  • 27
  • 115
  • 151
0
votes
1 answer

Create Multiple SPGroups in all the subsites if the SPGroups doesn't exist using power Shell script

I need to create 2 SPGroups in the SubSites with Multiple AD Group members added to the group. For Example, I have sub sites x,y,z under my Site I have groups Group A, Group B Members of Group A are Member1, Member2, Member3 Members of Group B…
0
votes
1 answer

user rights to add document in library SharePoint 2010

I want to check, if user can add document in document library then custom action is enabled. I used this article. And then I encountered the following problem: I don't know how check user rights of adding for this library. I try to use SPGroup of…
0
votes
2 answers

Add Active Directory group user to a SharePoint Site Groups

we got a requirement to have user from Active Directory Group get added to a share point group on a regular basis. In other words we would need to syncronize the user in AD group to a Share Point group. We are looking at a service / workflow to…