none
Get Access Requests list via Powershell (to make changes to permissions) RRS feed

  • Question

  • Hello,

    We have an issue where there seems to be a disconnect on the Access Requests list as full control user cannot accept/decline.

    After further reading, the original owners group must have been removed/deleted/etc..

    I am trying to get the GUID of the list via Powershell so we can open the List Settings and fix permissions, but I am not able to 'find it on any webs in the site collection:

    Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue
    $siteUrl = "https://menet.domain.com/sites/fakeName"
    
    $spsite = Get-SPsite $siteUrl 
    
    foreach ($web in $spsite.AllWebs)
    {   
        $list = $web.Lists["Access Requests"] #THIS DOESNT WORK
        Write-Host $list.Guid
       
         foreach ($list in $spsite.AllWebs)
            {
    
             if ($list.Title -eq "Access Requests")
             { 
                Write-Host "found it" #THIS DOESNT WORK EITHER
             }
            }
    }
    $spsite.dispose()

    Am I missing something?  I tried to find this list via SPD and now Powershell and I can't seem to 'find it'. 

    I am running script as farm account too! 

    Sources I've looked at:

    Issue at hand: https://social.technet.microsoft.com/Forums/azure/en-US/1f015aac-25f9-4a46-872c-34899b66da9a/access-denied-error-while-accessing-site-settings-access-requests-and-invitations?forum=onlineservicessharepoint

    https://social.technet.microsoft.com/wiki/contents/articles/31157.manage-sharepoint-online-access-requests-using-powershell.aspx#Approve_or_Decline_Access_Requests

    https://gallery.technet.microsoft.com/Manage-Approval-Requests-2f48e7ee


    Herschel

    Wednesday, February 1, 2017 4:52 PM

Answers

  • Hi,

    Please use the following PowerShell script.

    $siteUrl = "https://menet.domain.com/sites/fakeName"
    
    $spsite = Get-SPsite $siteUrl 
    
    foreach ($web in $spsite.AllWebs)
    {        
         foreach ($list in $web.Lists)
    	{
    
    		 if ($list.Title -eq "Access Requests")
    		 { 
    			Write-Host "found it"			 
    			Write-Host $list.ID
    		 }
    	}
    }
    $spsite.dispose()

    Best Regards,

    Dennis


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

    • Proposed as answer by mohit.goyal Thursday, February 2, 2017 9:54 AM
    • Marked as answer by JKHerschel Thursday, February 2, 2017 2:00 PM
    Thursday, February 2, 2017 8:39 AM
    Moderator

All replies

  • Hi,

    Please use the following PowerShell script.

    $siteUrl = "https://menet.domain.com/sites/fakeName"
    
    $spsite = Get-SPsite $siteUrl 
    
    foreach ($web in $spsite.AllWebs)
    {        
         foreach ($list in $web.Lists)
    	{
    
    		 if ($list.Title -eq "Access Requests")
    		 { 
    			Write-Host "found it"			 
    			Write-Host $list.ID
    		 }
    	}
    }
    $spsite.dispose()

    Best Regards,

    Dennis


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

    • Proposed as answer by mohit.goyal Thursday, February 2, 2017 9:54 AM
    • Marked as answer by JKHerschel Thursday, February 2, 2017 2:00 PM
    Thursday, February 2, 2017 8:39 AM
    Moderator
  • Thank you!  always one little issue.

    I had 

    foreach ($list in $spsite.AllWebs)

    and it should have been

     foreach ($list in $web.Lists)
    For anybody else looking into this issue, I was also able to get the GUID using SharePoint Manager 2013, awesome tool.


    Herschel

    Thursday, February 2, 2017 2:02 PM