none
Cannot Update Web's RequestAccessEmail property

    Question

  • This simple script is unsuccessful:

    $web=Get-SPWeb [path to website/subsite]

    $web.RequestAccessEmail="SharePoint.Admin@domain.com"

    $web.Update()

    After executing this script, and checking the web's RequestAccessEmail property, i find that it hasn't changed.  The web's HasUniquePerm and RequestAccessEnabled properties are both true.

    What am I missing?  if you can assist, I would be very greatful.  I'm looking for a more automated method of updating about 200 subsites.  I was first attempting to verify updating a single web's property and then move on to a simple foreach loop to do all of them.  All the postings I have read thus farm only call the web's Update method.  Is there something else that must also be done?

    Tuesday, April 21, 2015 8:15 PM

Answers

  • It does work.

    Previously, when I checked the RequestAccessEmail property, after setting it via PowerShell, I checked whether the property was updated by executing:

    $web.RequestAccessEmail

    This returned (I thought) the current value in the property.  However, I discovered that if I checked this property online, by going: Site Settings > Site Permissions > Access Request Settings, the Request Access Email had in fact been updated.  Furthermore, by comparing the results between what PowerShell returned and what was visible online, I found that the value for RequestAccessEmail returned by PowerShell was the most recent one - 1.  In other words, if I made changes A, B and C, in that order, PowerShell returned B while online was shown C.  The value returned by PowerShell was always one change behind. 

    • Marked as answer by Stephan Bren Wednesday, April 22, 2015 2:28 PM
    • Edited by Stephan Bren Wednesday, April 22, 2015 2:28 PM
    Tuesday, April 21, 2015 8:35 PM

All replies

  • It does work.

    Previously, when I checked the RequestAccessEmail property, after setting it via PowerShell, I checked whether the property was updated by executing:

    $web.RequestAccessEmail

    This returned (I thought) the current value in the property.  However, I discovered that if I checked this property online, by going: Site Settings > Site Permissions > Access Request Settings, the Request Access Email had in fact been updated.  Furthermore, by comparing the results between what PowerShell returned and what was visible online, I found that the value for RequestAccessEmail returned by PowerShell was the most recent one - 1.  In other words, if I made changes A, B and C, in that order, PowerShell returned B while online was shown C.  The value returned by PowerShell was always one change behind. 

    • Marked as answer by Stephan Bren Wednesday, April 22, 2015 2:28 PM
    • Edited by Stephan Bren Wednesday, April 22, 2015 2:28 PM
    Tuesday, April 21, 2015 8:35 PM
  • Hi,

    Thank you for your detailed additional feedback on how you were successful in resolving this issue. Your solution will benefit many other users.

    Have a nice day!

    Best Regards,

    Lisa Chen


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, May 08, 2015 10:47 AM
    Moderator