You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/solution-guidance/modern-experience-customizations-provisioning-sites.md
+64-1Lines changed: 64 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,29 @@ Execute-PnPQuery
108
108
$web.WebTemplate + "#" + $web.Configuration
109
109
```
110
110
111
+
### Provision a "modern" team site using the Office 365 CLI
112
+
113
+
Alternatively, the [Office 365 CLI](https://sharepoint.github.io/office365-cli/?utm_source=msft_docs&utm_medium=page&utm_campaign=Provisioning+modern+team+sites+programmatically) can be used to create "modern" sites. The Office 365 CLI is a cross-platform command line interface that can be used on any platform, including Windows, MacOS and Linux.
114
+
115
+
The following bash script will create a "modern" team site and then return the actual SharePoint site URL for further manipulation. Once you have access to the URL of the created site, you can use it to automate other operations on the created site.
116
+
117
+
```bash
118
+
#!/usr/bin/env bash
119
+
# Connect to SharePoint Online
120
+
# This command will prompt a sign-in confirmation message to authenticate
# Since the Office 365 CLI is connected to SharePoint Online we can do any operations.
130
+
# As example, we can list all the properties from the site property bag:
131
+
o365 spo propertybag list -u $siteUrl
132
+
```
133
+
111
134
### Provision an Office 365 group programmatically
112
135
113
136
"Modern" team sites can be created programmatically by creating an [Office 365 group](https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/group) using the Microsoft Graph. In fact, when you create an Office 365 group, a "modern" team site is automatically provisioned for the group. The "modern" team site URI is based on the **mailNickname** parameter of the Office 365 group and has the following default structure.
#### Provision a modern teamsite using SharePoint Online Management Shell or PnP PowerShell
173
197
174
-
It is now also possible to create a modern site which is not connected to a Group using PowerShell. Either by using the PnP PowerShell cmdlets or the SharePoint Online Management Shell.
198
+
It is also possible to create a modern site which is not connected to a Group using PowerShell. Either by using the PnP PowerShell cmdlets or the SharePoint Online Management Shell.
#### Provision an Office 365 Group using the Office 365 CLI
213
+
214
+
Alternatively, the [Office 365 CLI](https://sharepoint.github.io/office365-cli/cmd/graph/o365group/o365group-add/?utm_source=msft_docs&utm_medium=page&utm_campaign=Provisioning+modern+team+sites+programmatically) can be used to create an Office 365 Group, which will let you easily authenticate with the Microsoft Graph and then create the new group.
215
+
The example below shows how it can be done using the [Office 365 CLI immersive mode](https://sharepoint.github.io/office365-cli/user-guide/using-cli/#start-the-cli-in-the-immersive-mode?utm_source=msft_docs&utm_medium=page&utm_campaign=Provisioning+modern+team+sites+programmatically).
216
+
217
+
```bash
218
+
# Use the Office 365 CLI immersive mode by typing o365 in the terminal
219
+
# Connect to Microsoft Graph using the Office 365 CLI
220
+
# This command will prompt a sign-in confirmation message to authenticate
221
+
graph connect
222
+
223
+
# Create an Office 365 Group
224
+
# The newly created SharePoint site for that group will has URL
In this section, you learn how to provision a "modern" communication site, and what are the available options to do that.
@@ -258,6 +300,27 @@ Execute-PnPQuery
258
300
$web.Title
259
301
```
260
302
303
+
#### Provision a "modern" communication site using the Office 365 CLI
304
+
305
+
Alternatively, the [Office 365 CLI](https://sharepoint.github.io/office365-cli/cmd/spo/site/site-add/?utm_source=msft_docs&utm_medium=page&utm_campaign=Provisioning+modern+team+sites+programmatically) can be used to create "modern" Communication site. The following bash script will create the site and then return the actual SharePoint site URL for further manipulation. Once you have access to the URL you can use it to automate other operations on the created site.
306
+
307
+
```bash
308
+
#!/usr/bin/env bash
309
+
# Connect to SharePoint Online
310
+
# This command will prompt a sign-in confirmation message to authenticate
0 commit comments