SharePoint 2010 – 2013 PreUpgradeCheck


Hello

For those of you who migrated projects from 2007 to 2010, you must admit that “stsadm.exe -o preupgradecheck” is awesome !!!

For those who don’t know what i am talking about, “stsadm.exe -o preupgradecheck” gives you information about possible issues upgrading your 2007 farm to 2010.

And now that i am starting to upgrade to SharePoint 2013, I have noticed ( to my horor) that the pre-upgrade feature is missing from SharePoint 2010 😦 .

Surfing the net i found a fairly basic PowerShell script that can give you some of the same information the old “preupgradecheck” option gave you. Information like what your farm’s build number is, what templates you have and what web uses which template, database sizes, solutions installed in the farm, etc.

If you felt like it you would be able to get most of this information by digging around in Central Administration, SQL Management studio,  the SharePoint settings pages, or SharePoint designer, but this script may save you a little time. The script won’t tell you anything specific about the problems you may have upgrading to 2013, it just gives you all the information in one place to use as a reference. I hope you find it to useful.

No Warranty Expressed or Implied. Use with caution (that applies to all PowerShell written by some random person on the internet).

 

#Copy this text into a text document and save it as InfoScript.ps1
#Please login to your SharePoint server using an account that has permissions to run PowerShell Commands.
 # Place the file InfoScript.ps1 into a directory on the server that hosts SharePoint Central Administration.
 # Open the SharePoint 2010 Management Shell and type:
 # c:\[directory where you placed the script]\InfoScript2010.ps1 | Out-File -width 200 c:\InfoOutput.txt
 # The "Out-File -width 200" part of the command is to make the output wider to fit more information on each line
 # Once the script has completed, please forward the InfoOutput.txt file to your Rackspace contact via email.
 #|
 #
add-pssnapin microsoft.sharepoint.powershell -ea 0
$scriptuser = whoami
 write-output "InfoScript was run under account name","------------------------------------", $scriptuser
write-output "Servers in farm, their upgrade status and version number (version is just for comparison)"
 # Added bit to weed out SQL and email servers
 Get-SPServer | Where-Object { $_.role -ne "invalid" } | Select Name, Role, NeedsUpgrade, Version | out-string -width 200
 write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "Web Apps in Farm and if they are using claims auth or not"
Get-SPWebApplication |select DisplayName, URL, @{Label = "Claims Enabled?"; Expression = {$_.UseClaimsAuthentication}} |out-string -width 200
write-output "SharePoint Farm Build number"
 Get-SPFarm | Select BuildVersion | out-string -width 200
write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "Solutions in Farm"
 Get-SPSolution | select Displayname, deployed, DeployedWebApplications | out-string -width 200
write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "Site Collections by DB"
 Get-SPContentDatabase | %{Write-Output "`nDatabase: $($_.Name)"; ForEach($site in $_.sites){write-Output ("`t " + $site.url)}}| out-string -width 200
write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "Database sizes"
 Get-SPDatabase |Sort Name| select Name, @{Label = "DB Size in MB"; Expression = {"{0:N2} MB" -f ($_.DiskSizeRequired/1048576)}}, Type, Id | out-string -width 200
write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "SiteCollection size estimates (very rough)"
 Get-SPSite | Select URL, @{Label="Storage"; Expression={"{0:N2} MB" -f ($_.Usage.Storage/1048576)}} | out-string -width 200
write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "AAM Info"
 Get-SPAlternateURL
 write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "Features in Farm"
 Get-SPFeature -Limit all | out-string -width 200
write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "Templates in Farm"
Get-SPWebTemplate | out-string -width 200
 write-output ""
 write-output "--------------------------------------------------------------------------------------------------------"
 write-output "Template USED in farm by web" " "
Write-Host -foregroundcolor yellow "The final step in this script will list every web (site or subsite)
 in your farm along with the template used by that web.
If you have a large number of sites it might take some time to complete and use a lot of resources.
All the other information collected by this script has already been placed in a file,

 so if you answer no, only this step will be skipped."
$continue = Read-Host "Would you like to continue? (Y/N)"
 if($continue -eq "Y")
 {
 get-spsite -limit all | get-spweb -limit all |select URL, @{Label = "Template"; Expression = { $_.WebTemplate}}, @{Label = "TemplateID"; Expression = { $_.WebTemplateID}} | out-string -width 200
 }
 

 

 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s