Show storage overview for site-collections with PowerShell

PowerShell is very powerful and helps you to quickly get different views on your SharePoint environment. The Usage class can be used to retrieve Storage information for a particular site-collection. Combining this into a PowerShell script provides an overview of storage sizing for your personal storage sites (My Sites) for example.

In this example all My Sites are located within the namespace http://my.contoso.com. When querying the My Sites I’m using this as input. After the basic query I transform the output to get the report.

The first query can be used for the numbers based on megabytes (MB). I’m using the System.Math.Round() method to transform the output based on custom tables in PowerShell.

Get-SPSite -Limit ALL | ?{$_.Url -like "*my.contoso.com*"} | Format-Table Url, @{Expression={[math]::round($_.Usage.Storage/1MB, 3)};Label="Storage"} -AutoSize

The output is shown below.

PowerShell console, output storage query

When I change the formatting for better readability you get the following query. The column Storage is displayed based on string formatting.

Get-SPSite -Limit ALL | ?{$_.Url -like "*my.contoso.com*"} | Format-Table Url, @{Expression={($_.Usage.Storage/1MB).ToString("#,###.000 MB")};Label="Storage"} -AutoSize

This will impact the column Storage shown in the output below.

PowerShell console, output storage query with string Formatting

Enjoy! Have fun with PowerShell.

How to: Detect the installed SKU of SharePoint with PowerShell

Do you need to know which SharePoint SKU or edition is installed on your server? Are you sure your product is not running the trial version? Do you need SharePoint 2010/2013 SKU and/or patch level information from your customer or IT department? This article provides you an easy to use PowerShell script which checks the installed products on a server and outputs the version (patch level).

You can use the Get-SPEdition PowerShell script as is. Simply run the script or use the Functions and call Get-SPEdition. Using the PowerShell scripts results in the following output.

Windows PowerShell: out Get-SPEdition

The script reads the registry to retrieve the installed versions. This information is located in below the “HKLM:software\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS\InstalledProducts” path. Every GUID represents a SKU.

$products = @{ "BEED1F75-C398-4447-AEF1-E66E1F0DF91E" = "SharePoint Foundation 2010"; "1328E89E-7EC8-4F7E-809E-7E945796E511" = "Search Server Express 2010"; "B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0" = "SharePoint Server 2010 Standard Trial"; "3FDFBCC8-B3E4-4482-91FA-122C6432805C" = "SharePoint Server 2010 Standard"; "88BED06D-8C6B-4E62-AB01-546D6005FE97" = "SharePoint Server 2010 Enterprise Trial"; "D5595F62-449B-4061-B0B2-0CBAD410BB51" = "SharePoint Server 2010 Enterprise"; "BC4C1C97-9013-4033-A0DD-9DC9E6D6C887" = "Search Server 2010 Trial"; "08460AA2-A176-442C-BDCA-26928704D80B" = "Search Server 2010"; "84902853-59F6-4B20-BC7C-DE4F419FEFAD" = "Project Server 2010 Trial"; "ED21638F-97FF-4A65-AD9B-6889B93065E2" = "Project Server 2010"; "926E4E17-087B-47D1-8BD7-91A394BC6196" = "Office Web Apps 2010"; "35466B1A-B17B-4DFB-A703-F74E2A1F5F5E" = "Project Server 2013"; "BC7BAF08-4D97-462C-8411-341052402E71" = "Project Server 2013 Preview"; "C5D855EE-F32B-4A1C-97A8-F0A28CE02F9C" = "SharePoint Server 2013"; "CBF97833-C73A-4BAF-9ED3-D47B3CFF51BE" = "SharePoint Server 2013 Preview"; "B7D84C2B-0754-49E4-B7BE-7EE321DCE0A9" = "SharePoint Server 2013 Enterprise"; "298A586A-E3C1-42F0-AFE0-4BCFDC2E7CD0" = "SharePoint Server 2013 Enterprise Preview"; "D6B57A0D-AE69-4A3E-B031-1F993EE52EDC" = "Microsoft Office Online"; "9FF54EBC-8C12-47D7-854F-3865D4BE8118" = "SharePoint Foundation 2013" } $registryPath = "HKLM:software\Microsoft\Shared Tools\Web Server Extensions\$((Get-SPFarm).BuildVersion.Major).0\WSS\InstalledProducts" Get-RegistryKeyPropertiesAndValues -path $registryPath | ForEach-Object { Write-Host "Installed product: $($products.Get_Item($_.value)) (SKU ID: $($_.value))" } Write-Host "Installed version: $((Get-SPFarm).BuildVersion)"

With a little help from the Scripting Guy (Ed Wilson) and two MSDN articles I build the script. Enjoy!

Download: Get-SPEdition.ps1

Resources:

Merge log files when troubleshooting a multi server SharePoint farm

Even after working with SharePoint for a while you find new features. The Merge-SPLogFile cmdlet is one of them.

This cmdlet retrieves all ULS log entries from all servers in the farm and creates a one new log file. You can use the ULS viewer for further slicing and dicing the log file for more details.

Use the cmdlet with additional parameters, otherwise it could become a large operation resulting in a large file. Use like “Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite -StartTime "06/09/2008 16:00" – EndTime "06/09/2008 16:15"” is very useful.

Very use full for troubleshooting! Why I’ve missed this one, I don’t know…

Developing hybrid SharePoint apps that run on-premise and in the cloud – ESPC 2014

My session at the European SharePoint Conference (#ESPC14) was around developing hybrid apps with the SharePoint App Model. Below you can find the slide deck and PowerShell scripts I used during the demo.

Before you start building hybrid apps who are depending on the authentication done by Azure Control Services (ACS) you need to setup a trust between your on-premise farm and ACS.

  1. Replace the default STS certificate and reboot machine afterwards (Replace-STSCertificate.ps1)
  2. Install Microsoft Online Services Sign-In Assistant for IT Professionals RTW (64-bit), http://www.microsoft.com/en-us/download/details.aspx?id=41950
  3. Install Microsoft Online Services Module for Windows PowerShell (64-bit), http://go.microsoft.com/fwlink/p/?linkid=236297
  4. Run script to connect on-premise SharePoint farm to ACS (Connect-SPFarmToAAD.ps1)

Some important side notes:

  • When replacing the STS certificate, all current trusts who are depending on the STS become invalid. Meaning you have to recreate your existing Trusted Security Token Issuers (Install-TrustedSecurityTokenIssuer.ps1 & Remove-TrustedSecurityTokenIssuer.ps1)
  • Ensure you are using the RTW version of Microsoft Online Services Sign-In Assistant instead of the BETA (which is linked in the TechNet article)

Download PowerShell scripts.

Scripts originate from How to: Use an Office 365 SharePoint site to authorize provider-hosted apps on an on-premises SharePoint site (http://msdn.microsoft.com/en-us/library/office/dn155905(v=office.15).aspx), I don’t own the scripts but only provide them for easy of use.

Error installing SharePoint 2013 SP1 bits on Virtual Machine

As part of creating a developer virtual machine you need to install the SharePoint 2013 bits. Now with the release of Service Pack 1 you can install both SharePoint 2013 and Service Pack 1 in one run.

But when I installed the software bits an exception was raised.

Problem signature:
  Problem Event Name:    OfficeClassicSetup
  SETUP EXE VERSION:    15.0.4454.1000
  SETUP DLL NAME:    SVRSETUP.DLL
  SETUP DLL VERSION:    15.0.4569.1503
  ERROR CODE:    1603
  MSI HRESULT:    Unspecified
  ERROR DETAILS:    FC73469E
  FIRST ERROR CODE:    1603
  OS Version:    6.3.9600.2.0.0.272.7
  Locale ID:    1043

After digging around on the internet and trying different solutions the failing of the installation seems to be related to the CPU count. After increasing the number of virtual processors on the VM to 2 processors and re-running the prerequisites installer and SharePoint 2013 installer everything worked like a charm.

Solution steps:

  1. Increase virtual processor count to at least 2
  2. Re-run SharePoint 2013 prerequisites installer
  3. Re-run SharePoint 2013 installer

Develop, Build, Package and Deploy Apps for Office 2013 with Visual Studio 2013–European Office 365 Connect

On April 1st and 2nd in Haarlem (The Netherlands) the first European Office 365 Connect took place. Speakers from over the world (like Dan Holme, Seb Matthews, Marc Reguera and many more) visited Haarlem and did sessions related to Office 365.

I’ve done a session about Apps for Office together with Visual Studio 2013. This was a kind of follow-up session for “The New SharePoint Online Apps – Napa in Action” from Patrick Lamber. You can find my slide deck below.

The demo was around building a Wikipedia Task Pane app which leverages the Wikipedia API for searching Wikipedia. Below a screenshot of the Task Pane App for Office inside the Word 2013 (desktop) client.

Wikipedia Task Pane app inside Word 2013 client

Once the app was done it’s deployed to Windows Azure via a Web Deploy package and the XML manifest is made available to end-users to consume from the Corporate Catalog (hosted in SharePoint Online). After configuring the Office client the Corporate Catalog is available from within Word, Excel, PowerPoint.

Apps for Office catalog in Word (desktop) client

Download the demo sources here: http://1drv.ms/1pTuGx9

SharePoint Online Tenant URLs

Setting up your Office 365 environment and looking for the entry URLs? Below you can find the URLs related to your company SharePoint Online tenant.

Commonly used URLs for a SharePoint Online tenant:

Other URLs related to Office 365:

Service Pack 1 for SharePoint 2013 and more… [updated]

A bit more than a year ago Microsoft released SharePoint 2013 (RTM: 10/11/2012, GA: 2/28/2013). A couple of days ago Office 2013 Service Pack 1 (2/25/2014) is released, which include Office 2013, SharePoint 2013 and Exchange Server 2013.

With regards to SharePoint the following links are useful:

  • SharePoint Foundation 2013
  • SharePoint Server 2013
  • Project Server 2013
  • Office Web Apps 2013
  • Duet Enterprise
    • Duet Enterprise for Microsoft SharePoint and SAP Server 2.0 Service Pack 1 (SP1), KB 2817426

A more in-depth article on updates included in Service Pack 1 is found on the Microsoft Engineering Team blog, check out Announcing the release of Service Pack 1 for Office 2013 and SharePoint 2013.

Don’t forget to update your Workflow Manager 1.0 with Cumulative Update 1.0 for both Workflow Manager and Service Bus.

[23/04 update: SharePoint 2013 Service Pack 1 was pulled by Microsoft. Yesterday they re-released Service Pack 1, check this post for more information http://blogs.technet.com/b/stefan_gossner/archive/2014/04/22/sp1-for-sharepoint-2013-has-been-rereleased.aspx]

SharePoint Client Browser v1.2, get it while it’s hot!

The release is out since January 13th, but didn’t got the time to write about it. I have released a new version of the SharePoint Client Browser 2013 (#SPCB). It supports new nodes like associated Visitor, Member and Owner groups of a web object and showing the User Custom Actions for site, web and list object.

But the biggest investment is around User Profiles! Check out this post below.

Enjoy this new version of the SharePoint Client Browser and show your gratitude by adding a review on this page. Download can be found here.

SharePoint Client Browser - Main Screen - v1.2

User Profiles support improved!

The biggest update is within the User Profile area. Version 1.1 was limited to only showing the current user’s properties and peers.

SharePoint Client Browser v1.1 support for User Profiles

The new version shows not only the current user, but retrieves other users via the Search CSOM and retrieves their data as well.

SharePoint Client Browser v1.2 extended support for User Profiles

As shown above not only the User Profile properties and Peers are loaded, but lots of new properties is loaded as well allowing to create rich applications who use the User Profile data. Support is based on the Microsoft.SharePoint.Client.UserProfiles namespace and contains per user profile the following information:

  • User Profile properties
  • Peers
  • Direct Reports
  • Extended Managers
  • Extended Reports
  • Followed Tags (only current user)
  • Followers
  • Suggestions (only current user)
  • People Followed by User

Download SharePoint Client Browser

 Download the SharePoint 2013 Client Browser v1.2 here!

Enjoy this new version of the SharePoint Client Browser and show your gratitude by adding a review on this page.

Podcasts to keep track of

PODCASTS!To keep myself up-to-speed with the fast moving world of IT, I listen to different podcasts while driving.

The Podcasts collection of the Music hub in Windows Phone automatically downloads the latest audio/video files for offline access.

If your using a Dutch Microsoft Account, and many other localized accounts, the Podcasts collection is not available in the Music hub and you can use the PODCASTS! app for Windows Phone.

What podcasts do I keep track of? Since my focus is SharePoint, most of these are SharePoint focused.

Follow

Get every new post delivered to your Inbox.

Join 35 other followers