2010 Pre-Upgrade Check

#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

5 thoughts on “2010 Pre-Upgrade Check

Add yours

  1. Pingback: SharePoint Bit Me
  2. I had a bit of trouble copying the above code. I finally just copied everything on the page and deleted all the non-powershell.
    When I ran this the first time, it ran a while then prompted me to continue and when I said y , the script began to give me access errors.
    I was logged on with an account in the farm admins group. However, when I ran the powershell console as sa_farm itself, then the script ran without errors.
    Thank you for the script.

    Like

  3. Are there suggestions for what to look at in the generated output as potential problems when planning to move to SP 2013? I am not certain what some of the solutions which only have a guid are, nor am I certain what features or templates are potential problems.

    Like

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 )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: