Set Access Request Email on All Sub-Site of a Web Application

Hi all!

Follow a Powershell script to change the Access Request email for all sites in a we b application:

$webapp = Get-SPWebApplication ""
$currentEmail = "";
$newEmail = "";

foreach($site in $webapp.Sites)
   foreach($web in $site.AllWebs)
     $url = $web.url
	 Write-host $url
     if (!$web.HasUniquePerm)
            Write-Host "Access Request Settings is inherted from parent."
			Write-Host "Access Request Settings is enabled."
			write-host $web.RequestAccessEmail
	        if ($web.RequestAccessEmail -eq $currentEmail)
				Write-Host "Email needs to be updated."
				$web.RequestAccessEmail = $newEmail
				Write-Host "Email changed successfully!"

            Write-Host "Access Request Settings not enabled."


Hope this helps you!


See you,


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: