czwartek, 21 listopada 2013

Change server name on which SharePoint is installed

It may be necessary e.g. when you create new VM with SharePoint as a copy of the existing one.
Use old stsadm tool to achieve the goal:

stsadm -o renameserver -oldservername <current name of the server> -newservername <new name for the server

poniedziałek, 18 listopada 2013

IIS configuration for debugging

ASP.NET  > .NET Compilation

Debug: TRUE
Default Language: C#

IIS > ASP

Enable Server-side Debugging: TRUE

Directly in web.config file

CallStack="true"
CustomErrors mode="Off"

Polskie znaki Ł i Ś

W pliku
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1045\FORM.js
zamienić
L_InsertCellLeftKey_TEXT=”L”   na   L_InsertCellLeftKey_TEXT=”false”
oraz
L_SplitCellKey_TEXT=”S”   na   L_SplitCellKey_TEXT=”false”

wtorek, 12 listopada 2013

Add and deploy solution with PowerShell

Add-SPSolution -LiteralPath "<path>\MySolution.wsp" | Out-Null
echo " > Adding MySolution..."
start-sleep -s 10
$sln = get-spsolution -identity MySolution.wsp
Install-SPSolution -Identity $sln -GACDeployment
while($sln.Deployed -eq $false) {
echo " > Deploying in progress..."
start-sleep -s 10
}
echo "MySolution is deployed."
Enable-SPFeature -Identity "MyFeatureName" -Url "<my site url>"

Need to know what exactly is your feature name? This command will display all web-scoped features:

Get-SPFeature | Where-Object { $_.Scope -eq "Web" } | Format-Table -Property DisplayName -AutoSize

Retrack solution with PowerShell

Set-ExecutionPolicy unrestricted
echo " "
echo "MySharepointSolution"
$sln = get-spsolution -identity MySharepointSolution.wsp
uninstall-spsolution -identity MySharepointSolution.wsp -confirm:$false
echo "Started solution retraction..." 
while($sln.JobExists) {
echo " > Working..."
start-sleep -s 10 
}
remove-spsolution -identity MySharepointSolution.wsp -confirm:$false
echo "Removed MySharepointSolution"
echo " "