Archive for the 'Uncategorized' Category

Recover SharePoint 2013 installation key

I was reinstalling SharePoint 2013 Server in the lab tonight and discovered that I didn’t have the original license key that it was installed with. Googled online and found a number of Powershell scripts that claim to recover the key from the registry, but none of them worked – except this one, which was originally posted as a comment by KEMiCZA here. I can confirm that it worked for me.

This one should work SP-2013
function Get-SP2013ProductKey {
$value = (get-itemproperty “HKLM:\SOFTWARE\Microsoft\Office\15.0\Registration{90150000-110D-0000-1000-0000000FF1CE}”).digitalproductid
$baseAddress = 808
$needsN = ($value[$baseAddress + 14] -shl 3) -and 1;
$ProductKey = “”
for ($i = 24; $i -ge 0; $i–) {
$r = 0
for ($j = 13; $j -ge 0; $j–) {
$test = $value[$baseAddress + $j]
$r = ($r * 256) -bxor $value[$baseAddress + $j]
$floor = [math]::Floor(double)
$value[$baseAddress + $j] = $floor
$r = $r % 24
$ProductKey = $map[$r] + $ProductKey
$firstLetterIndex = 0
for ($i = 0; $i -lt $ProductKey.Length; $i++) {
if($ProductKey[0] -eq $map[$i])
$firstLetterIndex = $i
$ProductKeyWithN = $ProductKey = $ProductKey.substring(1) # Remove first character
$ProductKeyWithN = $ProductKeyWithN.SubString(0, $firstLetterIndex) + “N” + $ProductKeyWithN.SubString($firstLetterIndex)
$ProductKeyWithN = $ProductKeyWithN.SubString(0, 5) + “-” + $ProductKeyWithN.SubString(5, 5) + “-” + $ProductKeyWithN.SubString(10, 5) + “-” + $ProductKeyWithN.SubString(15, 5) + “-” + $ProductKeyWithN.SubString(20, 5)

SharePoint 2013 Hidden User List


Powershell script to export BDC models from SharePoint

This Powershell script exports Business Data Connectivity (BDC) service models from SharePoint.

# Get list of of all bdc models

$bdcs = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType “Model” -Name * -ServiceContext http://sharepoint

foreach($bdc in $bdcs)

# create a unique file name using the bdc name

$path = “.\$($bdc.DefaultDisplayName).bdcm”

# fetch the BDC object

$Model = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType “Model” -Name $bdc.DefaultDisplayName -ServiceContext http://sharepoint
Export-SPBusinessDataCatalogModel -Force -Identity $Model -Path $path


This script was developed by Dhejo Prothasis, Lead Architect at Acquiresoft Solutions.

Malaysia Airlines flight MH17 tribute

Ok, so this is not going to be a SharePoint or technology-related post..   Two days ago, a Malaysian Airlines flight Mh17 was shot down over eastern Ukraine by pro-Russian rebels.  This strikes close to home for me because I was born in Kyiv, Ukraine, and emigrated to the U.S. in 1991.  I’ve been following the news of the crash (and prior to that, the proxy war that Russian has been waging in eastern Ukraine).    I put together a video tribute to the victims of this awful tragedy – see links below.   As one U.S. intelligence official put it, “Let’s hope that this leads Vladimir Putin to a moment of sanity.”   Our prayers are with the victims and their families..


Malaysia Airlines MH17 Tribute

Vimeo (All locations):

YouTube (Only viewable outside of the U.S.):




Samurai Jack teaches SharePoint troubleshooting

Check out my little animated YoutTube video on SharePoint troubleshooting:

(Using animated clips from the old Cartoon Network show “Samurai Jack”)

How to export and import lists and libraries from a SharePoint 2010 site using Powershell

Let’s imagine this scenario:

You have an old SharePoint 2010 site and you need to copy its content to another SharePoint farm.  The site is heavily customized and moving it using traditional methods (backup/restore, export/import, save site as a template) are not going to work well.  Plus you only want content – no need to bring in all of that custom branding baggage.

You can copy the content using PowerShell and two scripts shown below.

Script # 1:   Export all lists and libraries from the source site.

add-pssnapin microsoft.sharepoint.powershell

# specify the site URL to export

$web = Get-SPWeb "http://sharepointURL/sites/site1/web1"

# specify output folder to store exported lists

$path = "c:\admin\export\"

foreach($list in $web.lists)


"Exporting " + $list.RootFolder.URL

export-spweb $web.URL -ItemUrl $list.RootFolder.URL -IncludeUserSecurity -IncludeVersions All -path ($path + $list + ".cmp") -nologfile


The output of this script should be a number of CMP files in the output directory.  Review these files and remove the lists that should not be imported (such as various Gallery lists).

Script # 2:  Import CMP files into the destination site.

add-pssnapin microsoft.sharepoint.powershell

# specify target SharePoint site to import into

$site = "http://sharepoint/sites/test1"

# specify folder containing exported lists

$folder = "C:\Admin\Import\"

$Files = Get-ChildItem $folder

foreach ($file in $files)

$name = $file.Name

"Importing: " + "$folder$name"

import-spweb $site -path ("$folder$name") -includeusersecurity -nologfile


Creating a SharePoint 2010 Search Service application using PowerShell

Here’s a great script by Jeremy Jameson on how to create a SharePoint 2010 Search service application with Powershell.

I was even able to use it to configure search on a SharePoint 2010 server which was not joined to the domain (as sometimes is required for DMZ deployments).  It worked beautifully using local computer accounts.   There is a change that needs to be made to the script if you’re using local accounts:

Add ShareName and Index arguments as shown below.

$queryComponent = New-SPEnterpriseSearchQueryComponent -QueryTopology $queryTopology -IndexPartition $indexPartition -SearchServiceInstance $queryInstance -Debug:$false -ShareName  <SHARENAME>  -IndexLocation <INDEXLOCATION>


RSS Information Week Headlines

  • An error has occurred; the feed is probably down. Try again later.

RSS SharePoint Team Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS InfoPath Team Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS Joel Oleson Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS Bud Ratliff blog

  • An error has occurred; the feed is probably down. Try again later.

RSS Susan Hanley’s KM Blog

  • An error has occurred; the feed is probably down. Try again later.

Blog Stats

  • 381,246 hits