import Global from '../../_global.mdx';

# spo listitem roleassignment remove

Removes a role assignment from a listitem.

## Usage

```sh
m365 spo listitem roleassignment remove [options]
```

## Options

```md definition-list
`-u, --webUrl <webUrl>`
: URL of the site where the list item is located.

`-i, --listId [listId]`
: ID of the list. Specify either `listId`, `listTitle`, or `listUrl` but not multiple.

`-t, --listTitle [listTitle]`
: Title of the list. Specify either `listId`, `listTitle`, or `listUrl` but not multiple.

`--listUrl [listUrl]`
: Relative URL of the list. Specify either `listId`, `listTitle`, or `listUrl` but not multiple.

`--listItemId <listItemId>`
: Id of the list item to remove the role from.

`--principalId [principalId]`
: SharePoint ID of principal it may be either user id or group id we want to remove permissions. Specify either `principalId`, `upn`, `groupName`, `entraGroupId`, or `entraGroupName`.

`--upn [upn]`
: The upn/email of user. Specify either `principalId`, `upn`, `groupName`, `entraGroupId`, or `entraGroupName`.

`--groupName [groupName]`
: The group name of the SharePoint group. Use this option exclusively for SharePoint Online groups. Specify either `principalId`, `upn`, `groupName`, `entraGroupId`, or `entraGroupName`.

`--entraGroupId [entraGroupId]`
: ID of the Microsoft Entra group to remove. Specify either `principalId`, `upn`, `groupName`, `entraGroupId`, or `entraGroupName`.

`--entraGroupName [entraGroupName]`
: Display name of the Microsoft Entra group to remove. Specify either `principalId`, `upn`, `groupName`, `entraGroupId`, or `entraGroupName`.

`-f, --force`
: Don't prompt for confirming removing the role assignment.
```

<Global />

## Examples

Remove roleassignment from list item getting list by title based on group name

```sh
m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listTitle "someList" --listItemId 1 --groupName "saleGroup"
```

Remove roleassignment from list item getting list by title based on principal Id

```sh
m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listTitle "Events" --listItemId 1 --principalId 2
```

Remove roleassignment from list item getting list by url based on principal Id

```sh
m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl "/sites/contoso-sales/lists/Events" --listItemId 1 --principalId 2
```


Remove roleassignment from list item getting list by url based on principal Id without prompting for confirmation

```sh
m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl "/sites/contoso-sales/lists/Events" --listItemId 1 --principalId 2 --force
```

Remove roleassignment from list item getting list by url based on Entra group Id without prompting for confirmation

```sh
m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl "/sites/contoso-sales/lists/Events" --listItemId 1 --entraGroupId "27ae47f1-48f1-46f3-980b-d3c1470e398d" --force
```

## Response

The command won't return a response on success.
