Skip to content

Commit b6b8daa

Browse files
committed
refresh tenant properties readability
- converted doc to use tabbed examples instead of long form display for different options - add open source callout includes
1 parent e290b02 commit b6b8daa

File tree

3 files changed

+142
-98
lines changed

3 files changed

+142
-98
lines changed

docs/spfx/tenant-properties.md

Lines changed: 136 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,200 +1,238 @@
11
---
22
title: SharePoint Online tenant properties
33
description: Manage and read tenant properties, which allow tenant administrators to add properties in the app catalog that can be read by various SharePoint Framework components.
4-
ms.date: 02/02/2018
4+
ms.date: 06/05/2020
55
ms.prod: sharepoint
66
localization_priority: Priority
77
---
88

99
# SharePoint Online tenant properties
1010

11-
Tenant properties allow tenant administrators to add properties in the app catalog that can be read by various SharePoint Framework components. The tenant properties are managed by tenant administrators by using the [Microsoft SharePoint Online Management Shell](https://technet.microsoft.com/library/fp161372.aspx), which is a PowerShell module to manage your SharePoint Online subscription in Office 365.
11+
Tenant properties allow tenant administrators to add properties in the app catalog that can be read using the SharePoint REST API.
1212

13-
Alternatively, the [Office 365 CLI](https://pnp.github.io/office365-cli?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) can be used to manage the tenant properties. The Office 365 CLI is a cross-platform command line interface that can be used on any platform, including Windows, MacOS and Linux.
13+
## Options for working with tenant properties
1414

15-
Yet another alternative for managing tenant properties is [PnP PowerShell](https://aka.ms/sppnp-powershell). The advantage of PnP PowerShell is that it does not require tenant administrator privileges to set those properties. Any member of the Owners group of an app catalog site can do this. This applies to the tenant app catalog site as well as [site collection app catalogs](../general-development/site-collection-app-catalog.md).
15+
The tenant properties are managed by tenant administrators by using one of the following options:
1616

17-
## Use Microsoft SharePoint Online Management Shell commands to get, set and remove tenant properties
17+
### SharePoint REST API
1818

19-
Using the [Microsoft SharePoint Online Management Shell](https://www.microsoft.com/download/details.aspx?id=35588), tenant administrators can use PowerShell to add and remove tenant properties.
19+
Learn more here: [SharePoint REST API](../sp-add-ins/get-to-know-the-sharepoint-rest-service.md)
2020

21-
The following PowerShell cmdlets are available to manage the tenant properties. Because tenant properties are stored in the tenant app catalog, you must provide the tenant app catalog site collection URL in the following cmdlets.
21+
### Microsoft SharePoint Online Management Shell
2222

23-
Before running the following script, connect to your SharePoint Online tenant using the `Connect-SPOService` cmdlet when using the SharePoint Online PowerShell.
23+
The tenant properties are managed by tenant administrators by using the **Microsoft SharePoint Online Management Shell**, a PowerShell module from Microsoft used to manage your SharePoint Online subscription in Office 365.
2424

25-
### Get-SPOStorageEntity
25+
Before using any of the cmdlets in the Microsoft SharePoint Online Management Shell module, you must first connect to SharePoint Online using the `Connect-SPOService` cmdlet. All tenant properties are managed using the `*-SPOStorageEntity` cmdlets.
2626

27-
- **Applies to** Office 365, SharePoint Online
27+
Learn more here: [Microsoft SharePoint Online Management Shell](https://technet.microsoft.com/library/fp161372.aspx)
2828

29-
- **Syntax** Get-SPOStorageEntity [-Site] <AppCatalogSiteURL> [-Key] <String>
29+
### PnP PowerShell
3030

31-
### Set-SPOStorageEntity
31+
The advantage of PnP PowerShell is that it doesn't require tenant administrator privileges to set those properties. Any member of the Owners group of an app catalog site can do this. This applies to the tenant app catalog site and [site collection app catalogs](../general-development/site-collection-app-catalog.md).
3232

33-
- **Applies to** Office 365, SharePoint Online
33+
Prior to using any of the cmdlets in the PnP PowerShell module, you must first connect to SharePoint Online using the `Connect-PnPOnline` cmdlet. All tenant properties are managed using the `*-PnPStorageEntity` cmdlets.
3434

35-
- **Syntax** Set-SPOStorageEntity [-Site] <AppCatalogSiteURL> [-Key] <String> [-Value] <String> [-Description] <String> [-Comments] <String>
35+
Learn more here: [PnP PowerShell](https://aka.ms/sppnp-powershell)
3636

37-
### Remove-SPOStorageEntity
37+
> [!IMPORTANT]
38+
> You can connect to any site using the `Connect-PnPOnline` cmdlet. When you omit the `-Scope` parameter or set it to `Tenant`, which is the default value, all cmdlets apply to the tenant app catalog regardless of the site you connected to. If you set the `-Scope` parameter to `Site` all cmdlets will apply to the site collection app catalog of the site you connected to.
3839
39-
- **Applies to** Office 365, SharePoint Online
40+
[!INCLUDE [pnp-powershell](../../includes/snippets/open-source/pnp-powershell.md)]
4041

41-
- **Syntax** Remove-SPOStorageEntity [-Site] <AppCatalogSiteURL> [-Key] <String>
42+
### Office 365 CLI
4243

43-
## Use Office 365 CLI commands to get, set, remove and list tenant properties cross-platform
44+
The Office 365 CLI can be used to manage the tenant properties. The Office 365 CLI is a cross-platform command-line interface that can be used on any platform, including Windows, macOS, and Linux.
4445

45-
Using the [Office 365 CLI](https://pnp.github.io/office365-cli?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties), tenant administrators can use shell commands to manage tenant properties.
46+
Before using any of the commands in the Office 365 CLI, you must first connect to SharePoint Online using the `login` command. All tenant properties are managed using the `spo storageentity` commands.
4647

47-
Before using the commands, connect to a SharePoint Online site, using the `spo connect` command.
48+
Learn more here: [Office 365 CLI](https://pnp.github.io/office365-cli?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties)
4849

49-
### Get details for the specified tenant property
50+
> [!IMPORTANT]
51+
> To set or remove a tenant property, you have to first connect to a tenant admin site using the `spo connect` command. If you are connected to a different site and will try to manage tenant properties, you will get an error.
52+
>
53+
> Tenant properties are stored in the app catalog site associated with that tenant. To set or remove a property, you have to specify the absolute URL of the app catalog site. If you specify the URL of a site different than the app catalog, you will get an access denied error.
5054
51-
The [spo storageentity get](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-get/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) command can be used to get details for Office 365, SharePoint Online tenant property
55+
[!INCLUDE [pnp-o365cli](../../includes/snippets/open-source/pnp-o365cli.md)]
5256

53-
```shell
54-
spo storageentity get --key <key>
55-
```
57+
## List tenant properties
5658

57-
### List tenant properties stored on the specified SharePoint Online app catalog
59+
The following options demonstrate how to list tenant properties from SharePoint Online.
5860

59-
The [spo storageentity list](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-list/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) command can be used to list all the tenant properties.
61+
# [SharePoint REST API](#tab/sprest)
6062

61-
```shell
62-
spo storageentity list --appCatalogUrl <appCatalogUrl>
63+
### Request
64+
65+
```http
66+
GET https://tenant.sharepoint.com/sites/site/_api/web/AllProperties?$select=storageentitiesindex
6367
```
6468

65-
### Set tenant property on a specified SharePoint Online app catalog
69+
### Response
6670

67-
The [spo storageentity set](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-set/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) command can be used to set tenant property
71+
```text
72+
HTTP/1.1 200 OK
73+
Content-Type: application/json
74+
{
75+
"key": {
76+
"Comment":"Tenant property comment.",
77+
"Description":"Tenant property description",
78+
"Value":"Tenant property key value"
79+
}
80+
}
81+
```
6882

69-
```shell
70-
spo storageentity set --appCatalogUrl <appCatalogUrl> --key <key> --value <value>
83+
# [Microsoft SPO Management Shell](#tab/msposh)
84+
85+
*Not supported*
86+
87+
# [PnP PowerShell](#tab/pnpposh)
88+
89+
```powershell
90+
Get-PnPStorageEntity
7191
```
7292

73-
### Remove tenant property stored on the specified SharePoint Online app catalog
93+
> Refer to the [PnP PowerShell documentation](/powershell/module/sharepoint-pnp/get-pnpstorageentity) for details on this cmdlet.
7494
75-
The [spo storageentity remove](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-remove/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) command can be used to remove tenant property
95+
# [Office 365 CLI](#tab/o365cli)
7696

7797
```shell
78-
spo storageentity remove --appCatalogUrl <appCatalogUrl> --key <key>
98+
spo storageentity list
7999
```
80100

81-
### Remarks when using the Office 365 CLI set and remove commands
101+
> Refer to the [Office 365 CLI documentation](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-get/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) for details on this command.
82102
83-
To set or remove a tenant property, you have to first connect to a tenant admin site using the spo connect command, eg. spo connect https://contoso-admin.sharepoint.com. If you are connected to a different site and will try to manage tenant properties, you will get an error.
103+
---
84104

85-
Tenant properties are stored in the app catalog site associated with that tenant. To set or remove a property, you have to specify the absolute URL of the app catalog site. If you specify the URL of a site different than the app catalog, you will get an access denied error.
105+
## Get/read tenant properties
86106

107+
The following options demonstrate how to get tenant properties from SharePoint Online.
87108

88-
## Use PnP PowerShell cmdlets to get, set, remove and list tenant properties
109+
# [SharePoint REST API](#tab/sprest)
89110

90-
Using [PnP PowerShell](https://aka.ms/sppnp-powershell), site owners and site collection administrators can use PowerShell cmdlets to manage tenant properties.
111+
### Request
91112

92-
Before using the cmdlets, connect to a SharePoint Online site, using the `Connect-PnPOnline` cmdlet.
113+
```http
114+
GET https://tenant.sharepoint.com/sites/site/_api/web/GetStorageEntity('key')
115+
```
93116

94-
### Get details for the specified tenant property
117+
### Response
118+
119+
```text
120+
HTTP/1.1 200 OK
121+
Content-Type: application/json
122+
{
123+
"Comment":"Tenant property comment.",
124+
"Description":"Tenant property description",
125+
"Value":"Tenant property key value"
126+
}
127+
```
95128

96-
The [Get-PnPStorageEntity](/powershell/module/sharepoint-pnp/get-pnpstorageentity) cmdlet can be used to get details for a SharePoint Online tenant property
129+
# [Microsoft SPO Management Shell](#tab/msposh)
97130

98-
Get property from tenant app catalog:
99131
```powershell
100-
Get-PnPStorageEntity -Key <key>
132+
Get-SPOStorageEntity -Site <AppCatalogSiteURL> -Key <String>
101133
```
102134

103-
Get property from a site collection app catalog:
135+
> Refer to the [Microsoft SPO Management Shell](/powershell/module/sharepoint-online/get-spostorageentity) for details on this cmdlet.
136+
137+
# [PnP PowerShell](#tab/pnpposh)
138+
104139
```powershell
105-
Get-PnPStorageEntity -Key <key> -Scope Site
140+
Get-PnPStorageEntity -Key <key>
106141
```
107142

108-
### List tenant properties stored on a SharePoint Online app catalog
143+
> Refer to the [PnP PowerShell documentation](/powershell/module/sharepoint-pnp/get-pnpstorageentity) for details on this cmdlet.
109144
110-
The [Get-PnPStorageEntity](/powershell/module/sharepoint-pnp/get-pnpstorageentity) cmdlet can be used to list all the tenant properties.
145+
# [Office 365 CLI](#tab/o365cli)
111146

112-
List properties of tenant app catalog:
113-
```powershell
114-
Get-PnPStorageEntity
147+
```shell
148+
spo storageentity get --key <key>
115149
```
116-
List properties of site collection app catalog:
150+
151+
> Refer to the [Office 365 CLI documentation](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-get/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) for details on this command.
152+
153+
---
154+
155+
## Set/write tenant properties
156+
157+
The following options demonstrate how to write tenant properties from SharePoint Online.
158+
159+
# [SharePoint REST API](#tab/sprest)
160+
161+
*Not supported*
162+
163+
# [Microsoft SPO Management Shell](#tab/msposh)
164+
117165
```powershell
118-
Get-PnPStorageEntity -Scope Site
166+
Set-SPOStorageEntity -Site <AppCatalogSiteURL> -Key <String> -Value <String> -Description <string> -Comments <String>
119167
```
120168

121-
### Set tenant property on a SharePoint Online app catalog
169+
> Refer to the [Microsoft SPO Management Shell](/powershell/module/sharepoint-online/set-spostorageentity) for details on this cmdlet.
122170
123-
The [Set-PnPStorageEntity](/powershell/module/sharepoint-pnp/set-pnpstorageentity) cmdlet can be used to set a tenant property.
171+
# [PnP PowerShell](#tab/pnpposh)
124172

125-
Set property for tenant app catalog:
126173
```powershell
127174
Set-PnPStorageEntity -Key <key> -Value <value>
128175
```
129-
Set property for site collection app catalog:
130-
```powershell
131-
Set-PnPStorageEntity -Key <key> -Value <value> -Scope Site
132-
```
133176

134-
### Remove tenant property stored on a SharePoint Online app catalog
177+
> Refer to the [PnP PowerShell documentation](/powershell/module/sharepoint-pnp/set-pnpstorageentity) for details on this cmdlet.
135178
136-
The [Remove-PnPStorageEntity](/powershell/module/sharepoint-pnp/remove-pnpstorageentity) cmdlet can be used to remove a tenant property.
179+
# [Office 365 CLI](#tab/o365cli)
137180

138-
Remove property from tenant app catalog:
139-
```powershell
140-
Remove-PnPStorageEntity -Key <key>
141-
```
142-
Remove property from site collection app catalog:
143-
```powershell
144-
Remove-PnPStorageEntity -Key <key> -Scope Site
181+
```shell
182+
spo storageentity set --key <key> --value <value>
145183
```
146184

147-
### Remarks when using the PnP PowerShell cmdlets
185+
> Refer to the [Office 365 CLI documentation](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-set/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) for details on this command.
148186
149-
You can connect to any site using the `Connect-PnPOnline` cmdlet, eg. Connect-PnPOnline https://contoso.sharepoint.com/sites/marketing. When you omit the `-Scope` parameter or set it to `Tenant` (which is the default value) all cmdlets apply to the tenant app catalog regardless of the site you connected to. If you set the `-Scope` parameter to `Site` all cmdlets will apply to the site collection app catalog of the site you connected to.
187+
---
150188

151-
## Read tenant properties
189+
## Remove tenant properties
152190

153-
Developers can read tenant properties by using the SharePoint REST APIs and use them in SharePoint Framework components such as web parts and extensions.
191+
The following options demonstrate how to remove tenant properties from SharePoint Online.
154192

155-
## HTTP request
193+
# [SharePoint REST API](#tab/sprest)
156194

157-
### Get a tenant property
195+
*Not supported*
158196

159-
```text
160-
GET _api/web/GetStorageEntity('key')
197+
# [Microsoft SPO Management Shell](#tab/msposh)
198+
199+
```powershell
200+
Remove-SPOStorageEntity -Site <AppCatalogSiteURL> -Key <String>
161201
```
162202

163-
#### Example
203+
> Refer to the [Microsoft SPO Management Shell](/powershell/module/sharepoint-online/remove-spostorageentity) for details on this cmdlet.
164204
165-
```text
166-
GET _api/web/GetStorageEntity('AnalyticsKey')
205+
# [PnP PowerShell](#tab/pnpposh)
206+
207+
```powershell
208+
Remove-PnPStorageEntity -Key <key>
167209
```
168210

169-
#### Request body
211+
> Refer to the [PnP PowerShell documentation](/powershell/module/sharepoint-pnp/remove-pnpstorageentity) for details on this cmdlet.
170212
171-
Do not supply a request body for this method.
213+
# [Office 365 CLI](#tab/o365cli)
172214

173-
#### Response
215+
```shell
216+
spo storageentity remove --key <key>
217+
```
174218

175-
This returns the storage entity information for the given key.
219+
> Refer to the [Office 365 CLI documentation](https://pnp.github.io/office365-cli/cmd/spo/storageentity/storageentity-remove/?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties) for details on this command.
176220
177-
```text
178-
HTTP/1.1 200 OK
179-
Content-Type: application/json
180-
{
181-
"Comment":"Tenant property comment.",
182-
"Description":"Tenant property description",
183-
"Value":"Tenant property key value"
184-
}
185-
```
221+
---
186222

187223
## Custom script and site collection app catalogs
188224

189-
It is only allowed to set tenant properties on site collection app catalogs in sites that have custom scripts enabled. When you try to set a tenant property in a "no-script site" the following error will be shown:
225+
It's only allowed to set tenant properties on site collection app catalogs in sites that have custom scripts enabled. When you try to set a tenant property in a "no-script site", the following error will be shown:
190226

191-
> Access denied. You do not have permission to perform this action or access this resource.
227+
`Access denied. You do not have permission to perform this action or access this resource.`
192228

193229
You can learn more about custom scripts here: [Allow or prevent custom script](/sharepoint/allow-or-prevent-custom-script).
194230

195-
Note that above error message will also be shown if you are not owner or site collection administrator of the site.
231+
The error message will also be shown if you aren't owner or site collection administrator of the site.
196232

197233
## See also
198234

199235
- [Overview of the SharePoint Framework](sharepoint-framework-overview.md)
236+
- [Microsoft SharePoint Online Management Shell](https://technet.microsoft.com/library/fp161372.aspx)
237+
- [PnP PowerShell](https://aka.ms/sppnp-powershell)
200238
- [Office 365 CLI](https://pnp.github.io/office365-cli?utm_source=msft_docs&utm_medium=page&utm_campaign=Use+SharePoint+Online+tenant+properties)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
> [!NOTE]
3+
> The Office 365 CLI is an open-source solution with active community providing support for it. There is no SLA for the open-source tool support from Microsoft.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
> [!NOTE]
3+
> PnP PowerShell is an open-source solution with active community providing support for it. There is no SLA for the open-source tool support from Microsoft.

0 commit comments

Comments
 (0)