$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