Get SharePoint 2010 Edition with PowerShell

This is a script that identifies if SharePoint 2010 foundation, standard or enterprise is installed in your environment. This is part of an SharePoint 2010 summary script I created. I will post some bits of this script on my blog starting with the SharePoint 2010 edition.

<#
.SYNOPSIS
This function will show the SharePoint 2010 Edition.
.DESCRIPTION
Use this script to identify which version of SharePoint 2010 has been installed (foundation, standard or enterprise)
.LINK
http://www.maartenpeeters.nl
#>
Function GetEdition
{
#SharePoint 2010 Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
try{
#check for enterprise feature
if([bool](get-spfeature |?{$_.ID -eq "e4e6a041-bc5b-45cb-beab-885a27079f74"}) -eq $true )
{
write-host "SharePoint edition: Enterprise" -foregroundcolor green
}
#check for standard feature
elseif([bool](get-spfeature |?{$_.ID -ne "e4e6a041-bc5b-45cb-beab-885a27079f74" -and $_.ID -eq "69cc9662-d373-47fc-9449-f18d11ff732c"}) -eq $true)
{
write-host "SharePoint edition: Standard" -foregroundcolor green
}
else
{
write-host "SharePoint edition: Foundation" -foregroundcolor green
}
}
catch
{
Write-Host "Get SharePoint edition unsuccesfull" -foregroundcolor red
}
}
GetEdition

When you run this script you get the following message:

clip_image001[1]

clip_image002[1]

clip_image003[1]

Getting SQL Instance Edition or service pack for Microsoft SQL Server

I was working on a manual for implementing SCOM 2012 and I needed to document the SQL edition. I founded an select query a couple years ago what I’m using ever since. This query shows the edtion, productversion, productlvl and some more data.

I thought why not make a blog about it for people who are starting to use SQL.

Script

SELECT
SERVERPROPERTY(‘Edition’) AS ‘Edition’,
SERVERPROPERTY(‘ProductVersion’) AS ‘ProductVersion’,
SERVERPROPERTY(‘ProductLevel’) AS ‘ProductLevel’,
SERVERPROPERTY(‘ResourceLastUpdateDateTime’) AS ‘ResourceLastUpdateDateTime’,
SERVERPROPERTY(‘ResourceVersion’) AS ‘ResourceVersion’
GO

Below are 2 screenshots. 1 is from SQL 2005 and the other is SQL 2008 R2.

SQL 2005

image

SQL2008 R2

image