Skip to content

Commit

Permalink
Adds tenant site membership list command Closes #5980
Browse files Browse the repository at this point in the history
  • Loading branch information
mkm17 committed Oct 16, 2024
1 parent d92b1c2 commit 9938294
Show file tree
Hide file tree
Showing 8 changed files with 864 additions and 0 deletions.
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`.
```

<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

<Tabs>
<TabItem value="JSON">

```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
```

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

```csv
email,loginName,name,userPrincipalName,associatedGroupType
[email protected],i:0#.f|membership|[email protected],John Doe,[email protected],Owner
```

</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

```

</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`,
TENANT_SITE_RENAME: `${prefix} tenant site rename`,
TENANT_SITE_UNARCHIVE: `${prefix} tenant site unarchive`,
TERM_ADD: `${prefix} term add`,
Expand Down
Loading

0 comments on commit 9938294

Please sign in to comment.