How To See What SharePoint Sites A User Has Access To

SharePoint administrators often need to know which sites a user can access. By utilizing PowerShell or the SharePoint search feature, you can easily retrieve this information.

To see what SharePoint sites a user has access to in SharePoint Online, you have two options:

1. Using PowerShell:

To determine user access using PowerShell, you will need to connect to SharePoint Online and run a script. By setting the user’s email address, you can retrieve a list of site collections in the tenant. Then, you can loop through each collection and check if the user has access. If they do, the script will provide the site collection URL, allowing you to identify the sites the user can access.

2. Utilizing the SharePoint Search Feature:

An alternative method to determine user access is by utilizing the SharePoint search functionality. By logging into office.com, you can perform a search using the criteria “contentclass:STS_Site”. This will narrow down the search results to SharePoint sites. Then, click on the “Sites” tab to view all the sites accessible to the user.

Additionally, you can create a page using the Highlighted Content web part to display all the sites the user has access to, providing an easy-to-access overview.

As a SharePoint administrator, having the ability to quickly and accurately identify the sites a user can access is crucial in managing permissions and ensuring the right level of access is granted.

Using PowerShell to Determine User Access

PowerShell provides a powerful method to check a user’s access to SharePoint sites. By following these steps, you can obtain a comprehensive list of the sites they can access.

  1. Open PowerShell on your computer and connect to SharePoint Online using the following command:

Connect-SPOService -Url https://yourdomain-admin.sharepoint.com

  1. Set the user’s email address by running the command:

$UserEmail = "user@example.com"

  1. Retrieve all site collections in the tenant and loop through each collection to check if the user has access. Use the following script:

$SiteCollections = Get-SPOSite -Limit All
foreach ($SiteCollection in $SiteCollections){
$SiteURL = $SiteCollection.Url
$UserHasAccess = Test-SPOSite -Identity $SiteURL -User $UserEmail
if ($UserHasAccess){
Write-Host "User has access to:" $SiteURL
}
}

  1. The script will output the site collection URLs where the user has access. You can further enhance it by exporting the results to a CSV file or creating a custom report.

This approach allows you to quickly determine which SharePoint sites a user can access, providing valuable insights for administration and access control purposes.

Command Description
Connect-SPOService Connects to SharePoint Online
Get-SPOSite Retrieves all site collections
Test-SPOSite Checks if the user has access to a site
Write-Host Displays the site collection URL

Utilizing the SharePoint Search Feature

The SharePoint search feature offers a convenient way to discover the sites a user has access to. By following these instructions, you can quickly retrieve a comprehensive list of accessible SharePoint sites.

To begin, log into office.com using your SharePoint Online credentials. Once logged in, locate the search box at the top of the page. Type “contentclass:STS_Site” into the search box and hit enter. This search query will filter the results to only show SharePoint sites.

Next, navigate to the “Sites” tab in the search results. Here, you will find a list of all the SharePoint sites that you have access to. This includes all the sites you are a member of, as well as those you have been granted specific permissions to.

Alternatively, you can create a page using the Highlighted Content web part to display all the sites you have access to. This allows you to showcase the sites in a visually appealing manner, making it easier to navigate and access the sites you need.

Meet the Author

Abdul Rahim has been working in Information Technology for over two decades. Learn how Abdul got his start as a Tech Blogger , and why he decided to start this Software blog. If you want to send Abdul a quick message, then visit his contact page here.