Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Script

Name

Description

Last Modified Date

Download

ResetWebAppFullControlPermissionsResetWebApplicationRightsMaskToFullMask.ps1

 Reverts the rights mask property on a web application to 
full mask (the original non-modified value)
02/05/2013

None

Issue

An issue occurred with an implementation of TRIM Context into SharePoint.  The TRIM configuration components checked for the FullMask permissions for the service accounts.

...

Code Block
languagepowershell
# Name: ResetWebApplicationRightsMaskToFullControlResetWebApplicationRightsMaskToFullMask.ps1
# Purpose: Reverts the rightsmask property on a web application to full mask (the original non-modified value)
param
( 
	[string]$webAppUrl = $(read-host "Specify a URL for the web application to update")
)
try
{
	if([string]::IsNullOrEmpty($webAppUrl)) {throw "Cannot proceed without valid web application url"}
	$wa = get-spwebapplication $webAppUrl
	if($wa -eq $null)	{throw ("Cannot locate web application at url: " + $webAppUrl)}
	$wa.RightsMask = [Microsoft.SharePoint.SPBasePermissions]::FullMask
	$wa.Update()
	Write-Host "Web application $webAppUrl rights mask updated to: " $wa.RightsMask " (" $wa.RightsMask.value__ ")"
}
catch
{
	Write-Host -f Red "Error $_"
	exit 9999
}