PowerShell创建SharePoint 权限等级

参考:https://social.technet.microsoft.com/wiki/contents/articles/18661.sharepoint-2010-update-a-permission-level-using-powershell.aspx

$sites = get-spsite -Limit ALL –webapplication http://mywebapplication.com
ForEach ($site in $Sites)
{
    # The URL to the Site Collection
    $spWeb = $site.RootWeb            

    # Enter the Name of the Permission Level to Change
    $PermissionLevel=$spWeb.RoleDefinitions["CustomOwner"]            

    # Enter all the permissions that Permission Level should have enabled
    $PermissionLevel.BasePermissions="ViewListItems, AddListItems, EditListItems, DeleteListItems, ApproveItems, OpenItems, ViewVersions, DeleteVersions, CancelCheckout, ManagePersonalViews, ManageLists, ViewFormPages, Open, ViewPages, AddAndCustomizePages, ViewUsageData, CreateSSCSite, ManagePermissions, BrowseDirectories, BrowseUserInfo, AddDelPrivateWebParts, UpdatePersonalWebParts, UseClientIntegration, UseRemoteAPIs, ManageAlerts, CreateAlerts, EditMyUserInfo, CreateGroups, EnumeratePermissions"            

    $PermissionLevel.Update()
    $spweb.Dispose()
    $spsite.Dispose()
}

原文地址:https://www.cnblogs.com/jpinsz/p/12587801.html

时间: 2024-12-12 15:48:42

PowerShell创建SharePoint 权限等级的相关文章

使用PowerShell 创建SharePoint 网站

使用PowerShell 创建SharePoint 网站 在SharePoint开发中,你应该学会使用PowerShell管理SharePoint站点.SharePoint Management Shell是一个Windows PowerShell模块,你可以用它高效管理SharePoint 用户.站点.网站集和组织. 这里教你简单的语句,创建一个SharePoint网站. 输入一下语句.红色框内信息是按下Enter后出现的. 建立的网站如下: 首先我们需要理解如何使用PowerShell创建站

通过PowerShell创建SharePoint Site Collection。

通过PowerShell创建SharePoint Site Collection,代码如下: Add-PSSnapin microsoft.sharepoint.powershell function CreateTeamSite() { $webApps = Get-SPWebApplication $webAppsUrl = $webApps.Url if($webApps.count -eq 1) { Write-Host "You have only one web applicatio

通过PowerShell创建SharePoint Web

代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PSSnapin Microsoft.SharePoint.PowerShell function createSPWeb() { $webApps = Get-SPWebApplication chooseWebAppAndSelectSite $webApps } function chooseWebAppAndSelectSite($webApps) { Write-Host "Web appli

SharePoint网站测试数据自动化系列——通过PowerShell创建SharePoint Lists

代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PSSnapin microsoft.sharepoint.powershell function CreateSPLists() { $sites = Get-SPSite if($sites.count -eq 0) { Write-Warning "There is no site available." CreateSPLists } else { Write-Host "C

SharePoint网站测试数据自动化系列——通过PowerShell创建SharePoint List Items

代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PSSnapin microsoft.sharepoint.powershell function CreateSPListItems() { $sites = Get-SPSite if($sites.count -eq 0) { Write-Warning "There is no site available." CreateSPListItems } else { Write-Host

Powershell配置SharePoint环境

Powershell配置SharePoint环境 1. 设置outgoing email: 1) Powershell: $loadasm =[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $SPGlobalAdmin = New-Object Microsoft.SharePoint.Administration.SPGlobalAdmin $SPGlobalAdmin.UpdateM

powershell 操作sharepoint命令集

打开SharePoint 2013 Management Shell, and then run as administrator.执行如下命令 1. 添加wsp和安装Add-SPSolution -LiteralPath "C:\DeployResource\WSP\test.wsp"Install-SPSolution -Identity "test.wsp" -WebApplication "http://domain:port/" -GA

Powershell配置SharePoint环境(续)

Powershell配置SharePoint环境 1. 配置incoming email: $loadasm =[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $Farm =[Microsoft.SharePoint.Administration.SPFarm]::Local $IncomingMailService = [Microsoft.SharePoint.Administrat

Sharepoint 权限管理

1.MOSS中的权限结构 MOSS中的权限结构主要有三部分:网站权限,列表权限,个人权限. 网站权限由18种如下图: 列表权限由12种,如下图: 个人权限由三种,如下图: 2.权限级别 上面提供的就是基本的权限,不同的权限组成MOSS中的权限级别.MOSS本身为我们提供了一些权限级别,我们也可以根据自己的需求来自定义. 我们在自定义自己的权限级别的时候可以参考Moss本身的,在他的基础上进行修改,我们编辑现有的网站级别,里面提供了一个复制权限级别的功能,我们可以复制一份在这个基础进行修改来定义我