Tag Archives: site collection

Reusing Your Customized SharePoint Web Parts

Let’s say you have a sweet web part, it might be something cool with JavaScript, jQuery, or SPServices, a simple weather web part, a data view web part, or an image. Whatever you made (with some exception, keep reading), you can export your web part and copy it over to another page or site within SharePoint, or even to an entirely different SharePoint farm, to quickly reuse your master piece.

The process is straight forward, and applies to a few web parts. Unfortunately, the normal list view web parts (viewing lists and libraries in your site) are not exportable, and cannot be copied to another site or page. You’ll have to recreate those on each page. The common exportable web parts include the Content Editor, HTML Form, XML Viewer, Image Viewer and Page Viewer. Basically, anything that’s highly customizable.

Once you have your web part done and ready to be exported and copied to another location, you want to edit the web part (hit the web part menu at the top right). When it’s in edit mode, click the web part menu again and you’ll see the Export option.

Export a SharePoint web part

Click Export. You will be prompted to download the file. The file name will assume the title of your web part, with a suffix of .dwp. Save this file onto your computer.

Your web part is now exported! If you plan on moving this to another site or farm, make sure you download any supporting files, like jQuery, SPServices, images, etc. which will be needed by the web part.

You have two options to reuse this exported web part.

  1. You can upload it and use it on a per need basis, per page/site as needed.
  2. You can upload it to the web part gallery and make it available across the site collection.

We’ll walk through both options.

First, if you want to use this per page/site:

  • Navigate to that page.
  • Edit the page (which you know how to do since you created the web part, but just in case you forgot, press the Site Actions menu at the top, select Edit Page).
  • If you’re using a wiki page, place your cursor in the content below where you want your web part to appear. Press the insert tab in the ribbon, then click Web Part.
  • If you’re using a web part page, click the Add a Web Part button above the zone you wish to add the web part to.
  • In the ribbon, below the list of categories is a little link labeled Upload a Web Part. Click that and click Browse, select your dwp file you downloaded previously and click Upload.
    Upload web part to SharePoint
  • After it uploads, you may lose the insert web part ribbon. Just click the Insert Web Part option again.
  • At the top of the categories list you should see a new folder Imported Web Parts. Your web part should be in there. Go ahead and insert it!

You can repeat these same steps on each page or site you wish to use the web part on.

In some cases, you may want to use this web part across an entire site collection, giving power users and other admins the ability to use it at their discretion. This is just as simple as above.

  • Navigate to the root site.
  • Go to Site Settings (Site Actions > Settings).
  • Click Web Parts under Galleries.
    • If you’re not in the root site, you won’t see this link. Click Go to top level site settings under Site Collection Administration.
  • Click Documents in the ribbon and click Upload. Just like any other document library, you can navigate to your downloaded file and upload it.
  • After it’s uploaded, you’ll be prompted to save some meta data about the file. Here you can rename the web part if needed, give it a description, and specify which group to save it in. I suggest specifying a group which will make it easy to find, like CompanyName, or My Web Parts.
  • Click Save.

Now when you go to edit a page and add a web part, you’ll see your new group on the left, which will contain your web part.

Uploaded Web Part to Site Collection Gallery

Happy SharePointing!

Advertisements

SharePoint 2010 Web Parts and Their Features

Below is a list of all of the “out of the box” web parts that comes with SharePoint 2010. The column on the right highlights which Site Collection Feature you have to activate to enable the web parts. Some web parts will require additional farm solutions like SQL Reporting.

Business Data

Business Data Actions – Displays a list of actions from Business Data Connectivity. SharePoint Server Enterprise Site Collection features
Business Data Connectivity Filter – Filters the contents of Web Parts using a list of values from the Business Data Connectivity. SharePoint Server Enterprise Site Collection features
Business Data Item – Displays one item from a data source in Business Data Connectivity. SharePoint Server Enterprise Site Collection features
Business Data Item Builder – Creates a Business Data item from parameters in the query string and provides it to other Web Parts. SharePoint Server Enterprise Site Collection features
Business Data List – Displays a list of items from a data source in Business Data Connectivity. SharePoint Server Enterprise Site Collection features
Business Data Related List – Displays a list of items related to one or more parent items from a data source in Business Data Connectivity. SharePoint Server Enterprise Site Collection features
Chart Web Part – Helps you to visualize your data using charts, pull data from another web part, SharePoint lists, Business Data Catalog, or Excel Services. SharePoint Server Enterprise Site Collection features
Excel Web Access – Use the Excel Web Access Web Part to interact with an Excel workbook as a Web page. SharePoint Server Enterprise Site Collection features
Indicator Details – Displays the details of a single Status Indicator. Status Indicators display an important measure for an organization and may be obtained from other data sources including SharePoint lists, Excel workbooks, and SQL Server 2005 Analysis Services KPIs. SharePoint Server Enterprise Site Collection features
Status Lists – Shows a list of Status Indicators. Status Indicators display important measures for your organization, and show how your organization is performing with respect to your goals. SharePoint Server Enterprise Site Collection features
Visio Web Access – Enables viewing and refreshing of Visio Web Drawings, like org charts, workflows, business processes and more. SharePoint Server Enterprise Site Collection features

Content Rollup

Categories – Displays categories from the Site Directory, discontinued in SharePoint 2010, available for SharePoint 2007 upgrades. SharePoint Server Standard Site Collection features
Content Query – Rolls up data from sub sites throughout your site. Data can be queried and filtered based on content type, site columns, and specific lists and libraries. SharePoint Server Publishing Infrastructure
Relevant Documents – Displays documents that have been modified by, created by, or checked out to the current user, within the current web site (not the entire site collection). Fresh Install
RSS Viewer – Displays an RSS feed from other websites or services. SharePoint Server Standard Site Collection features
Site Aggregator – Displays specific information from the sites of your choice, defaults to showing documents similar to Relevant Documents. SharePoint Server Standard Site Collection features
Sites In Category – Displays sites from the Site Directory within a specific category, discontinued in SharePoint 2010, available for SharePoint 2007 upgrades. SharePoint Server Standard Site Collection features
Summary Links – Allows authors to create a custom link library that can be grouped and styled. SharePoint Server Publishing Infrastructure
Table Of Contents – Displays the navigation hierarchy of your site, subsites, lists and libraries. SharePoint Server Publishing Infrastructure
Web Analytics Web Part – Displays the most viewed content, most frequent search queries from a site, or most frequent search queries from a search center. Advanced Web Analytics
WSRP Viewer – Displays portlets from web sites using WSRP 1.1. SharePoint Server Enterprise Site Collection features
XML Viewer – Transforms XML data using XSL and shows the results. Fresh Install

Filters

Apply Filters Button – Add this button to a page so users can decide when to apply their filter choices. Otherwise, each filter is applied when its value is changed. SharePoint Server Enterprise Site Collection features
Choice Filter – Filters the contents of Web Parts using a list of values entered by the page author SharePoint Server Enterprise Site Collection features
Current User Filter – Filters the contents of Web Parts by using properties of the current user SharePoint Server Enterprise Site Collection features
Date Filter – Filter the contents of Web Parts by allowing users to enter or pick a date SharePoint Server Enterprise Site Collection features
Page Field Filter – Filters the contents of Web Parts using information about the current page SharePoint Server Enterprise Site Collection features
Query String (URL) Filter – Filters the contents of Web Parts using values passed via the query string SharePoint Server Enterprise Site Collection features
SharePoint List Filter – Filters the contents of Web Parts by using a list of values SharePoint Server Enterprise Site Collection features
SQL Server Analysis Services Filter – Filters the contents of Web Parts using a list of values from SQL Server Analysis Services cubes SharePoint Server Enterprise Site Collection features
Text Filter – Filters the contents of Web Parts by allowing users to enter a text value SharePoint Server Enterprise Site Collection features

Forms

HTML Form Web Part – Connects simple form controls to other Web Parts Fresh Install
InfoPath Form Web Part – Use this Web Part to display an InfoPath browser-enabled form SharePoint Server Enterprise Site Collection features

Media and Content

Content Editor – Allows authors to enter rich media content like formatted text, images, and other custom HTML. Fresh Install
Image Viewer – Displays a specified image. Fresh Install
Media Web Part – Use to embed media clips (video and audio) in a web page, links directly to a video file, not a video service like YouTube.com. SharePoint Server Publishing Infrastructure
Page Viewer – Displays another Web page on this Web page inside of a window. Fresh Install
Picture Library Slideshow Web Part – Use to display a slideshow of images and photos from a picture library Fresh Install
Silverlight Web Part – A web part to display a Silverlight application Fresh Install

Outlook Web App

My Calendar – Displays your calendar using Outlook Web Access for Microsoft Exchange Server 2003 or later SharePoint Server Standard Site Collection features
My Contacts – Displays your contacts using Outlook Web Access for Microsoft Exchange Server 2003 or later SharePoint Server Standard Site Collection features
My Inbox – Displays your inbox using Outlook Web Access for Microsoft Exchange Server 2003 or later SharePoint Server Standard Site Collection features
My Mail Folder – Displays your mail folder using Outlook Web Access for Microsoft Exchange Server 2000 SharePoint Server Standard Site Collection features
My Tasks – Displays your tasks using Outlook Web Access for Microsoft Exchange Server 2003 or later SharePoint Server Standard Site Collection features

PerformancePoint

PerformancePoint Filter – This web part displays PerformancePoint filters. Filters may be linked to other web parts to provide an interactive dashboard experience. Filter types include lists and trees based on a variety of data sources PerformancePoint Services Site Collection Features
PerformancePoint Report – This web part displays PerformancePoint reports. Reports may be linked to other web parts to create an interactive dashboard experience. Report types include: Analytic charts & grids, Strategy Maps, Excel Services, Reporting Services, Predictive Trend charts, and web pages PerformancePoint Services Site Collection Features
PerformancePoint Scorecard – This web part displays a PerformancePoint scorecard. Scorecards may be linked to other web parts, such as filters and reports, to create an interactive dashboard experience. PerformancePoint Services Site Collection Features
PerformancePoint Stack Selector – This web part displays a PerformancePoint Stack Selector. All PerformancePoint web parts, such as filters and reports, contained in the same zone will be automatically stacked and selectable using this web part. PerformancePoint Services Site Collection Features

Search

Advanced Search Box – Displays parameterized search options based on properties and combinations of words. SharePoint Server Standard Site Collection features
Dual Chinese Search – Used to search Dual Chinese document and items at the same time. SharePoint Server Standard Site Collection features
Federated Results – Displays search results from a configured location SharePoint Server Standard Site Collection features
People Refinement Panel – This webpart helps the users to refine people search results SharePoint Server Standard Site Collection features
People Search Box – Presents a search box that allows users to search for people SharePoint Server Standard Site Collection features
People Search Core Results – Displays the people search results and the properties associated with them. SharePoint Server Standard Site Collection features
Refinement Panel – This webpart helps the users to refine search results SharePoint Server Standard Site Collection features
Related Queries – This webpart displays related queries to a user query SharePoint Server Standard Site Collection features
Search Action Link – Displays the search action links on the search results page SharePoint Server Standard Site Collection features
Search Best Bets – Displays high-confidence results on a search results page. SharePoint Server Standard Site Collection features
Search Box – Displays a search box that allows users to search for information. SharePoint Server Standard Site Collection features
Search Core Results – Displays the search results and the properties associated with them SharePoint Server Standard Site Collection features
Search Paging – Display links for navigating pages containing search results. SharePoint Server Standard Site Collection features
Search Statistics – Displays the search statistics such as the number of results shown on the current page, total number of results and time taken to perform the search. SharePoint Server Standard Site Collection features
Search Summary – Displays suggestions for current search query SharePoint Server Standard Site Collection features
Search Visual Best Bet – Displays Visual Best Bet SharePoint Server Standard Site Collection features
Top Federated Results – Displays the Top Federated result from the configured location SharePoint Server Standard Site Collection features

