Home
%3CLINGO-SUB%20id%3D%22lingo-sub-571842%22%20slang%3D%22en-US%22%3ESetting%20Access%20Request%20for%20SharePoint%202013%2F2016%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-571842%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20TECHNET%20on%20Mar%2029%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Hey%20Guys%2C%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Took%20a%20quick%20look%20and%20figured%20how%20to%20set%20Access%20Request%20for%20all%20Site%20Collections%2C%20the%20script%20is%20provided%20AS-IS%20and%20should%20be%20considered%20a%20sample.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20While%20I%20have%20some%20error%20checking%20and%20extra%20logic%20in%20there%20you%20will%20probably%20want%20to%20add%20your%20own%20in%20there.%20%3CBR%20%2F%3E%20Add-PSSnapin%20Microsoft.SharePoint.PowerShell%20%3CBR%20%2F%3E%20%24DefaultEmail%20%3D%20%22%20%3CA%3E%20admin%40weaver.ad%20%3C%2FA%3E%20%22%20%3CBR%20%2F%3E%20Get-SPSite%20%7C%20ForEach-object%20%7B%20%3CBR%20%2F%3E%20%24OwnerEmail%20%3D%20%24null%20%3CBR%20%2F%3E%20%24OwnerEmail%20%3D%20%24_.Owner.Email%20%3CBR%20%2F%3E%20if(%24OwnerEmail%20-eq%20%24null)%20%3CBR%20%2F%3E%20%7B%20%3CBR%20%2F%3E%20%24OwnerEmail%20%3D%20%24DefaultEmail%20%3CBR%20%2F%3E%20%7D%20%3CBR%20%2F%3E%20%24_.AllWebs%20%7C%20ForEach-Object%20%7B%20%3CBR%20%2F%3E%20if(!%24_.RequestAccessEnabled)%20%3CBR%20%2F%3E%20%7B%20%3CBR%20%2F%3E%20%24_.RequestAccessEmail%20%3D%20%24OwnerEmail%20%3CBR%20%2F%3E%20%7D%20%3CBR%20%2F%3E%20%7D%20%3CBR%20%2F%3E%20%7D%20%3CBR%20%2F%3E%20Pax%20%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-571842%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TECHNET%20on%20Mar%2029%2C%202018%20Hey%20Guys%2CTook%20a%20quick%20look%20and%20figured%20how%20to%20set%20Access%20Request%20for%20all%20Site%20Collections%2C%20the%20script%20is%20provided%20AS-IS%20and%20should%20be%20considered%20a%20sample.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-571842%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Erequest%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
First published on TECHNET on Mar 29, 2018
Hey Guys,

Took a quick look and figured how to set Access Request for all Site Collections, the script is provided AS-IS and should be considered a sample.

While I have some error checking and extra logic in there you will probably want to add your own in there.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$DefaultEmail = " admin@weaver.ad "
Get-SPSite | ForEach-object {
$OwnerEmail = $null
$OwnerEmail = $_.Owner.Email
if($OwnerEmail -eq $null)
{
$OwnerEmail = $DefaultEmail
}
$_.AllWebs | ForEach-Object {
if(!$_.RequestAccessEnabled)
{
$_.RequestAccessEmail = $OwnerEmail
}
}
}
Pax