Category: Office 365

Office 365 Advent Calendar – 24 Office 365: Overview of Services and Applications

office-365-advent-calendar

I’ll finish this year’s Office 365 Advent Calendar with a small overview of the Office 365 Services and Applications. Basically, the following document contains all current services and applications with a short description. You can use this document as a starting point for your organization, your customer, or anyone else with whom you want to discuss the Office 365 suite.

Office 365 – Overview of Services and Applications (pdf)

Office 365 Advent Calendar – 23 Bulk-updating File Extensions in SharePoint Online with PowerShell

office-365-advent-calendar

Scenario

A short while ago, I had to update a fairly large number of documents in multiple libraries in a SharePoint Online site. Problem was that their file extension was .html which doesn’t display in the browser if stored in SharePoint Online, but rather these files get downloaded upon opening. The workaround – rename them to .aspx. The following scripts does this for all .html files and renames them to .aspx

Code

$cred = Get-Credential
Connect-PnPOnline -Url "http://mytenant.sharepoint.com/sites/demo" -Credentials $cred
$ctx = Get-PnPContext
$libraries = Get-PnPlist | Where{$_.BaseTemplate -eq 101}
foreach($lib in $libraries) {
	write-host "Getting items from $($lib.Title)"
	$items = Get-PnPListItem -List $lib -Fields "Title", "FileLeafRef" | where {$_["FileLeafRef"] -like "*.html"}
	write-host "Looping through the items"
	foreach($item in $items) {
		$file = $item.File
		$ctx.Load($file)
		$ctx.Load($file.ListItemAllFields)
		$ctx.ExecuteQuery()
		write-host "Renaming file $($file.Name)"
		$newName = $file.Name -Replace "\.html",".aspx"
		Move-PnPFile -ServerRelativeUrl $file.ServerRelativeUrl -TargetUrl "$($file.ListItemAllFields['FileDirRef'])/$($newName)" -Force
	}
}

Office 365 Advent Calendar – 22 Modern and Classic Experience in SharePoint Online

office-365-advent-calendar

Earlier this year, Microsoft announced and rolled out the modern experience for lists. They didn’t stop at that, but also introduced modern pages and sites. But what are the differences to the ‘classic experiences’, so the type of lists, libraries, pages, and sites that we’ve been using now for many years? How can you switch between these two experiences? And how can you customise the modern experience items? Luckily, there’s some good guidance available from Microsoft.

First of all, it should be noted that the classic experience won’t disappear anytime soon. While Microsoft is rolling out the modern experience, the classic experience will still remain available. However, it should be noted that the functionality set between these two can be quite different. Review the links listed further below for details.

How do I switch between experiences?

For lists and libraries, please have a look at Switch the default experience for lists or document libraries from new or classic.

For modern sites and pages, the situation is a bit more different. You can’t switch a site between the classic and the modern experience. You also can’t upgrade a ‘classic’ site to a ‘modern’ site, however you can enable the corresponding capabilities to make a ‘classic’ site make use of the ‘modern’ features.

 

What are the differences between ‘classic’ and ‘modern’ lists/libraries?

This article provides some details on which functionality is currently only available in the ‘classic experience’. As you can see, there is quite a range of useful functionality that is not yet in the ‘modern experience’. Note that not all differences are listed. For example, the new smart filters are only available in modern lists. Also, existing customizations will most likely not work anymore.

 

What kind of customization possibilities do I have for ‘modern experiences’?

Have a look at this great article by Vesa Juvonen, and the other pages mentioned in it.

 

Office 365 Advent Calendar – 21 Get all Instances of a Web Part in a SharePoint Online Site

office-365-advent-calendar

Scenario

Sometimes you may need to figure out where a specific type of web part has been used. Today, I’ll show you how you can check all pages in your Site Pages library for a specific web part.

I’ve had this code for a while as I was looking for some specific web parts (Content Editor) before. Yesterday, I briefly saw a blog post on dev.office.com announcing the deprecation of the Visio Web Access web part on SharePoint Online (as Visio Online is coming!), though that blog post has disappeared again (I suspect we’ll see it again soon). So I decided to modify it slightly to look for all instances of Visio Web Access web parts and save the results to a CSV file.

Code

The following code checks all pages in the given site’s Site Pages library for instance of the ‘Visio Web Access’ web part. You could easily modify it to loop through all sites in a site collection, or even all sites within your whole tenant.

