SharePoint 2010–Using PowerShell to Display Currently Running Timer Jobs

Sometimes I need to know what timer jobs are running on the farm at a given moment.  Here’s how you do it in PowerShell:

# Get current date
$date = Get-Date

# Show current date
Write-Host "Looking for running jobs with a Last Run Time of greater than or equal to" $date

# Get all Timer jobs and iterate
Get-SPTimerJob | ForEach-Object {

  # Get last run time for job
  $lastRunTime = $_.LastRunTime

  # If run time is greater than/equal to write it out
  if ($lastRunTime -ge $date)
  {
     Write-Host $_.Name", last run at" $_.LastRunTime
  }
}

If you want to include a bit of history, like number of jobs run in the last five minutes, just use this for your $date variable:

$date =  (Get-Date).AddMinutes(-5)

Many Uses of J-B Weld, But is DevCon is better?

I have used J-B Weld for quite a few years.  It is to super glue what super glue is to Elmers glue.  Just awesome.  There area number of other two-part epoxy products available, but quite frankly I’d never found any to be the equal of J-B Weld.  It is the duct tape of the epoxy world, but then I found DevCon’s line of products.

For comparison, here’s what JB-Weld says about their product:

  • Tensile Strength: 3960
  • Adhesion: 1800
  • Flex Strength: 7320
  • Tensile Lap Shear: 1040
  • Shrinkage: 0.00%
  • Resistant to: 500° F

 

Seriously, just look at some of these ridiculous numbers from DevCon’s products:

 

image

I can’t wait for something to break around the house, because I’m dying to put some of this stuff to the test…

SharePoint 2010 – Create KPIs in Dashboard Designer

Microsoft SharePoint Server 2010 adds important new tools for Business Intelligence (BI).  Two especially big additions are PerformancePoint Services, SQL PowerPivot for Excel, and SQL PowerPivot for SharePoint.

In PerformancePoint Services in Microsoft SharePoint Server 2010, a key performance indicator (KPI) is a scorecard element that shows at a glance whether performance is on- or off-target for a particular metric. KPIs can vary greatly in their appearance and complexity, but KPIs typically calculate how actual values compare to target values and indicate performance by using a graphical indicator.A PerformancePoint scorecard can include one or more KPIs.

Microsoft, in typical fashion have given SharePoint Server 2007 Key Performance Indicators (KPIs) a new name, SharePoint Status Indicators. The new name helps highlight the differences between BI features in SharePoint 2007 and those in SharePoint Server 2010.

 

SharePoint 2007 Name

SharePoint 2010 Name

SharePoint 2010 Description

Key Performance Indicator

Status Indicator

An item in a Status List that displays performance information at a glance.

KPI List

Status List

A SharePoint list that contains formatted status indicators.

Key Performance Indicators (web part on dashboard)

Status List

A list of status indicators in a Web Part that can be added to a page on a SharePoint site.

KPI Details

Status Indicator Details

A page that displays details about a single status indicator.

Dashboard page

Web Part Page with Status List

A pre-designed Web Part page that contains a Status List Web Part, a Filter Web Part, and several other Web Parts.

A status indicator is a one-line report. At a glance, a status indicator shows how actual performance for a particular measure compares to a goal. A good status indicator lets you know, without requiring calculations, if results are on target or off target.

Sharepoint 2010 – There are two ways to create a KPI

Import a KPI - When you import a KPI, you use the Create a Scorecard wizard in Dashboard Designer. The wizard enables you to copy one or more KPIs from the database server into Dashboard Designer and then configure those KPIs. Select this method when you are creating a scorecard by using the wizard or when you want to import existing KPIs from a data source.
Create a KPI – When you create a KPI, you use the Create a KPI wizard in Dashboard Designer. Select this method when you want to create a KPI separate from creating a scorecard or when you want to create and configure a new KPI that you define.

To import a KPI by using the Create a Scorecard wizard

1. In Dashboard Designer, in the Workspace Browser, click PerformancePoint Content.

2. In the ribbon, click the Create tab.

3. In the ribbon, in the Dashboard Items group, click Scorecard. The Select a Scorecard Template dialog box opens.

4. In the Category pane, click All. Then, in the Template pane, click one of the following templates:

  • Analysis Services
  • Excel Services

  • Excel Workbook

  • SharePoint List

  • SQL Server Table

The template that you select corresponds to the kind of data source that you plan to use for the scorecard. For example, if you want to import a KPI that is stored in an Analysis Services database, select the Analysis Services template. After you have selected the template that you want to use, click OK.

5. In the Select a data source page, review the list of data sources on the SharePoint Site and Workspace tabs. Select the data source that you want to use, and then click Next.

6. If you selected the Analysis Services scorecard template, the Select a KPI Source page opens. (Otherwise, proceed to step 7.)

Select the Create KPIs from SQL Server Analysis Services measures option, and then click Next.

7. In the Select KPIs to Import page, select the KPI (or KPIs) that you want to use by following these steps:

Click Add KPI. A KPI from the data source that you selected for the scorecard appears. Continue clicking Add KPI until you see the KPI (or KPIs) that you want to use. To remove any KPIs from the list, select a KPI and then click Delete Selected KPIs.Click Next.

8. On the Add Measure Filters page, click Next.

9. On the Add Member Columns page, click Next.

10. On the Locations page, confirm that the correct location is specified in the Create KPIs in list, and then click Finish.

To create a KPI by using the Create a KPI wizard

1. In Dashboard Designer, in the Workspace Browser, click PerformancePoint Content.

2. In the ribbon, click the Create tab.

3. In the ribbon, in the Dashboard Items group, click KPI.

4. The Select a KPI Template dialog box opens.

5. In the Template pane, select either the Blank KPI or Objective template, and then click OK.

  • Select Blank KPI to create a single KPI.
  • Select Objective to create a KPI that serves as a heading for a group of other KPIs.

The KPI that you have created opens for editing in the workspace where you can configure it.

SharePoint–Use PowerShell to Create a CSV Report of All Lists and Items In a Site

Dealing with SharePoint sites in the business, there are a lot of owners who are curious about who on their team contributes to the site, what documents were getting updated, and how many times versions were being created.  Now this can all be gathered from the audit reports (assuming you have them turned on) and you can view them as well.  However, they don’t really lend themselves to a very user friendly experience (hence all these third party audit log viewers that have recently popped up).  And there are companies that don’t want to deal with the overhead of audit events taking up space in their content database.  I was asked for a simple “at-a-glance” sort of report that would list out all the lists and all the files on a site, who created them and what version they were.

With PowerShell this is actually pretty easy.  And while we won’t be able to get a complete history if the files have gone beyond their version retention limits, in most cases it satisfied the business need to just send them a spreadsheet with all the files, what versions were stored in the site, when they were created and by whom.  Since this is done as a spreadsheet and of course in SharePoint we have Excel Services, that means we can also create some pretty interesting graphs and charts about site usage, who our most prolific contributors are, how often the site is updated and how recent the information is.

Here is the basic code for generating an excel spreadsheet of all the items in all the lists for a particular SPWeb:

$web = Get-SPWeb http://<SharePoint Site>
ForEach($list in $web.Lists) 
{
 ForEach($item in $list.Items)
 { 
  ForEach($version in $item.Versions)
  {    
    $fullURL = "$($web.URL)$($list.URL)/$($version.URL)"    
    "{0}`t{1}`t{2}`t{3}`t{4}" -f $fullURL, $version.VersionLabel, $version.CreatedBy.User.UserLogin, $version.Created, $list.BaseType  | out-file Versions.csv -Append  
  }   
 } 
} 

Obviously from here it could be modified to create a spreadsheet containing all of the SPWebs by including this ForEach loop:

$allWebs = Get-SPWebApplication | Get-SPSite -Limit All | Get-SPWeb -Limit All

ForEach ($web in $allwebs )

Or filtered for only the IsCurrentVersion property:

If ($Version.IsCurrentVersion -eq $true )

or otherwise modified to give you additional information about site usage which can then be linked into the BI tools of SharePoint to create additional dimensions and measures so that site and business owners can gain a better understanding of who is contributing to their sites, what kind of content is being added, and what sort of frequency updates occur.  You can even create KPIs for stale content.

Finally Microsoft Relieves Some of the Pain of Patching

Previously, the recommendation was to install first foundation, then server, then project if you had project server installed. This would lead to a LOT of patching in the past, now you just need to download and execute the package that fits your farm configuration and move on.  Bit nicer for those of us that have to deal with patching and it also means less down time and shorter time spent patching.  Keeps my Saturdays free-ish and my weekend users happier.  Thank you!

Updates for SharePoint 2010 Products
http://technet.microsoft.com/en-us/sharepoint/ff800847

Best practice

The packaging of cumulative updates changed as of August 31, 2011. The following packages are provided for cumulative updates:

  • SharePoint Foundation 2010
  • SharePoint Foundation 2010 + SharePoint Server 2010
  • SharePoint Foundation 2010 + SharePoint Server 2010 + Project Server 2010

As a result of the new packaging, it is no longer necessary to install the SharePoint Foundation cumulative update and then install the SharePoint Server cumulative update.