Get started with the PnP PowerShell cmdlets for Office 365 (SharePoint & Co.)
A lot of features and functions within Office 365 can only be managed with PowerShell. Of course everything can be controlled with the standard PowerShell module Microsoft.Online.Sharepoint.PowerShell but only with this module some tasks are very complex to realize. For example to change the standard search scope in SharePoint Online without the PnP extension you need the following code: With the PnP extension only one line of script code is necessary: $siteURL = "https://my-sharepoint-domain.sharepoint.com/sites/Sales" $userAccess = Get-Credential Try { $currentCtx = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL) $currentCtx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userAccess.UserName,$userAccess.Password) $web = $currentCtx.Web $currentCtx.Load($web) $currentCtx.ExecuteQuery() $web.SearchScope = 1 $web.Update() $currentCtx.ExecuteQuery() } Catch { // log or show error } With