> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/automation/runbooks/runbook-references/org/collab/list-sharepoint-sitecollection-permission.md).

# List Sharepoint Sitecollection Permission

List the administrators and members of a SharePoint site

### Description

Shows who has access to a SharePoint Online site collection: the site collection administrators and the members of the Owners, Members and Visitors groups. Each entry shows its type, such as user, Entra ID group, security group or SharePoint group. Nothing is changed.

### Parameter behaviour

* `SiteUrl` must point at a site collection root (for example `https://contoso.sharepoint.com/sites/marketing`), not at a sub-site. A sub-site URL still returns results, but they describe the parent site collection; the runbook logs a warning when this happens.
* The Owners, Members and Visitors groups are resolved via the site's associated-group properties, not by matching localized group names, so the report is accurate regardless of the tenant language. Any of the three groups may be absent (common on Teams-connected sites) and is then reported as "not configured" instead of causing a failure.

### Location

Organization → Collab → List Sharepoint Sitecollection Permission

**Full Runbook name**

rjgit-org\_collab\_list-sharepoint-sitecollection-permission

### Details

| Property         | Value                                                                   |
| ---------------- | ----------------------------------------------------------------------- |
| Version          | 1.2.0                                                                   |
| Required modules | <p>RealmJoin.RunbookHelper (>= 0.8.10)<br>PnP.PowerShell (>= 3.4.1)</p> |
| Schedulable      | no                                                                      |

### Permissions

#### Application permissions

* **Type**: Office 365 SharePoint Online
  * Sites.FullControl.All
    * *Connects via Connect-PnPOnline -ManagedIdentity and calls Get-PnPWeb, Get-PnPSite, Get-PnPSiteCollectionAdmin and Get-PnPGroupMember against the target site collection; Get-PnPSiteCollectionAdmin in particular requires more than read-only site access, so Sites.Read.All is insufficient. Sites.Selected was not used because it would require per-site consent to be pre-granted outside this runbook's control, which this runbook cannot guarantee for an arbitrary $SiteUrl.*

#### Permission notes

Grant admin consent for the 'Sites.FullControl.All' application permission on the Office 365 SharePoint Online API (App ID 00000003-0000-0ff1-ce00-000000000000) to the Azure Automation account's system-assigned managed identity; this SharePoint app-only-via-managed-identity consent cannot be assigned through the standard Microsoft Graph app-role automation used for Graph permissions. See the runbook's documentation file for the assignment commands.

### Parameters

#### SiteUrl

Full URL of the site, for example <https://contoso.sharepoint.com/sites/marketing>.

| Property            | Value               |
| ------------------- | ------------------- |
| Required            | true                |
| Default Value       |                     |
| Type                | String              |
| Portal display name | Site collection URL |

[Back to Runbook Reference overview](/automation/runbooks/runbook-references.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmjoin.com/automation/runbooks/runbook-references/org/collab/list-sharepoint-sitecollection-permission.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
