Skip to content

Latest commit

 

History

History
109 lines (81 loc) · 2.74 KB

File metadata and controls

109 lines (81 loc) · 2.74 KB

import Global from '../../_global.mdx'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

spo site apppermission add

Adds a specific application permissions to the site

Usage

m365 spo site apppermission add [options]

Options

`-u, --siteUrl <siteUrl>`
: URL of the site collection to add the permission

`-p, --permission <permission>`
: Permission to site (`read`, `write`, `manage` or `fullcontrol`)

`-i, --appId [appId]`
: Client ID of the Microsoft Entra app for which to grant permissions

`-n, --appDisplayName [appDisplayName]`
: Display name of the Microsoft Entra app for which to grant permissions

Remarks

To set permissions, specify at minimum either appId or appDisplayName. For best performance specify both values to avoid extra lookup.

Example

Grants the specified app the read permission to site https://contoso.sharepoint.com/sites/project-x

m365 spo site apppermission add --siteUrl https://contoso.sharepoint.com/sites/project-x --permission read --appDisplayName Foo

Response

{
"id": "aTowaS50fG1zLnNwLmV4dHw1Yzg5ZmJiZi02NzBlLTQ4ZTctYTBiYy1mYTg5NDJjODk1YTJAMWU4NTJiNDktYmY0Yi00YmE1LWJjZDQtYThjNDcwNmM4ZWQ0",
"roles": [
  "read"
],
"grantedToIdentitiesV2": [
  {
    "application": {
      "displayName": "Foo",
      "id": "5c89fbbf-670e-48e7-a0bc-fa8942c895a2"
    }
  }
],
"grantedToIdentities": [
  {
    "application": {
      "displayName": "Foo",
      "id": "5c89fbbf-670e-48e7-a0bc-fa8942c895a2"
    }
  }
]
}
grantedToIdentities  : [{"application":{"displayName":"Foo","id":"5c89fbbf-670e-48e7-a0bc-fa8942c895a2"}}]
grantedToIdentitiesV2: [{"application":{"displayName":"Foo","id":"5c89fbbf-670e-48e7-a0bc-fa8942c895a2"}}]
id                   : aTowaS50fG1zLnNwLmV4dHw1Yzg5ZmJiZi02NzBlLTQ4ZTctYTBiYy1mYTg5NDJjODk1YTJAMWU4NTJiNDktYmY0Yi00YmE1LWJjZDQtYThjNDcwNmM4ZWQ0
roles                : ["read"]
id
aTowaS50fG1zLnNwLmV4dHw1Yzg5ZmJiZi02NzBlLTQ4ZTctYTBiYy1mYTg5NDJjODk1YTJAMWU4NTJiNDktYmY0Yi00YmE1LWJjZDQtYThjNDcwNmM4ZWQ0
# spo site apppermission add --siteUrl "https://contoso.sharepoint.com/sites/team1" --permission "read" --appDisplayName "Foo"

Date: 2023-06-21

## aTowaS50fG1zLnNwLmV4dHw1Yzg5ZmJiZi02NzBlLTQ4ZTctYTBiYy1mYTg5NDJjODk1YTJAMWU4NTJiNDktYmY0Yi00YmE1LWJjZDQtYThjNDcwNmM4ZWQ0

Property | Value
---------|-------
id | aTowaS50fG1zLnNwLmV4dHw1Yzg5ZmJiZi02NzBlLTQ4ZTctYTBiYy1mYTg5NDJjODk1YTJAMWU4NTJiNDktYmY0Yi00YmE1LWJjZDQtYThjNDcwNmM4ZWQ0