Social Collaboration

Contact Details – Displays details and image for a single contact. SharePoint Server Standard Site Collection features
Note Board – Enable users to leave short, publicly-viewable notes about this page. SharePoint Server Standard Site Collection features
Organization Browser – This Web Part displays each person in the reporting chain in an interactive view optimized for browsing organization charts. Additional information has to be managed in Active Directory. SharePoint Server Standard Site Collection features
Site Users – Use the Site Users Web Part to see a list of users and groups who have access to the current site, or list users from a selected group. Fresh Install
Tag Cloud – Displays the most popular subjects being tagged inside your organization SharePoint Server Standard Site Collection features
User Tasks – Displays tasks that are assigned to the current user within the site, does not include all tasks in site collection. Fresh Install

SQL Server Reporting

SQL Server Reporting Services Report Viewer – Use the Report Viewer to view SQL Server Reporting Services reports. Report Server Integration Feature

Using PowerShell to access SharePoint Sites, Users, and Groups

In this post I am going to dive into some of the basics of accessing your SharePoint sites using PowerShell. This is a pretty basic concept, but something that I think is worth knowing. Understanding the basics allows us to dive deeper into the more complex stuff.

So let’s start! On one of the SharePoint servers, open your SharePoint 2010 Management Shell (Start > All Programs > Microsoft SharePoint 2010 Products). You may have to right click on the app and select Start as Administrator to get the correct permissions.

PowerShell Window

You will get a nice black window, type in cd\ to get to the root. This gives us a little more room to work with. At any time, you can type in cls to clear the screen, this is helpful to keep your eyes focused.

First things first, let’s get a site collection. Type in the following, followed by the Enter key

$site = Get-SPSite http://yoursitename

Now the $site object is your site collection. If it worked correctly, you’ll just be returned to the command prompt

Get-SPSite

Let’s make sure you have the right site, so lets check the URL. Type in the following and press enter after

$site.URL

And that should return your address to the site collection. Want to see all webs in your site? Type in

$site.allwebs

SPSite all webs

Pretty neat eh? You can get the site owner now

$site.owner

SPSite site owner

You can explore the site object and all of its properties and methods by referencing MSDN article http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite_properties.aspx .

Initially we used the Get-SPSite command to get a site. If you leave the address off, and just type in get the command, we can get all sites back

get-spsite

Get-SPSite

Using the previous reference to MSDN, we can add additional properties for a nice report. Let’s pull all site collections with their associated content database.

get-spsite | format-table -property URL,contentdatabase

Get-SPSite properties

And you’ll see all my site collections are in the same database.

Ok, back to our first $site. Now let’s get the root web and check the name.

$root = $site.rootweb
$root.title

Get root web

You just got your first site! Good job! There’s a slightly faster way to get a website. Instead of getting the site then getting the web, you can just call Get-SPWeb http://youraddress, and that will return the web for you.

So if you want to grab a subsite, you would call

$web = Get-SPWeb http://address/site/site/site

Now that you have a web, you can explore it’s properties and find out some more information about it. Check out MSDN article: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb_properties.aspx.

Back to our $root. Let’s get a list of all users in the web.

$root.allusers

Next, let’s see who’s a site admin, and whether or not any of these users are domain groups.

$root.allusers | format-table -property displayname, issiteadmin, isdomaingroup

The additional properties, issiteadmin, isdomaingroup, are from the SPUser object (see http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spuser_properties.aspx for more detail).

