Thursday, 20 February 2014

Download .wsp file from SharePoint

$farm = Get-SPFarm
$file = $farm.Solutions.Item("newtwitterwebpart.wsp").SolutionFile
$file.SaveAs("c:\temp\newtwitterwebpart.wsp")

mstsc (Remote Desktop Connection)

Example:
  • mstsc /v: /admin /f /span
  • mstsc /v: /admin /w:800 /h:600 /public
 
Parameter
Description
<Connection File>
Specifies the name of an .rdp file for the connection.
/v:<Server[:<Port>]
Specifies the remote computer and, optionally, the port number to which you want to connect.
/admin
Connects you to a session for administering the server.
/f
Starts Remote Desktop Connection in full-screen mode.
/w:<Width>
Specifies the width of the Remote Desktop window.
/h:<Height>
Specifies the height of the Remote Desktop window.
/public
Runs Remote Desktop in public mode. In public mode, passwords and bitmaps are not cached.
/span
Matches the Remote Desktop width and height with the local virtual desktop, spanning across multiple monitors if necessary.
/edit <Connection File>
Opens the specified .rdp file for editing.
/migrate
Migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files.
/?
Displays help at the command prompt.
 

Register the twitter certificate with sharepoint 2010

$root = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\Maintenance_Sarah\VeriSignForTwitter.cer")
New-SPTrustedRootAuthority -Name "VeriSignForTwitter.cer" -Certificate $root

SharePoint 2010 and Cert Trust – Could not establish trust relationship for the SSL/TLS secure channel


Visual Studio 2010 usefull custom settings

Tools>Options>
Projects and Solutions>General-->check the "Show Output window when build starts".
Text Editor>All Languages-->Check the "Line Numbers" under "Display" section.

customerrors mode off

During the developing of a custom field, I faced some errors, but the didn't work. 
After some search, it seems that you have to do this trick on three locations. SharePoint 2010 has web.config files on the following locations:

  • C:\inetpub\wwwroot\wss\VirtualDirectories\80\
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
On all these locations you can find a web.config file.
Change customerrors to:

<customErrors mode="Off" />
and the SaveMode tag (if available) to:

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">
as well as the compilation tag to:


<compilation batch="false" debug="true" optimizeCompilations="true">



http://msdn.microsoft.com/en-us/library/ee231550.aspx

How to Turn Off SharePoint Custom Error Message and Display Stack and Page Output Trace


Renaming your SharePoint web part namespace

Deploy a WebPart in different custom group

Elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="WebPartPopulation" Url="_catalogs/wp" RootWebOnly="TRUE">
        <File Path="TheWebPart.dwp" Url="TheWebPart.dwp" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE">
            <Property Name="Group" Value="Custom" />
        </File>
    </Module>
</Elements>
 

Change the Value="Custom" to anything you want the group header to be.