$cred = Get-Credential
Connect-PnPOnline -Url https://mytenant.sharepoint.com/sites/pagestest -Credentials $cred

$visioWebParts = @()

$ctx = Get-PnPContext
$lists = (Get-PnPWeb).Lists
#Note: I'm not accessing the Site Pages library by URL or title, as I had sites in different languages
$sitePages = $lists.EnsureSitePagesLibrary()
$ctx.Load($lists)
$ctx.Load($sitePages)
$ctx.ExecuteQuery()

$pages = Get-PnPListItem -List $sitePages[0].Id
foreach($page in $pages) {
	$ctx.Load($page.File)
	$ctx.ExecuteQuery()
	$webparts = Get-PnPWebPart -ServerRelativePageUrl $page.File.ServerRelativeUrl
	foreach($webpart in $webparts) {
		$wpxml = Get-PnPWebPartXml -ServerRelativePageUrl $page.File.ServerRelativeUrl -Identity $webpart.Id
		# The Visio Web Access part is referenced in the XML definition of the web part
		# with type Microsoft.Office.Visio.Server.WebControls.VisioWebAccess. Change this for
		# any other types of web parts you want to find 
		if($wpxml -Match '<type name="Microsoft.Office.Visio.Server.WebControls.VisioWebAccess,') {
			$visioWebParts += New-Object PSObject -Property @{
				'PageUrl' = $page.File.ServerRelativeUrl
				'WebPartTitle' = $webpart.WebPart.Title
			}
		}
	}
}

$visioWebParts | select PageUrl, WebPartTitle | Export-Csv C:\visio.csv

Office 365 Advent Calendar – 20 Get notified about new SharePoint Online Site Collection Administrators

office-365-advent-calendar

If your organization provides business users with the possibility to manage sites themselves by assigning them site collection administrator rights, you may want to know if they add anyone else as site collection administrator. While you could run a script regularly to retrieve a list of all site collection administrators on all sites and then compare this data with previous information, there is also an alternative that you can use. Office 365 provides you with the option to get alerted when someone gets added as a site collection administrator.

First, open the Office 365 Security & Compliance portal. Select Alerts and ‘Manage alerts’, then click on ‘Add an alert’ in the right content pane

 

Setting up the alert is fairly easy. Start by specifying a name and optionally a description. The most important setting is “Send this alert when…” where you specify which activities you want to get alerted on. Select ‘Added site collection admin’ here. Sadly, there is no way to monitor removal of site collection admins.

Lastly, specify who should be alerted, and save your alert.

Please note the following: “It can take up to 30 minutes or up to 24 hours after an event occurs for the corresponding audit log entry to be displayed in the search results.” (Search the audit log in the Office 365 Security & Compliance Center). This means that notifications are not immediate, but may take some time until the corresponding event appears in the audit logs and the alert gets triggered.

Office 365 Advent Calendar – 18 Adding a Web Part to a SharePoint Online Page with PowerShell

office-365-advent-calendar

Scenario

You’ve got a Web Part which you want to add to one, but more likely multiple web part pages in a SharePoint Online Site. Or maybe even on multiple pages across multiple sites. You could do this manually, but adding the same web part with the same configuration over and over again may not be a productive use of it. Let’s make use of PowerShell to do this!

Code

The code itself is quite simple, as the PnP PowerShell cmdlets contain a cmdlet named Add-PnPWebPartToWebPartPage. All you need is the page where you want to add the web part as well as the XML of your web part.

Let’s say you’ve got a “This SharePoint site will be archived on 31/12/2016” message which you want to add to the default.aspx page on a list of sites. You can create the Web Part with the desired message and formatting once, then export it:

Once exported, you can use the following script to add the same web part to all default.aspx pages on all sites listed in SitesToArchive.csv. The Web Part will be added to the Zone named “Left” with an index of 0, that is at the top of it:

$cred = Get-Credential
$websToUpdate = Import-Csv SitesToArchive.csv
foreach($web in $websToUpdate) {
	write-host "Connecting to $($web.Url)"
	Connect-PnPOnline -Url $web.Url -Credentials $cred
	Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "default.aspx"`
	-Path "c:\users\rmodery\Desktop\ArchiveMessageWebPart.dwp" -ZoneId "Left" -ZoneIndex 0
}

 

How about wiki pages in SharePoint Online? Add-PnPWebPartToWikiPage may help you here!

Office 365 Advent Calendar – 17 Overview of the new OneDrive for Business Admin Portal

office-365-advent-calendar

At the Microsoft Ignite conference in September, it was announced that OneDrive for Business would get its own Admin Portal in Office 365. Yesterday, Microsoft finally made it available, even though it’s in Preview at the moment. See the official announcement here, and access it at https://admin.onedrive.com.

So what does it include? Some existing settings, such as configuring your sharing settings, as well as new settings like the possibility to restrict access to certain IP addresses. Here’s a detailed overview of the current status:

 

Sharing

In this section, you can control if sharing with externals is enabled, and if so, with which configuration. These are the same settings which currently exist in the SharePoint Admin Portal.

 

Sync

In the Sync section, you can define a few settings related to the OneDrive for Business client. First of all, whether user can install the client from the website. You can also define if syncing should be restricted to PCs that are joined to specific domains –  to retrieve the GUIDs you need to enter here follow these instructions. This setting is extremely helpful if you want to ensure that your users don’t use for example their personal PCs to synchronise content. Lastly, you can also restrict which file types can be synced.

 

Storage

This is a simple section – define how muich default storage is available for new users, and define how long you want to keep files in a user’s OneDrive after his account is scheduled for deletion. This setting could previously be set via PowerShell only, and allows for values between 30 and 3650 days (yes, the maximum retention period is 10 years).

 

Device access

If you want to control from which devices and locations content can be accessed, you can define specific IP addresses here or define your Intune settings.

Compliance

Lastly, the Compliance section provides you with a range of links to existing pages where you can define auditing, DLP, retention, eDiscovery, and Alerts settings.

Office 365 Advent Calendar – 16 Adoption Guide for Office 365

office-365-advent-calendar

Having access to a technology is not enough, the users and the company should see some benefits from it in order to achieve some value out of this investment. This is something that is often forgotten when we work with SharePoint or Office 365 – the wonderful new feature that was just released might not be useful to your employees at all, and trying to force it on them will make things rather worse than better. Additionally, just because a new functionality could be used for a lot of purposes doesn’t mean that your users will actually do so – they may not know how to use it, they may have a preference for a familiar, older technology, or they may not even know what the new functionality can do for them. This is where adoption comes in.

“At Microsoft, we want you to make the most of your investment in Office 365 and planning is key to achieving this.”

The statement above is taken directly from Microsoft’s brand new Office 365 Adoption Guide which they quietly released this week. While the guide feels a little bit like marketing material for Microsoft’s FastTrack, it is still full of good content that you can leverage. The purpose of this document is to guide you along the way to make the rollout of Office 365 in your organization a success.

Microsoft divides their adoption guide into three different phases:

Phase 1: Envision Identify key stakeholders, assemble your team, identify and prioritize Business Scenarios, and collaborate with key stakeholders to create a Success Plan for the adoption of Office 365 in your organization. Phase 2: Onboard Execute your Success Plan to onboard your organization to the technology, and help your people work in a new way. Start with an early adoption program and then expand to cover your whole organization. Phase 3: Drive Value Realize ongoing value from your Office 365 investment by continuing to boost user engagement and drive adoption. Manage and prepare for change by measuring and sharing the success of Office 365, while understanding where to iterate for future improvements

Obviously, this is based on and influenced by their FastTrack experiences:

FastTrack

 

I recommend that you review the adoption guide even if you’re not planning to use FastTrack – the content inside will surely help you to plan how you can tackle Office 365 adoption. Additionally, the Productivity Library provides a nice range of examples on how Office 365 can be used in various industries and scenarios. Another resource to review if you want to hold a discussion with business stakeholders on the potential benefits they may see.

 

Office 365 Advent Calendar – 15 Activating Publishing Features on SharePoint Online Sites with PowerShell

office-365-advent-calendar

Scenario

Activating SharePoint’s Publishing features can easily be done on a single site collection or site. But what if you need to activate Publishing on a hierarchy of subsites, or across multiple site collections?

Code

Once again, we’re using the PnP PowerShell cmdlets.

First some basics. The ‘main’ feature to activate is the PublishingSite feature on the Site Collection level. After you connected to a site collection (Connect-PnPOnline), you can activate it as follows:

Enable-PnPFeature -Identity f6924d36-2fa8-4f0b-b16d-06b7250180fa -Scope Site

The -Scope Site parameter is important, as the default for this parameter is set to Web, and the feature wouldn’t get activated without specifying it correctly.

Once that’s done, we can activate the PublishingWeb feature for the current site (on a Web scope):

Enable-PnPFeature -Identity 94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb