Hot answers tagged

19

This script should do the trick after few adjustments as its adding new permissions to group which you don't want so you can skip them. function Add-SPPermissionToListGroup { param ($Url, $ListName, $GroupName, $PermissionLevel) $web = Get-SPWeb -Identity $Url $list = $web.Lists.TryGetList($ListName) if ($list -ne $null) { // ...


14

AFAIK, it's only possible to use getByName in SharePoint 2013, not in 2010. See MSDN reference for more information var groupCollection = clientContext.get_web().get_siteGroups(); visitorsGroup = groupCollection.getByName("SomaGroupName");


11

Try below code: This will remove group permission full control $web = get-spweb http://url/to/your/web $group = $web.SiteGroups["Owners"] $ra = $group.ParentWeb.RoleAssignments.GetAssignmentByPrincipal($group) $rd = $group.ParentWeb.RoleDefinitions["Full Control"] $ra.RoleDefinitionBindings.Remove($rd) $ra.Update() $group.Update() $web.Dispose() This will ...


10

SPWeb root = site.RootWeb; SPGroup group = null; // Check if the group exists try { group = root.SiteGroups["The Group Name"]; } catch { } // If it doesn't, add it if (group == null) { root.SiteGroups.Add("The Group Name", member, root.Author, "Your Group Description"); group = root.SiteGroups["The Group ...


7

Internally, all users resides inside a special list known as "user information list" at the root site (/) of any SharePoint site collection. This list can be accessed through http://yoursitecollection/_catalogs/users/simple.aspx Groups are virtual collections of users against this list maintained inside the SharePoint Content Database and have different ...


7

Late answer but, The User Profile is not responsible in this case. SharePoint recognizes AD security groups and attaching permissions to these groups will cause the permissions to be granted to the User. Unfortunately, due to SharePoint caching the user's memberships on login, changes made to a security group are identified only after the cache has expired,...


7

Yes, it is possible in 2010 to find out who added a particular user to a group and when. You do need to be collecting audit data. You can query the audit data with Powershell, for example, to return the information you seek. Here's a good sample script taken from this blog post: $site = Get-SPSite "http://yoursite.company.com" $startDate = Get-Date "...


6

Those groups will not be able to access the folders if the permission for the folder is broken and only the group "XYZ" has permissions to the folder and rest all are removed. UPDATE Sample powershell code: $folders = $list.Folders foreach ($spFolder in $folders) { $PermissionLevel = "PermissionName" ; $group = $web.SiteGroups[$GroupName]; ...


6

Move this line var groups = currentUser.get_groups(); To your getCurrentUser method and make sure to load it this.clientContext.load(groups); before executing the request, this way you will have it loaded in your success-function


6

No, that is not permitted. You could add security groups into the Sharepoint groups if they exist though, distribution lists are not supported.


6

This is something we built in-house: function Add-SPGroup { <# .SYNOPSIS Use Add-SPGroup to create a SharePoint Group. .DESCRIPTION This function uses the Add() method of a SharePoint RoleAssignments property in an SPWeb to create a SharePoint Group. .EXAMPLE Add-SPGroup -webUrl "http://sharepoint.local" ` -groupName "Test ...


5

If your AD group is a security group and you are using SharePoint 2013, the way that AD Groups work are a little different. Each time a user logs into to SharePoint, they receive a token that is their identity for the AD groups they are involved with. There is a property of the Security Token Service called Windows Token Lifetime which is the expiration of ...


5

A crawl is never started by anything changing in SharePoint, neither content nor security changes. A crawl is either started manually or according to the specified schedule. If you're using search, then you probably have a crawl schedule set up which does incremental (and sometimes full) crawls. The full crawls with crawl everything and the incremental ...


5

You have to include the AD Groups in the user profile sync connection. If your AD Groups are not sync'd with the UPS, then it won't be possible. Make sure the UPS Sync connection includes the containers that the AD Groups are in.


5

You are out of luck. a SP group cannot contain any other SP group. It’s a big limitation.Although SharePoint groups can contain (AD) users and AD groups. Check this Technet: http://technet.microsoft.com/en-us/library/cc262690%28v=office.15%29.aspx http://www.spdockit.com/blog/permissions-management-sharepoint-2013-part-two/


5

You can use below snippet Get-SPUser -Web http://server/sites/yoursite | Where { $_.IsDomainGroup } AD group is treated as a special user. So this can be find using the filter IsDomainGroup Update $SPWebApp = Get-SPWebApplication https://*******.com/ foreach ($SPSite in $SPWebApp.Sites) { write-host -foregroundcolor green "Working on Site Collection:...


5

$spWeb = Get-SPWeb "https://spdev" $GroupName="Group 1" if($spWeb.SiteGroups[$GroupName] -ne $null) { $spWeb.SiteGroups.Remove($GroupName) $spWeb.Update() Write-Host "Group Deleted!" } else { Write-Host "Group doesn’t Exists!" }


5

You just need a small change to your PowerShell script. $web = Get-SPWeb http://webUrl $groupOwner = $web.SiteGroups["GroupA"] #this group will own "GroupB" $groupTarget = $web.SiteGroups["GroupB"] $groupTarget.Owner = $groupOwner $groupTarget.Update() For all groups in a web: $web = Get-SPWeb http://webUrl $groupName = "SharePoint Group Name" #this will ...


5

Considering that you are using a SharePoint group and presuming that the Assign a task step is not running inside an App Step, then make sure that everyone can view the membership of the group. Go to the group settings page and the select Everyone option under the "Who can view the membership of the group?" question. The reasoning behind this is that the ...


5

I guess you found "Something went wrong..." in creating the group. The whole point of Office 365 groups is that adding users to the group as members instantly give the access to the sites resources, including files in the document library. You don’t have to worry about manually assigning permissions to all those resources because adding members to the ...


4

Cause: There is different way to delete permission group, mistakenly I have deleted the group from "Permission Tool->Remove user permissions" which shows permission group deleted but it still doesn't allow creating a new group with the same name Cause/Solution-> Deleting group from "permission Tool-> remove user permissions" doesn't delete the group if you ...


4

Creating the group is simple just call SPGroupCollection.Add using (SPWeb oWebsiteRoot = SPContext.Current.Site.RootWeb) { SPGroupCollection collGroups = oWebsiteRoot.SiteGroups; SPUser oUser = oWebsiteRoot.Users["User_Name"]; SPMember oMember = oWebsiteRoot.Users["User_Name"]; collGroups.Add("Group_Name", oMember, oUser, "Description"); } ...


4

No, you will need a custom solution for this! For example an asynchronous list item event handler. But be careful with item level permissions - you should not exceed 1000 unqiue security boundaries in a single list. See Software boundaries and limits for SharePoint 2010.


4

yes it is, look at this Post or this Video showing how to create contact list for sharepoint 2010 EDIT Just got what you wanted to do If the idea is to just use that list as a web part, then i suggest you to look at Site Users web part and add the web part to the landing page, this web part allows you to configure the SharePoint groups that you ...


4

You can use SPContext within a "RunWithElevatedPrivileges" block, but objects you get from "SPContext" such as: SPUser, SPWeb, etc. are not running in elevated privilege, they just take the current user security context. So why not just use "scweb" to get to the "Group". Since "scweb" object is initialized within the "RunWithElevatedPrivileges" block just ...


4

After much research, we found that SharePoint not only caches the token for the logged in user, but also for the groups to which that user does or doesn't belong. Setting the cache expiration as described here fixed everything up. $stsc=Get-SPSecurityTokenServiceConfig $stsc.LogonTokenCacheExpirationWindow = (New-TimeSpan -second 30) $stsc.Update() ...


4

Just an addendum to this as I came across this post while researching an issue we were having, if you call $List.Update() right after the RoleAssignments.Add(), you may hit a race condition and it'll report a save conflict on the $List item. it will however update the RoleAssignment as the .Add commits the change without the need to call .Update() on the ...


4

Create the links using a "Content Editor Web Part" and assign "Target Audiences" to that web part. So that the links can be targeted to appear only to people who are members of a particular SharePoint group or audience. Reference Links: http://msdn.microsoft.com/en-us/library/ee906649(v=office.14).aspx http://social.technet.microsoft.com/Forums/en-US/...


4

If you need the Group Name, unfortunately there is no direct way to do that. But we can get the current user and get user collection for one group. Then you can check the user collection from one group to see whether it contains the current user. https://stackoverflow.com/questions/6428300/get-current-users-group-using-the-sp-2010-javascript-client-side-...


4

if you are working on SharePoint 2013 Version, then it is easy to get current user groupcollection through rest api in javascript. script would be like this : function getCurrentUserGroupColl(UserID) { $.ajax ({ url: "/sites/dev/_api/web/GetUserById("+UserID+")/Groups", type: "GET", headers: { "Accept": "application/json; odata=verbose","X-...


Only top voted, non community-wiki answers of a minimum length are eligible