Let’s check out the groups of the site.

$root.groups | format-table -property name, owner, users

If you run just $root.groups (try it) it’ll dump out a lot of information at once. Formatting and selecting our data makes it easier to work with.

The above results tells us the groups of the site, and who owns it, and a sneak peak of the users within the group. Let’s explore one group to see all of the users in it.

$group = $root.groups["Sideswipe Members"]
$group.users

To get a user, you need to know the user’s ID or email address. To find this info, you can add the properties to the above command

$group.users | format-table -property displayname, id, email

No, my users do not have email addresses, so I’ll have to use the ID. Either way, you would use

$user = $group.users.getbyemail("emailaddress")

or

$user = $group.users.getbyid(17)

Confirm you have the right users

$user.displayname

This was a very top level overview of accessing some of SharePoint’s objects. From here, now that you know how to get some of the common objects, you can query some more, update values and properties, add users to groups, etc. Microsoft’s MSDN site is extremely helpful in exploring these objects.

Please leave a comment below if you want to see something more specific.

Initial Topology Planning: Site Collections vs Subsites

If you don’t know about SharePoint 365 yet, go check it out! It’s at www.sp365.co.uk. I occasionally write for that site, and that’s where this post will go. Check out my post Initial Topology Planning: Site Collections vs Subsites.

 

 

SharePoint PowerShell – a newbie’s findings

Yes, at this point in my life, I’m very new to PowerShell, and I’m okay with that. I was hesitant to make the jump, especially for use with SharePoint. Using stsadm for the last 7 years has been my security blanket. PowerShell, the new kid on the block, appeared to be threatening, almost bully like.

I decided, like most bullies, to figure out why he’s the bully, why is he acting this way, and give him a hug anyway. I found that PowerShell isn’t a bully. It’s a wonderful new world of extensions and options well beyond stsadm. As a developer, I quickly saw potential for PowerShell in so many areas.

Actually, as a developer, I discovered that it is more of a programming language than a command line tool, if that makes sense. If you’re not a developer, that’s okay, you don’t have to be. There’s a lot of help out there in finding almost anything you want to make PowerShell do.

There’s a lot of scripts available for the typical administrator, which will run a set of PowerShell commands to complete most tasks needed, inside and outside of SharePoint. There’s a whole new worlllddd… for youuu annnd meee….

So if you’re thinking about using PowerShell or want to understand it more, just do it, it’s worth it. I started in by reading Microsoft SharePoint 2010 Unleashed (Chapter 7), a good start into what PowerShell can do, especially for SharePoint. I’m sure there are other PowerShell resources out there.

As I dove in deeper, the more PowerShell felt like C#, and I found myself referencing the SharePoint API in the same manner I would in C#. Instead of creating a large Visual Studio project for some tasks, I can write a single file PowerShell script to so the same thing. Pretty sweet.

During my learning process, I created a few scripts which I would like to share below. They’re part of my sp2010adminpack.codeplex.com project. Use if you’d like, critique if you want.

Manage-Sites.ps1

Sorry, I’m no good at naming these things. This script is a growing effort, see the CodePlex project to check out any updates. This script walks you through your web applications, site collections and then to your sites. Allows you to back up your site collections, and view a list of all lists and libraries including their type and item count. I’m looking for more ideas and functionality to add to this.

Create-SiteCollection.ps1

This script simply creates a new site collection. This script will collect the web application you want to create it in, and the name and URL of the new site collection. Then BLAMO, a new site is created and opens in IE for you.

Backup-SiteCollections.ps1

The script loops through all of your web applications and site collections and backs them all up. Backups are prefixed with current time. Edit the file to specify your back up settings and then set it on a schedule and forget it.

Download the scripts from CodePlex

So the big bully has been won over, and I’ve fallen in love with it. I was a little worried that PowerShell would minimize the need for a developer, since you can do so much through it, but you still need that skill set to understand what it’s doing, and how.