# --------Input Parameters $groupName="NT AUTHORITY\authenticated users"$siteURL="http://servername:1111/"$listName="Shared Documents"$site=Get-SPSite $ siteURL$web=$site.RootWeb$list=$web.lists[$listName]$collRoleDefinitions = $web.RoleDefinitions;$collRoleAssignments = $list.RoleAssignments;$list.BreakRoleInheritance($false);$user=$web.EnsureUser($userName);$roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($user.LoginName, $user.Email, $user.Name, $user.Notes);$collRoleDefinitionBindings = $roleAssignment.RoleDefinitionBindings;$collRoleDefinitionBindings.Add($collRoleDefinitions["Contribute"]);$collRoleAssignments.Add($roleAssignment);$list.Update();
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: