Skip to main content

Posts

Showing posts from October, 2014

Install CU's Process in SharePoint 2010/2013

First view Health Analyzer and repair the MissingFeatures, MissingAssemblys and MissingWebParts with the previos posts of this blog. Install SP1 or SP2 SharePoint service pack Install SP1 or SP2 SharePoint Language Pack Install SP2 Office Web Apps 2010 (Optional) 1. Open an Administrative command prompt.  2. Change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN 3. Run  PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures Instal the CU's SharePoint 1. Open an Administrative command prompt.  2. Change directory to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN 3. Run  PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures Enjoy.

[MissingAssembly] Delete MissingAssembly issues from the SharePoint Health Analyzer using PowerShell

This script is prepared for drop the error. 3.- Run in PoweShell this command: .\MissingAssemblyDetail.ps1 -DBserver "INSTANCESQLNAME" -path "C:\Missing\inputassembly.txt" 2.- Create a txt file with this structure: COMPANY.GD.ERDocument, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e982416fbaf3e1a6;WSS_Content_tex.bannn.des 1.- Copy this script in MissingAssemblyDetail.ps1. param (     [string]$DBserver = $(throw "Missing server name (please use -dbserver [dbserver])"),     [string]$path = $(throw "Missing input file (please use -path [path\file.txt])") ) #Set Variables $input = @(Get-Content $path) #Addin SharePoint2010 PowerShell Snapin Add-PSSnapin -Name Microsoft.SharePoint.PowerShell #Declare Log File Function StartTracing {     $LogTime = Get-Date -Format yyyy-MM-dd_h-mm     $script:LogFile = "MissingAssemblyOutput-$LogTime.csv"     Start-Transcript -Path $LogFile -Force } #Declare SQL Query fun

[MissingSetupFile] - Delete MissingSetupFile issues from the SharePoint Health Analyzer using PowerShell

Paste this code in PowerShell: function Run-SQLQuery ($SqlServer, $SqlDatabase, $SqlQuery) {     $SqlConnection = New-Object System.Data.SqlClient.SqlConnection     $SqlConnection.ConnectionString = "Server =" + $SqlServer + "; Database =" + $SqlDatabase + "; Integrated Security = True"     $SqlCmd = New-Object System.Data.SqlClient.SqlCommand     $SqlCmd.CommandText = $SqlQuery     $SqlCmd.Connection = $SqlConnection     $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter     $SqlAdapter.SelectCommand = $SqlCmd     $DataSet = New-Object System.Data.DataSet     $SqlAdapter.Fill($DataSet)     $SqlConnection.Close()     $DataSet.Tables[0] } Set the parameters, sql instance name,  the sql contentdatabase  and the file path from the log of health analyzer: Run-SQLQuery -SqlServer "SQLSERVERINSTANCE" -SqlDatabase "WSS_Intranet01" -SqlQuery "SELECT * from AllDocs where SetupPath = 'Features\WebParts_WebPa

[MissingFeature] Database [*********] has reference(s) to a missing feature - Removing features from a content database in SharePoint 2010 using PowerShell

Open SharePoint PoweShell and paste this scripts: function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly) {     $db = Get-SPDatabase | where { $_.Name -eq $ContentDb }     [bool]$report = $false     if ($ReportOnly) { $report = $true }         $db.Sites | ForEach-Object {                 Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report                         $_ | Get-SPWeb -Limit all | ForEach-Object {                         Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report         }     } } function Remove-SPFeature($obj, $objName, $featId, [bool]$report) {     $feature = $obj.Features[$featId]         if ($feature -ne $null) {         if ($report) {             write-host "Feature found in" $objName ":" $obj.Url -foregroundcolor Red         }         else         {             try {                 $obj.Features.Remove($feature.DefinitionId, $tr

STSADM Equivalent Commands in Powershell

This article lists Stsadm operations and their equivalent Windows PowerShell cmdlets. Where there is no one-to-one mapping between the operations and cmdlets, the table lists the specific Windows PowerShell parameters you must use to get the same functionality.   Stsadm operation Windows PowerShell cmdlet Activatefeature Enable-SPFeature Activateformtemplate Enable-SPInfoPathFormTemplate Addalternatedomain New-SPAlternateUrl Addcontentdb Mount-SPContentDatabase New-SPContentDatabase Adddataconnectionfile Install-SPDataConnectionFile Add-ecsfiletrustedlocation New-SPExcelFileLocation Add-ecssafedataprovider New-SPExcelDataProvider Add-ecstrusteddataconnectionlibrary New-SPExcelDataConnectionLibrary Add-ecsuserdefinedfunction New-SPExcelUserDefinedFunction Addexemptuseragent Add-SPInfoPathUserAgent Addpath New-SPManagedPath Addpermissionpolicy None Addsolution Add-SPSolution Addtemplate Install-SPWebTemplate Adduser New-SPUser