Follow a Powershell script to change the Access Request email for all sites in a web application:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | $webapp = Get-SPWebApplication "http://yourwebapplication"$currentEmail = "current.email@company.com";$newEmail = "new.email@company.com";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." } elseif($web.RequestAccessEnabled) { 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 $web.Update() Write-Host "Email changed successfully!" } } else { Write-Host "Access Request Settings not enabled." } }} |
No comments:
Post a Comment