PowerShell script to show the access request email address for all sites
I have written this script to determine whether or not Access Requests are enabled for each site within a given Site Collection, and if so display the email address specified. The colour coded output makes it easy to see which sites have Access Requests enabled.
# ===========================================
#
# SharePoint 2010 PowerShell script to list
# the Access Request address for all sites
# within a given Site Collection
#
# Author: David Webb
# Date: 15th November 2012
# Version: 1.0
#
# ===========================================$Webs = Get-SPWeb -Site “http://intranet”
ForEach ($Web In $Webs)
{
If ($Web.RequestAccessEnabled -eq “True”)
{
Write-Host $Web.title “- ” -NoNewLine; Write-Host “enabled and sent to” $Web.RequestAccessEmail -ForegroundColor “Green”
}
Else { Write-Host $Web.title “- ” -NoNewLine; Write-Host “disabled” -ForegroundColor “Red”
}
}
Here is a screenshot of the output: