Tag: visio

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

Updated free Visio stencils for Office 365, Exchange, Lync, and SharePoint – 2015 edition

A year ago, Microsoft released an updated set of Visio Stencils with icons for Office 365 and related products. They updated the set slightly and also provided the option to download the “older 2012 version”:

These stencils contain more than 300 icons to help you create visual representations of Microsoft Office or Microsoft Office 365 deployments including Skype for Business, Microsoft Exchange Server 2013, Microsoft Lync Server 2013, and Microsoft SharePoint Server 2013. The zip file now includes both stencil sets from 2012 and 2014.

Here’s an overview of all icons in the newest version:

Clouds

clouds

Communications

communications

Concepts

concepts1
concepts2

Databases

databases

Devices

devices

Security

security

Servers

servers

Services

services

Sites

sites

Users

users

Updated free Visio stencils for Office 365, Exchange, Lync, and SharePoint

Microsoft has released a new version of the set of visio stencils with icons for Office 365 and the corresponding server products:

This set of stencils contains more than 300 icons to help you create visual representations of Microsoft Office or Microsoft Office 365 deployments including Microsoft Exchange Server 2013, Microsoft Lync Server 2013, and Microsoft SharePoint Server 2013.

While the previous versions contained all stencils in a single file, this time they have separated them into 10 different sets. ¬†Here’s an overview of all icons in those sets:

Clouds

Communications

Concepts

Databases

Devices

Security

Servers

Services

Sites

Users