Friday, December 23, 2011

SP2010 - Cannot create new site collections

Scenario: I was not able to provision a new project web access instance on a Project Server 2010 / SharePoint 2010 environment. Further troubleshooting this problem I realized that no new site collections could be created on the environment under the specific problematic web application only. Below is the error from ULS:

Failed to provision site [project web access instance name] with error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.SharePoint.Administration.SPContentDatabaseCollection.FindBestContentDatabaseForSiteCreation(IEnumerable`1 contentDatabases, Guid siteIdToAvoid, Guid webIdToAvoid, SPContentDatabase database, SPContentDatabase databaseTheSiteWillBeDeletedFrom)


This is a case of at least 1 orphaned database associated to the problematic web application. 

1. Run below powershell command to get GUID of web application.
get-spwebapplication | ? {$_.displayname -eq "Problematic Web Application Name"} | fl

2. Run this SQL query against configuration database.
select ID, Name, CAST (properties as xml) from Objects where ID = 'GUID of webapp from Step 1'

3. The results returned from step 2 will have 1 column with the properties as xml. Click on the results and it should open a new window in SQL Mgmt studio with xml output.

4. Search for the word "m_Databases" in the xml output.

5. Carefully read through the tag that stores the above searched word. You should be able to see fld tags. Find out a tag which has fld tag with value null. This is the orphan database. Its GUID is the xml line above where you found null.

6. Cross verify all databases currently associated with the web application and make sure this database is not getting used.

7. Run below powershell script,
This script will throw an object reference error. Do not worry, it works its magic under the hood.

Try to create a new site collection now and it should work. 

Summary: The above problem occurs because if there one entry which has fld value set to null SharePoint thinks that that database is the most suitable one to create new site collections in. But since it is an orphaned database, it is unable to do so and reports the above error in ULS which is repeated every time a new site collection creation request is initiated with through SP user interface or Project Server interface.

Windows RDP ALT problem

When you open a new RDP session from a Windows machine sometimes the keyboard does not work correctly. 
For e.g.
Once the RDP session has started and you have logged in successfully, when you press the T button it switches between taskbar windows rather than simply typing the letter T. It looks like it performs the same function as ALT + T although ALT is not pressed.

Within the RDP session presss the ALT button several times.

Monday, December 19, 2011

SP2010 Doc icon does not link to document

Site which are migrated from SP2007 to SP2010 have lost the automatic link of doc icon, i.e. pdf, word, excel etc to the document. Users have implemented list view webpart where they used this functionality for one click opening of documents from any page.

Microsoft has recognized this as a bug and provided a fix.;en-US;2457975

SP2010 list view toolbar

If you want the SP2007 toolbar, with New, Upload, Actions and Setting buttons, edit the list view page and edit the list view webpart. Set the toolbar type dropdown to "Show Toolbar" option.


SP2010 document check out issue

Users are not able to check out documents from document libraries. The error is returned is the message,
"The document cannot be checked out as it is already checked out to another user."

Make sure the web application where the document library is hosted has a root site collection created.

Monday, December 12, 2011

Upload SP2007 list templates to SP2010

  1. Rename the original .STP to .CAB
  2. Extract its manifest.xml and other contents (if any) to a local folder (lets call it [folder])
  3. Search for the ProductVersion element. This should have a value of 3
  4. Change its value to 4
  5. Repackage the manifest.xml into a .CAB. I've done this by using makecab.exe in the C:\Windows\System32 folder
    : makecab.exe [folder]\manifest.xml [folder]\{template-name}.cab
  6. Change the generated cabinet's extension from .CAB back to .STP and upload it into the _catalogs/lt

Sunday, December 11, 2011

Mount-SPContentDatabase Powershell bug

Mount-SPContentdatabase command fails with "object reference not set to an instance of an object" error.
At first these errors are only shown for Basic Meeting Workspace.

Make sure you are not running "Mount-SPContentdatabase" command for the same database using the same powershell window. If yes, close the window and open a new SharePoint 2010 powershell window and continue the operation.


Thursday, December 8, 2011

SP2010 Missing - "Alert Me"

If outgoing email is not configured for a SP 2010 environment then the "Alert Me" button will not be displayed on the ribbon.

SP2010 Table of Contents Webpart Limit 20

1. Navigate to subsite where the issue exists. 
2. Click Site Actions -> Site Settings
3. Click Navigation
4. Set a higher value greater than 20 for Current Navigation.
5. Save and close.

SP2010 ListView Ribbon missing

Post upgrade to SP2010 from SP2007 the ribbon is missing on some list view pages (allitems.aspx).

This happens if there is a CEWP or any other webpart or any modifications done to the default list pages like allitems.aspx. Once the pages are modified SP treats them as application pages and hence the ribbon is modified.

You will notice that clicking on the list view webpart on the page will bring the ribbon back or clicking on one the item checkboxes.

You can add some JS to a CEWP to fix this problem as mentioned in the reference below. The JS simply sets focus to the list view webpart once the page has loaded.


Wednesday, December 7, 2011

SPDeletedSite Cmdlets

SPDeletedSite commandlets only work if you have deleted the site collection via the browser ui or the object model.  If you are an admin and you have explicitly called Remove-SPSite, then your site collection is not available to the SPDeleteSite commandlets. 


Tuesday, December 6, 2011

SP2010 - Send link in email

Send link in email option is missing in SP2010 which was available in SP2007.

With IE (Not Chrome, not sure about firefox) you can hold down CTRL and click the title - this then opens up the edit form with ID?=XXX (i.e. no dialog) in a new window - then easy to copy and paste into email.


Monday, December 5, 2011

SP2010 - CallStack CustomError

Although you have set callstack=true, customerrors=Off and compilation=debug in web.config of your web application, you still do not get the stack trace. 

Set customerrors=Off here,
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config 


Friday, December 2, 2011

STSADM ' - ' Command line error

All parameters passed to stsadm command are correct but it still complains about "Command line error". This is an encoding issue.

e.g. If this command does not work on cmd prompt,
       stsadm -o enumsites -url http://myurl -databasename dbname
      - Paste this command in a notepad and try to search for -databasename 
      - Notepad will return "cannot find -databasename " although you can see it there.
The '-' is not getting encoded correctly. Simply delete the - and retype it in notepad. Copy and paste it in cmd prompt and execute. It will work. This problem may occur with any '-' parameter.


Powershell - Non CLS compliant type

The field/property: "Id" for type: "Microsoft.SharePoint.Administration.SPContentDatabase" differs only in case from the field/property: "ID". Failed to use non CLS compliant type.
The way that you have to work around this issue is to get a handle to the type’s property using reflection and then invoke the SetValue() method.
$maxProp = [Microsoft.SharePoint.Administration.SPContentDatabase].GetProperty("MaximumSiteCount")
$maxProp.SetValue($siteCol.ContentDatabase, 1, $null)
If you want to get the property value:
$returnVal = $maxProp.GetValue($siteCol.ContentDatabase, $null)

Reference : 

Wednesday, November 30, 2011

SP2010 Alert Nightmares

Scenario: Existing alerts on SP2007 sites upgraded to SP2010 after changing web application host name stop working.

Solution: This post from Shane is the solution,

Remeber to first run the powershell script from technet, 
and then use the script provided above by Shane to fix the issues from MS script.

After running the script from technet check the [SiteUrl] column in the [ImmedSubscriptions] table in the content database where your site collection resides to make sure it points to the right host web application host name. If it does not then the alerts are simply not triggered. Also make sure the Outgoing email settings are enabled.

Even after configuring all the above sometimes alert emails are not sent for new and SP2007 migrated alerts. Here are some more steps to troubleshoot.
1. Find the database which stores the site collection data.
2. Run "select * from timerlock" against that database
3. Get the GUID of the Server (LockedBy column) who is supposed to execute all timer job activities for this site collection.
4. To map the GUID to user friendly server name run the following powershell,
Get-SPServer | Foreach-Object { Write-Host $ $_.Name}
5. Make sure this server is allowed to relay emails in your network.

Some of the points to check if alerts are working on some site collections but not on others,
 - Outgoing email settings on web application
 - Allow smtp relay from all servers(where SPTimerv4 is Started) in your farm.

Other references:

Friday, November 25, 2011

Business Connectivity Services

An external content type is really a reusable description of external data to allow it to participate as a native Office entity across multiple applications such as:
  • SharePoint as external list
  • Outlook
  • SharePoint workspace
  • Word
  • InfoPath
  • Access
  • Other Office applications via code

Wednesday, November 23, 2011

People Picker: "There was an error in the callback"

This was my issue although I had stsadm setapppassword and peoplepicker-searchadforests setup correctly.

On the “HKLM\Software\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure” registry key ensure the following permissions are in place and are being inherited in the sub-keys

* WSS_WPG Read permission

* WSS_Admin_WPG Full Control



Tuesday, November 22, 2011

Override Redirect Help link SharePoint 2010

Override help link on SharePoint 2010.

Excellent article. 

JS snippet:

var intervalId = setInterval('OverrideHelpButton()', 250);
function OverrideHelpButton()
TopHelpButtonClick = function (strParam)
var'/HelpFiles/index.html', 'STSHELP',
setTimeout('window.clearInterval(intervalId);', 10000);

Monday, November 14, 2011

Exception from HRESULT: 0x80040E14


Users get this exeception when they try to add new content to SharePoint 2007 sites.


If the transaction log for the configuration database is full this error can occur for random number of sites in the farm.

Tuesday, November 1, 2011

Project Server 2010 - Waiting for resources

Scenario: Trying to provision new project server 2010 pwa instance. The status is stuck at "Waiting for resources" After some time checking the ULS logs and the content database statistics we releaize that a new site collection did get created.

Solution: Make sure that the SharePoint 2010 Timer service is "Started" on all servers where it is supposed to run.

Monday, October 24, 2011

SharePoint Server - Antivirus

If antivirus software is installed on SharePoint servers use below link to exclude certain folders so that search results are not quarantied.

Thursday, October 20, 2011

Test-SPContentDatabase : The content database could not be found

Error "Test-SPContentDatabase : The content database could not be found." occurs when you try to execute Test-SPContentDatabase DbName command

Solution: This happened to me when I ran this command on a SP2007 database which was not yet attached to any web application in SP2010. Use the following syntax,
Test-SPContentDatabase -Name DbName -WebApplication "Url of a SP2010 web application"

Tuesday, October 4, 2011

ADFS 2.0 / PingFederate Encryption

AD FS 2.0 Encryption Strength

In AD FS 2.0, encryption of outbound assertions is turned on by default. Assertion encryption occurs for any relying party/service provider for which AS FS 2.0 possesses an encryption certificate.

When it performs encryption, AD FS 2.0 uses 256-bit Advanced Encryption Standard (AES) keys, or AES-256. In contrast, by default PingFederate supports a weaker algorithm (AES-128). Failing to reconcile these conflicting defaults can result in failed SSO attempts.Alternatives for addressing this issue include the following:

• Disabling encryption in AD FS 2.0. To disable encryption, on the AD FS 2.0 computer, click Start, click Administrative Tools, and then click Windows PowerShell Modules. Then, at the Windows PowerShell command prompt, type the following:



set-ADFSRelyingPartyTrust –TargetName “Ping Example” –EncryptClaims $False

• Upgrade PingFederate’s encryption capability. Because of import control restrictions, the standard Java Runtime Environment (JRE) distribution supports strong but not unlimited encryption. For this reason, the strongest cipher suites are commented out of the two configuration files com.pingidentity.crypto.SunJCEManager.xml and com.pingidentity.crypto.LunaJCEManager.xml, which are located in the folder /server/default/data/config-store. To use the strongest encryption, remove the comments from the AES 256 cipher suites, and then download and install the appropriate version of Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files from the Java SE Downloads (

Friday, September 30, 2011

ADFS 2.0 WS-Federation

Just heard from a MS support engineer yesterday,
ADFS 2.0 does not support WS-federation as Idp-Initiated SSO. It has to be SP-Initiated SSO. However it supports SAML 2.0 in both modes.

Tuesday, September 27, 2011

SharePoint 2010 - Upgrade required


Installed SharePoint binaries on a new server . Ran Sharepoint configuration wizard to join server to existing farm. All goes well and no errors are reported. Admin navigates to central admin -> System settings -> Manage servers in farm. Red message that says "Upgrade required" on the recently added server.

Execute this command on the server,

PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures


Monday, September 26, 2011

Could not find Feature DataConnectionLibrary

Scenario: Trying to export/import a subsite from a SharePoint 2007 environment with enterprise features, (e.g. Data connection library) to a farm with standard license.


I have added my comments here,

Saturday, September 24, 2011

MediaTomb PS3

PS3 does not detect mediatomb hosted on ubuntu desktop even though we followed the manual here,

1. Make sure mediatomb is started correctly on ubuntu. For e.g. a sample command is "mediatomb -e wlan0" to start media tomb using wireless lan network interface.

2. Browse to the url provided in terminal and share content.

3. Make sure firestarter ( is installed and policy is added to allow inbound traffic from PS3 IP address.

4. Open PS3, under Video -> Search for media servers.

Friday, September 23, 2011

ADFS 2.0 Debugging / Tracing

Environment with customized idp login pages. ADFS redirects to Error page with a reference number. The reference number is not the be see in event viewer.


1. Which log to check ? Cannot find messages in EventViewer - Application.
Refer this link for solution:

"Open the Event Viewer. Navigate to 'Applications and Services Logs' -> 'AD FS 2.0' -> Admin. In the 'View' menu, using 'Add/Remove Columns...', add the 'Correlation Id' column. Look up the reference number 'c14bcf7c-268d-46be-82c3-7c1d873c3df2' in the 'Correlation Id' column.

(In some specific cases you get a 'Reference number' but no event in the AD FS 2.0 event log. In my experience that is mostly when customizing the sign-in pages.)"

2. Enable tracing

Excellent article to enable tracing for ADFS 2.0

Much more detailed:

The steps in the above article should help configure tracing of ADFS and enable logging to event viewer. It still does not show up anything because of customized login pages.

3. Right click on Error page and check source. Nothing. Sometimes MS loves putting the stack trace in there.

4. Fiddler to the rescue:

    a. Navigate to the inetpub (inetpub\..\ad\ls\) folder where the Error.aspx page can be found.
    b. There is just one method in there, Add   "HttpContext.Current.Response.Write(Exception.ToString())"
    c. This should present the exact stack trace.
    d. Use the same idea for the pages that were edited, e.g. idp login page and trace it using Respose.Write.
    e. If it still does not work, and it still redirects to Error page and the response.write on Error page provide a very generic message, then use fiddler and read the response of each page during the transaction and you will see the error on the pages.
(Make sure to decrypt https requests using fiddler cert.)

Thursday, September 22, 2011

ADFS Idp Initiated SSO - RelayState

AD FS 2.0 does not support specifying the RelayState in the case of IdP-initiated request. (The support for RelayState is limited to echoing back in SP-initiated requests.) The relying party must identify the target resource in its configuration.

To pass RelayState in ADFS 2.0, there is a non-supported workaround which requires some custom code (for additional information, please refer to the discussions HOW CAN I SPECIFY THE TARGET URL DIRECTLY IN THE SAML REQUEST AND HAVE AD FS 2.0 AUTOMATICALLY REDIRECT?[1] and SPECIFY RELAYSTATE URL[2].

The workaround requires two critical tweaks in the Sign-In Pages:

1. Edit the Global.asx.cs file, and add, after line 22 (HttpResponse response = HttpContext.Current.Response;) the following code:
if ( !String.IsNullOrEmpty( request.Params["SAMLResponse"] )
!String.IsNullOrEmpty( request.Params["SAMLart"] ) )
if ( !String.IsNullOrEmpty( request.Params["RelayState"] ) )
HttpCookie cookie = new HttpCookie( "rs", request.Params["RelayState"] );
cookie.Expires = DateTime.UtcNow.AddMinutes( 10 );
Response.Cookies.Add( cookie );
It basically looks for SAMLResponse/SAMLart with a RelayState, and then “stuff” the RelayState in a cookie.

1. Edit the page IdpInitiatedSignOn.aspx.cs by adding after line 56 (string rpIdentity = Context.Request.QueryString [RpIdentityQueryParameter]) the following code:

HttpCookie cookie = Context.Request.Cookies.Get( "rs" );
if ( null != cookie && !String.IsNullOrEmpty( cookie.Value ) )
rpIdentity = cookie.Value;
cookie.Expires = DateTime.UtcNow.AddDays( -1 );
cookie.Value = "";
Context.Response.Cookies.Add( cookie );

// If the query string specified a certain relying party, sign in to that relying party.
if ( !String.IsNullOrEmpty( rpIdentity ) )
string decodedIdentity = Server.UrlDecode( rpIdentity );
if ( decodedIdentity == IdpAsRpIdentifier )
decodedIdentity = String.Empty;

// If app is not in list of known RPs, assume it is a WS-Federation app and redirect to it.

bool found = false;
foreach( DataRow row in RelyingParties.Rows )
if ( row[0] == rpIdentity )
found = true;

if ( found )
SignIn( rpIdentity, new SignOnRequestParameters() );
// TODO: Fill in your own trusted WS-Federation app URLs below.
if ( rpIdentity == ""
rpIdentity == "" )
Response.Redirect( rpIdentity );
It basically extracts that cookie and uses it to start an IdP initiated sign on.

Moreover, if the RelayState doesn’t map on to a known SAML 2.0-based relying party, there is a place in the code to enter a list of known WS-Federation URIs to have AD FS 2.0 redirect to.

For 90% of cases (including SharePoint 2007/2010 and, more generally, WIF 1.0-based applications), this will kick off an SP-initiated sign in and “it just works”.

Tuesday, September 20, 2011

ADFS - SAML 2.0 for Idp Initiated SSO

Scenario: My first experience setting up an ADFS environment to enable federation between ADFS and PingFederate. This is strictly Idp Initiated SSO scenario, where ADFS is the Idp.

1. Send federation xml to relying party / SP (PingFederate user). This should include SSL certificate information and chain certificate information.
2. Receive xml from relying party
3. Extract certificate information from xml and save as .cert file. (This is done by extracting text content from relying party xml between the tags,
4. Store .cert file in AD or local server Trusted Root certificate store
5. Create a relying party connection in ADFS by uploading relying party xml from step 2.
6. Edit and setup claim rules, for e.g. map employee ID from AD (i.e. LDAP) to Name ID claim type.
7. Load certificate from relying party into relying party encryption configuration in ADFS.

*These steps should ideally be enough to setup the federation. The client needs to have his application point to Idp ADFS. The Url would look something like this,

where RPIdentityName is the name of the Relying Party Identifier name.

Troubleshooting tips:
1. Many a time security is an issue. Hence we need to run some powershell scripts to disable encryption.
e.g. Set-ADFSRelyingPartyTrust

2. Use Fiddler to track SAML traffic,

Critical Issue:


"AD FS 2.0 does not support the declaration of a Target or RelayState parameter when it acts as the IdP during IdP-initiated SSO. Therefore, successful use of the third link (IdP-initiated SSO)—which does not state the target application explicitly—requires the SP to use the Default URL feature in PingFederate (which is already configured in this lab). The setting is available on the Main Menu under My SP Configuration\Application Integration Settings\Default URLs."

In our situation, the relying party had PingFederate and had a dummy url as its default url which was causing issues during federation.

Solution: (Read right to the end) ADFS and RelayState issues

Update (9/23/2011):

None of the above code options worked for us since our RelyingParty is PingFederate.

This final solution which should work in this scenario is to a SP-Initiated SSO as mentioned in this link, 
and confimed by MSFT here,

Visual Studio 2010 Ultimate - Performance Testing

Scenario: Installed Visual Studio 2010 Ultimate and Visual Studio Agents 2010 to prepare a Load test environment for web performance testing. Installed controller and agent and configured them. Open Visual Studio 2010 Ultimate and navigated to Test -> Manage Controllers. Next to Controller you get the message "Local No Controller".

Type the FQDN of the current machine and hit enter.

Monday, September 19, 2011

Site Collection Deleted - Get Database Name

Scenario: Site collection admin deletes root web from a site collection, thereby deleting the entire site collection. Now they want it restored. If you have clearly documented mapping between site collection and content db (assuming you have large number of content db's) you can easily restore the content db and get the site collection restored.

Solution: For all those who do not have it documented. SharePoint config db has a table called "SiteMap" which store site collection to database mapping.

1. Do a SQL backup/restore of SharePoint config database from a time before the deletion occurred. (Remember this is just a SQL restore not SharePoint)

2. Check the dbo.SiteMap table for database information.

Friday, September 16, 2011

IIS Blank - Cannot find sites

When you open IIS Server Manager to browse SharePoint web sites you get a blank screen. When you try to connect to local host, you get the message, "Path specified cannot be used at this time"

Stop SharePoint Timer service
Stop WWW Publishing service
Stop SMTP service
Stop HTTP SSL service
Stop IIS Admin service

Start all of the above in the same order.

Permanent fix: 

Tuesday, September 13, 2011

Request for security token failed

Request for security token failed with exception: System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.

Microsoft Project Server 2010
Microsoft SharePoint Server 2010

1. Start "Claims to Windows Token Service " on all servers in the farm.
2. IISRESET on all servers.

Prevent person.aspx redirect from userdisp.aspx

A SharePoint environment is newly built with its dedicated domain controller (DC) and has migrated content from another SP environment with a seperate DC. The migrated content has existing users which needs to be migrated to the new domain. Used stsadm -o migrateuser command to achieve the same. When user clicks on the new converted user name in the site collection user groups page, the user is now redirected to person.aspx rather than userdisp.aspx

This behaviour is expected because,
a. MySite feature is enabled on the farm which embedds a redirectcontrol in the userdispform.aspx page which causes the redirect.
b. The user has a profile in SSP.

We uninstalled the Mysite feature from farm features using stsadm. Remember it is a hidden feature.

Friday, September 9, 2011

Windows Server RDP cannot see local drives

After RDP to a Windows Server, you cannot find your local drives mapped on the remote server. This is annoying especially if you want to copy files over to the server.


Wednesday, September 7, 2011

Find Windows Server last reboot

Scenario: I need to find out when was the last time one of our Windows server rebooted.

1. Open command prompt
2. type "net statistics server"
3. It will display statistics from the last reboot time.

Tuesday, August 30, 2011

Project Server 2010 - PWA Creation Failed

When trying to provision a new PWA. It fails on Provisioning Databases stage. Event
viewer records the below errors,

Microsoft.Office.Project.Server.Administration.ProvisionException: Failed to provision databases. ---> Microsoft.Office.Project.Server.Administration.ProvisionException: IF NOT EXISTS (SELECT name FROM sysusers WHERE name = N'ProjectServerRole' and issqlrole = 1)
EXEC sp_addrole N'ProjectServerRole', N'dbo'
---> System.Data.SqlClient.SqlException: User does not have permission to perform this action.

Root cause: The farm account used to execute the PWA creation command does not have sysadmin privileges on the database instance.

Solution: In our environment no account is allowed sysadmin privileges, although it is clearly mentioned as a requirement for Project Server 2010,
We have decided to grant the farm account db_owner permissions manually on each of the 4 pwa databases and then Retry the provision process.

Sunday, August 28, 2011

SP2010 Workflow Events


Start a new workflow based on completion of a different workflow.


Use SPWorkflowEventReceiver class

- WorkflowStarting - A workflow is starting
- WorkflowSterted - A workflow was started
- WorkflowPostponed - A workflow was postponed - WorkflowCompleted - A workflow was completed

Friday, August 26, 2011

SP2010 Activity Feed / News Feed

News feeds are populated using a job in Central Administration -> Monitoring -> Review job definitions -
> [User Profile Service Application] - Activity Feed Job

Tuesday, August 23, 2011

Exam 70-573

This is just an incredible resource to study for Exam 70-573.

SharePoint 2007 Site Template list does not exist

User creates a site template in a publishing site collection (using the old trick of navigating directly to save site as template page). This site template includes CEWP's which point to static images as placeholders. When a new site is created using the template, everything works fine except,
a. Site Settings -> Modify Navigation results in "List not found" error
b. Edit CEWP and try to change the placeholder image to a valid image -> List not found error

Navigate to Site Settings -> Modify Navigation
Error occurs
REFRESH page !

All the CEWP's start working. I have not yet identified the root cause of this issue. Reflector should be able to help. My feeling is that the publishing infrastructure adds some link pointers in the site template as GUIDs which cannot be found after the new site is created using the template.

UPDATE: This could be a possible explanation,

Monday, August 22, 2011

SharePoint SSL

Setup SSL for existing HTTP SharePoint web site.

1. SelfSSL, Entrust -> assign certificate
2. If only SSL is required, then drop current IIS website ONLY
3. If multiple websites require SSL on same server, use multiple IPs
4. Alternate access mappings:
Zone: default
https -> https
http -> https
5. Also note F5 is used to offload SSL.
6. Once SSL is configured setup required AAM's and re-configure search settings.

Sunday, August 21, 2011

Connect Ubuntu and PS3

Need to use ubuntu machine as a media server for PS3.

Use mediatomb

1. This link explains almost all steps in detail,

1. Media Tomb icon is not displayed in PS3 under videos, music or pictures.
Ans: Restart media server (computer) and PS3.

2. Media Tomb icon is displayed but only PC directory is shown although you have shared appropriate folder from computer and mediatomb is working.
Ans: Restart PS3

Thursday, August 18, 2011

SharePoint .NET SAML

Want to use .net to create SAML token ?

Refer these links,

Tuesday, August 16, 2011

SP2010 - Difference between v2v and b2b

Difference between v2v and b2b,
•A v2v upgrade is used for upgrading from one product version to another (e.g. MOSS 2007 to SharePoint Server 2010).
•A b2b upgrade is used for upgrading from one build to another within the same product version (e.g. SP2010 RTM to SP2010 SP1).

Sunday, August 14, 2011

Hide ribbon from annonymous users - SP 2010

Use this link info to hide ribbon effectively from annonymous users. It also resolves the scrollbar issue,

If you want authenticated users to see the ribbon then you have multiple options,
1. Move the "welcome user" to another location on the page.
2. Provide a new link that points to /_layouts/authenticate.aspx which will open up IE login window.

Tuesday, August 9, 2011

SharePoint 2010 SP1 and June CU

1. Logon, as the setup account to perform all the operations
2. Run the SharePoint configuration Wizard to check that everything is OK in the Farm
3. Checked the existence of an up to date Full SharePoint Farm backup, if not take one now, before the update, just in case something goes wrong.
4. Took a full SharePoint Farm backup using Central administration
5. Installed the SharePoint Foundation SP1 package (sharepointfoundation2010sp1-kb2460058-x64-fullfile-en-us.exe)
6. Rebooted server (as requested by previous installation)
7. Installed the SharePoint Office Server SP1 package (officeandprojectserver2010sp1-kb2460047-x64-fullfile-en-us.exe)
8. Rebooted server (as requested by previous installation)
9. Installed the SharePoint Foundation June CU package (sharepointfoundation2010-kb2536601-fullfile-x64-glb.exe)
10. Rebooted server (as requested by previous installation)
11. Installed the SharePoint Office Server June CU package (office2010-kb2536600-fullfile-x64-glb.exe)
12. Run the SharePoint 2010 Products Configuration wizard on central admin server


Thursday, July 28, 2011

Open a utf8 encoded file saved in windows on unix or linux

Programmatic creation of xml files using c# in a sharepoint library. These files are then manually sent over to a linux system that reads these files using bash od command. The output of the linux command sees 3 special characters in front of the xml declaration tag which is not visible when we open the file in notepad on windows.

The 3 special characters are displayed due to BOM (Byte order marker) present as the first character in the generated xml file which is not visible in notepad. The solution is to remove the BOM character programmatically before writing the file to disk / sharepoint.

This can be easily achieved using,

Pass false as a parameter to the constructor so that it ignores the BOM while encoding files.

Wednesday, July 27, 2011

SP2010 Tag external sites.

Click on Tag this page on an internal site and read the information on the dialog box.

Tuesday, July 26, 2011

SharePoint Most Popular / Viewed Documents webpart

Ideas to build a SharePoint Most Popular Documents webpart

1. IIS Log
a. we use a logparser to push iis logs to db monthly for reporting. tweak the code to push only document read info to a db table daily.
b. build a webpart to read the sql table.
2. Audit logs (bad idea)
a. turn on site collection audit logs to track document view.
b. use audit log object model to read the info you need.
3. Site collection usage reports -> i dont know if the reports store the document information. I dont think it does, maybe worth a check.
4. Complicated approach, but could be extended,
a. Deploy a delegate control at site(any level?) level with some javascript, which will track document clicks (trust me this will be complicated) and uses ajax to store it back the server in a config list.(It could just write to a links list).
b. Use the list view webpart / custom webpart to display the list view.

Saturday, July 16, 2011

Read sharepoint xml file into memory dataset

using (MemoryStream mStr = new MemoryStream(folder.Files[0].OpenBinary()))

Friday, July 15, 2011

Create SPFolder and upload SPFile programmatically

SPList list = web.GetListFromUrl(u);
SPFolder folder = web.GetFolder(string.Format("0}/{1}",list.RootFolder.Url,foldername));
if (!folder.Exists)
folder = list.RootFolder.SubFolders.Add(foldername);

using (MemoryStream stream = new MemoryStream())
SPFile file = folder.Files.Add(filename, stream);

Thursday, July 14, 2011

Add user to email distribution list

Email distribution lists can be easily manipulated using ADSI code (System.DirectoryServices) and LDAP protocol.

ampersand .net app.config configuration files

Using & (ampersand) in .net configuration files

You cannot use the & symbol in the application configuration files (web.config and app.config). For your application to work replace the & symbol with "& amp; (without the space in between ampersand and the word amp)"

Add service reference in visual studio for password protected services

Visual Studio does not directly allow to add web reference to password protected secure webservice and it will throw error like you have mentioned. But you can still add web reference to secure webservice by using 2 techniques.

Browse the webservice wsdl in a browser. It will prompt for security login and provide the username/password. Then save the WSDL xml into a file in your local computer.
Then add web reference to this local version of wsdl. In this way, you will be able to add web reference to secure password protected webservice using visual studio. user-agent parse

private float getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
float rv = -1;
System.Web.HttpBrowserCapabilities browser = Request.Browser;
if (browser.Browser == "IE")
rv = (float)(browser.MajorVersion + browser.MinorVersion);
return rv;

private void Page_Load(object sender, System.EventArgs e)
string msg;
double ver = getInternetExplorerVersion();
if (ver > 0.0)
if (ver >= 7.0)
msg = "You're using a recent version of Internet Explorer.";
msg = "You should upgrade your copy of Internet Explorer.";
msg = "You're not using Internet Explorer.";

Label1.Text = msg;


Monday, July 11, 2011

Ubuntu FB upload photo desktop

Upload bulk photos to Facebook using desktop application - Ubuntu

Ubuntu install new packages

Ubuntu install new packages

Project Server 2003 to 2010 Migration.

Technet Center for Project Server:

Migration Center:

Migrate from Project Server 2003

Video and Webcasts:

· Project Server 2003 to Project Server 2007 Migration Best Practices

· Project Server 2010 - Upgrade and Migration (Level 300)

· Project Server 2010 - Backwards Compatibility Mode (Level 300)

Migration best practices: