Created
August 31, 2018 09:15
-
-
Save rheid/205f14a96cbd093653d4ebada47153b0 to your computer and use it in GitHub Desktop.
Update SharePoint RequestAccessEmail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$webapp = Get-SPWebApplication "https://WEBAPP" | |
foreach($site in $webapp.Sites){ | |
foreach($web in $site.AllWebs){ | |
if ($web.HasUniqueRoleDefinitions){ | |
if($web.RequestAccessEnabled){ | |
Write-Host $Web.URL | |
Write-Host $Web.RequestAccessEmail | |
Write-Host "---" | |
if ($web.RequestAccessEmail -eq '[email protected]'){ | |
Write-Host $Web.URL "Update RequestAccessEmail" | |
Write-Host "---" | |
$web.RequestAccessEmail ="[email protected]" | |
$web.Update() | |
} | |
} | |
else { | |
Write-Host "Access Request Settings not enabled." $Web.URL | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment