Skip to content

Commit

Permalink
Adds site membership list command Closes #5980
Browse files Browse the repository at this point in the history
  • Loading branch information
mkm17 committed Jun 10, 2024
1 parent 0d80e6e commit cdddadf
Show file tree
Hide file tree
Showing 6 changed files with 641 additions and 0 deletions.
89 changes: 89 additions & 0 deletions docs/docs/cmd/spo/site/site-membership-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo site membership list

Retrieve information about default site groups' membership

## Usage

```sh
m365 spo 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

To execute this command successfully, ensure you are logged in to the CLI for M365 with an account that has SharePoint admin permissions. For other scenarios, refer to the `spo web get --withGroups` and `spo group member list` commands.

## Examples

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

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

Retrieves information about site owners.

```sh
m365 spo 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": "UserName",
"userPrincipalName": "[email protected]"
}
],
"AssociatedMemberGroup": [
{
"email": "[email protected]",
"loginName": "i:0#.f|membership|[email protected]",
"name": "internal",
"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
AssociatedMemberGroup : [{"email":"[email protected]","loginName":"i:0#.f|membership|[email protected]","name":"internal","userPrincipalName":"[email protected]"}]
AssociatedOwnerGroup : [{"email":"[email protected]","loginName":"i:0#.f|membership|[email protected]","name":"UserName","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>
</Tabs>
5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3291,6 +3291,11 @@ const sidebars: SidebarsConfig = {
label: 'site list',
id: 'cmd/spo/site/site-list'
},
{
type: 'doc',
label: 'site membership list',
id: 'cmd/spo/site/site-membership-list'
},
{
type: 'doc',
label: 'site remove',
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 @@ -257,6 +257,7 @@ export default {
SITE_HUBSITE_THEME_SYNC: `${prefix} site hubsite theme sync`,
SITE_LIST: `${prefix} site list`,
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
SITE_MEMBERSHIP_LIST: `${prefix} site membership list`,
SITE_RECYCLEBINITEM_CLEAR: `${prefix} site recyclebinitem clear`,
SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
SITE_RECYCLEBINITEM_MOVE: `${prefix} site recyclebinitem move`,
Expand Down
1 change: 1 addition & 0 deletions src/m365/spo/commands/site/SiteProperties.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export interface SiteProperties {
SiteId: string;
Status: string;
Title: string;
Url: string;
Expand Down
Loading

0 comments on commit cdddadf

Please sign in to comment.