Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds new command site membership list Closes #5980 #6087

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const dictionary = [
'logout',
'management',
'member',
'membership',
'messaging',
'model',
'multitenant',
Expand Down
122 changes: 122 additions & 0 deletions docs/docs/cmd/spo/tenant/tenant-site-membership-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo tenant site membership list

Retrieve information about default site groups' membership

## Usage

```sh
m365 spo tenant site membership list [options]
```

## Options

```md definition-list
`-u, --siteUrl <siteUrl>`
: The URL of the site.

`-r, --role [role]`
: Filter the results to include only users with the specified roles: `Owner`, `Member`, or `Visitor`.
```
milanholemans marked this conversation as resolved.
Show resolved Hide resolved

<Global />

## Remarks

:::info

To use this command, you must be a Global or SharePoint administrator.

:::

For other scenarios, refer to the [spo web get --withGroups](../web/web-get.mdx) and [spo group member list](../group/group-member-list.mdx) commands.

## Examples

Retrieve information about default site groups' owners, members, and visitors of the site.

```sh
m365 spo tenant site membership list --siteUrl https://contoso.sharepoint.com
```

Retrieve information about site owners.

```sh
m365 spo tenant site membership list --siteUrl https://contoso.sharepoint.com --role Owner
```

## Response
milanholemans marked this conversation as resolved.
Show resolved Hide resolved

<Tabs>
<TabItem value="JSON">
milanholemans marked this conversation as resolved.
Show resolved Hide resolved

```json
{
"AssociatedOwnerGroup": [
{
"email": "[email protected]",
"loginName": "i:0#.f|membership|[email protected]",
"name": "John Doe",
"userPrincipalName": "[email protected]"
}
],
"AssociatedMemberGroup": [
{
"email": "[email protected]",
"loginName": "i:0#.f|membership|[email protected]",
"name": "Adele Vance",
"userPrincipalName": "[email protected]"
}
],
"AssociatedVisitorGroup": [
{
"email": "",
"loginName": "c:0-.f|rolemanager|spo-grid-all-users/dc109ffd-4298-487e-9cbc-6b9b1a2cd3e2",
"name": "Everyone except external users",
"userPrincipalName": null
}
]
}
```
</TabItem>
<TabItem value="Text">

```text
email name userPrincipalName associatedGroupType
-------------------------------- ------------------------------ -------------------------------- -------------------
[email protected] John Doe [email protected] Owner
```
milanholemans marked this conversation as resolved.
Show resolved Hide resolved

</TabItem>
<TabItem value="CSV">

```csv
email,loginName,name,userPrincipalName,associatedGroupType
[email protected],i:0#.f|membership|[email protected],John Doe,[email protected],Owner
```
milanholemans marked this conversation as resolved.
Show resolved Hide resolved

</TabItem>
<TabItem value="Markdown">

```md
# spo tenant site membership list --siteUrl "https://contoso.sharepoint.com/sites/AudienceTest"

Date: 11/08/2024

## John Doe

Property | Value
---------|-------
email | [email protected]
loginName | i:0#.f\|membership\|[email protected]
name | John Doe
userPrincipalName | [email protected]
associatedGroupType | Owner

```
milanholemans marked this conversation as resolved.
Show resolved Hide resolved

</TabItem>
</Tabs>
5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3752,6 +3752,11 @@ const sidebars: SidebarsConfig = {
type: 'doc',
label: 'tenant site unarchive',
id: 'cmd/spo/tenant/tenant-site-unarchive'
},
{
type: 'doc',
label: 'tenant site membership list',
id: 'cmd/spo/tenant/tenant-site-membership-list'
}
]
},
Expand Down
1 change: 1 addition & 0 deletions src/m365/spo/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export default {
TENANT_SETTINGS_LIST: `${prefix} tenant settings list`,
TENANT_SETTINGS_SET: `${prefix} tenant settings set`,
TENANT_SITE_ARCHIVE: `${prefix} tenant site archive`,
TENANT_SITE_MEMBERSHIP_LIST: `${prefix} tenant site membership list`,
milanholemans marked this conversation as resolved.
Show resolved Hide resolved
TENANT_SITE_RENAME: `${prefix} tenant site rename`,
TENANT_SITE_UNARCHIVE: `${prefix} tenant site unarchive`,
TERM_ADD: `${prefix} term add`,
Expand Down
Loading