Cannot connect to the SharePoint site: Make sure that the Site URL is valid and that the current user has the necessary permissions to access the site.Additional information:”The specified command ID ‘Microsoft.VisualStudio.SharePoint.Commands.ValidateSite’ does not match any available SharePoint remote commands.Parameter name: commandId”

Hello All,

I have attended DEVCAMP at Bengaluru for SharePoint 2013 Apps development; I come across error while validating my Office 365 link from Visual Studio 2012.

Error:

“Cannot connect to the SharePoint site: https://indusasp.sharepoint.com/sites/DevCamp/SitePages/DevHome.aspx/. Make sure that the Site URL is valid and that the current user has the necessary permissions to access the site.Additional information:”The specified command ID ‘Microsoft.VisualStudio.SharePoint.Commands.ValidateSite’ does not match any available SharePoint remote commands.Parameter name: commandId”

I have installed updates one by one describe in below link and its working fine for me.

“http://blogs.msdn.com/b/timquin/archive/2013/01/22/setting-up-visual-studio-2012-for-sharepoint-2013-development-offline.aspx”

Hope this help someone!!

The password supplied with the username Domain\username was not correct. Verify that it was entered correctly and try again.

I tried to create new web application using my farm credentials but no luck and it has given below big smile …

The password supplied with the username Domain\username  was not correct. Verify that it was entered correctly and try again.

Cause: I have changed my farm credentials (password) in morning and just try to create web application we need to keep in mind once we change our farm credential we must register our farm account using below stsadm:

Go to command prompt and navigate to bin location of 14 hives

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN >

stsadm -o updatefarmcredentials -userlogin <domainusername> -password <newpassword>

It will give you message as “Operation completed successfully.”   Now reset IIS.

And you know what!! It’s work for me!!!

 

Reference and for more details: http://technet.microsoft.com/en-us/library/cc263417(office.12).aspx

Connect a List’s Event Receivers using PowerShell in SharePoint 2010

Hello Guys,

For Administrative purpose we can use below script for:

We can use Windows PowerShell to display the Event Receivers specific to a List in SharePoint 2010.

We can simply connect to the List and use the Event Receivers Property:

PS > $spWeb = Get-SPWeb http://Criterian.Nims.nu

PS > $spList = $spWeb.Lists["SilledLists"]

PS > $spList.EventReceivers

PS > $spWeb.Dispose()

 

Hope this helps..

How to get Central Admin Url for a farm in SharePoint 2010

Hello Guys,

For one of my project I have implemented below C# code for fetching dynamically SharePoint Central Admin Url:

SPAdministrationWebApplication caFarmUrl = Microsoft.SharePoint.Administration.SPAdministrationWebApplication.Local;
var caUrl = caFarmUrl .Sites[0].Url;
We can also find our Central Admin Url using Powershell as below:
$caFarmUrl = [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local
$caFarmUrl .Sites[0].Url
I hope this helps someone.

New Item Form to take parameters from Query String in the SharePoint 2010

Hello,

This post can help about how to pass Query string param SharePoint newitem.aspx form.

Procedure:

Open the SharePoint designer and go to your libraries.

Click the New and create a New Insert View by providing the name of the view.

Now, delete the default view of new form that you have created. Now your page will look like below image.

After deleting the default view of new form go to SharePoint control and add custom list or library as you desire.

Select new item form from option and click on ok button.

Here I have added comment field. I changed format as Text Box

Now got to parameter option from Top of SharePoint designer and Add parameter that you want to add into comment field.

Passing Comments from query string parameter that we have define above.

Change to code mode and make below changes.

Change the text property to {$param} This will set the query string parameter to the text box.

Here you go!!

 

Thank you,

No matter how hard you learn, when it comes to SharePoint, there is always something new to learn.

Step by step migration from MOSS 2007 to Sharepoint 2010

Migration from  MOSS 2007 to Sharepoint 2010

By Bhavin Sankhat

I have done migration for one of the my project.  I hope this migration process will help someone.

Step1: Perform below task if required.

Upgrading SharePoint 2007 32 Bit to SharePoint 2007 64 Bit

By default, the SharePoint 2010 is available only in 64 bit mode. To be able to upgrade the SharePoint 2007 32 bit to SharePoint 2010, you will first need to upgrade your SharePoint 2007 32 bit to SharePoint 2007 64 bit if you are interested in migrating only some of the SharePoint sites. The stsadm command for taking a backup of a site stsadm –o backup –url <url of the SharePoint 2007 site> –filename <Path and file name of the backup file> you can also use –force switch to force the backup process in case of any issues.

Step 2: Create 64 Bit Moss Server

How to Install Office SharePoint Server 2007 SP1 on Windows Server 2008 R2

Well, you can’t do it out of the box, you need to slipstream the updates into the installer.  I have read lots of instructions including the official ones and I don’t think they are clear at all, so I’ll give it a shot.  These instructions are assuming you are installing on a 64-bit system, which most likely you are since R2 has no 32-bit version

What You Need

  • Installation bits of Office SharePoint Server 2007 SP1 (these are your installation files).  I have put these files in the following path: C:\Temp\RTM-Bits\Office SharePoint Server 2007 SP1
  • Installation bits of Windows SharePoint Services 3.0 SP1 (these are your installation files).  I have put these files in the following path: C:\Temp\RTM-Bits\Windows SharePoint Services 3.0 SP1
  • Windows SharePoint Services 3.0 x64 with Service Pack 2 (place the Sharepoint.exe folder on C:\temp)
  • The 2007 Microsoft Office Servers Service Pack 2 (SP2) (the 64-bit version, place the officeserver2007sp2-kb953334-x64-fullfile-en-us file.exe on C:\temp)

What needs to be done

  1. Extract the WSS files by typing: c:\temp\SharePoint.exe /extract:”C:\temp\WSS\Updates”
  2. Open the C:\temp\WSS\Updates folder, select all files and copy them
  3. Open the C:\Temp\RTM-Bits\Windows SharePoint Services 3.0 SP1\x64\Updates and paste all files (merge and replace)
  4. Extract the MOSS files by typing: c:\temp\officeserver2007sp2-kb953334-x64-fullfile-en-us.exe /passive /extract:”C:\temp\MOSS\Updates”
  5. Open the C:\temp\MOSS\Updates folder, select all files and copy them
  6. Open the C:\Temp\RTM-Bits\Office SharePoint Server 2007 SP1/x64\Updates and paste all files (merge and replace)

Step 3: Backup and Restore

Taking the version backup of a site collection:

stsadm.exe -o backup -url “http://localhost/&#8221; -filename “D:\Sharepoint Backups\My backup\backup.dat” -backupmethod full

Restoring the version backup of a site collection:

The web application should be present and running for restoring the site collection.

stsadm.exe -o restore -url “http://localhost/&#8221; -filename “D:\Sharepoint Backups\My Backup\backup.dat” -restoremethod overwrite

Your 64 Bit moss Version will be ready to migrate into Sharepoint 2010.

Step 4: Determining how to handle customizations

Although customizations for SharePoint come in many forms (Site templates , Site definition, Feature, Workflows and server controls, Event handler, Web Parts, Master pages and CSS files, etc.)  I would like to focus now on the compiled code. There were many questions I have read on Forums and Blogs about “Do we have to recompile or rewrite the code for a migration to SharePoint 2010?”.  I have found several answers and the good news is that in many cases neither rewriting the code nor even recompile it won’t be necessary. But I would like to display two excerpts of the Microsoft documentation that illustrates what you have to deal with:

Excerpt 1: Existing applications

You must recompile existing 32-bit applications and custom assemblies (for example, Web Parts and event receivers) to run on the 64-bit architecture because the 64-bit edition of SharePoint cannot load a 32-bit assembly. Before you recompile existing applications or custom assemblies, verify that they are compiled to run on both architectures. If this is the case, do not compile them for a single architecture. (In Microsoft Visual Studio this build option is Any CPU.)

If the existing applications are third-party applications, check with the third-party vendor regarding 64-bit versions and compatibility. In the case of custom contracted solutions for which you do not have the source, verify the solutions in a test 64-bit environment to ensure compatibility.

Excerpt 2 : Obsolete Classes and Namespaces

Because the changes to the API in the upgrades are backward compatible, you should not have to make any changes to your Windows SharePoint Services 3.0 or Office SharePoint Server 2007 custom solutions before you redeploy them in either SharePoint Foundation 2010 or SharePoint Server 2010. Some classes and namespaces are obsolete, but they will continue to work as expected. If you want to start upgrading your applications so that they use the most current classes and methods, recompile your code. The compiler warnings will tell you which elements of the object model are obsolete, and which newer alternatives you should use. Figure 3 shows an example compiler warning and the corresponding mouse-over warning in Visual Studio 2010.

 Step 5: Redeploying Customizations and Solutions in SharePoint Foundation 2010 and SharePoint Server 2010
You can deploy a dll compiled for MOSS 2007 using the “Any CPU” or x64 build option on a SharePoint 2010 server and it will work using the 64-bit process, but if you want an optimized code you should recompile it with the new SharePoint 2010 object model. So in many case it won’t be necessary to recompile but it is recommended to do it to optimize your code and to learn the new SharePoint 2010 object model.

 

Other customization

Looking to the table listing the different kinds of customizations and the migration impact on it, presents in the Microsoft documentation, I see 4 main important areas to review:

  1. Information architecture – sites provisioning
    Site definition and site templates
    Managed paths (inclusions/exclusions)
  2. Look and Feel – UI Experience
    Themes
    Toolbar actions
    Master pages and CSS files
  3. Custom code
    Workflows and server controls
    Event handler
    Web Parts
    Services
    Authentication providers
    Search provider or security trimmer
    JavaScript
  4. Features

Step 6:  Before migrate content DB to sharepoint server 2010 make sure below steps:

  1.   SQL server version both end must be same (Update Version if required)
  2.   Database backup version must be same. (Got to Version table under table tab and update appropriate version)

Step 7:  Migrate the Content database of MOSS 2007 to Sharepoint 2010.

Attach the Content DB to SharePoint 2010 Application

The process of attaching the content DBs in the SharePoint 2010 Web Application should be done through STSADM tool. For Attaching the Content DB to a SharePoint 2010 Web application, you should perform the tasks in the following order:

  1. Restore the Content DBs to New SQL Server Instance
  2. Delete the existing content DB of the Web application
  3. Attach the Content DB of the Root Site collection
  4. Attach the Content DB of other Site / Site Collections if any
  5. perform an IISRESET
  6. Open the SharePoint 2010 Web Application
  7. Perform the Visual upgrade to get the SharePoint 2010 Look and Feel

Upgrade My Site

To upgrade the My Site to SharePoint 2010, you should perform the following activities

  1. Configure the My sites in SharePoint 2010
  2. Perform the Content DB attachment method as discussed earlier.

An error occurred accessing a data source. An entry has been added to the Windows event log of the server. Log ID:5566

I tried to open the InfoPath form from the form library as web-browsable form and I fall on to this error:

An error occurred accessing a data source. An entry has been added to the Windows event log of the server.

Log ID: 5566

The cause of this error is the installation of .net 3.5 SP1. So to resolve this error you have to add key to the registry on all of the servers I have 2 WFE and 1 Application server. I had change the registry key on the entire server and restart the servers. The first server I restart is of course WFE on which my CA resides and the other WFE and then Application server. I think it’s always best to change first in Server on which CA resides.

I had followed these steps on all my servers and it works for me:

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Exit Registry Editor.
  8. Restart the computer.

Reference: http://support.microsoft.com/kb/926642

Content Query limitations, and Object module access rights requirements

Some new articles were published just now by Microsoft about sharepoint limits that were undocumented until now:

  1. The Content Query Web Part does not support more than 1000 lists at the same time.
    This is actually not a content query web part problem, but a SPSiteDataQuery problem, which the content query web part uses. If you are using SPSiteDataQuery in your code, or a Content Query web part in your page, you may see the error “The query cannot be completed because the number of lists in the query exceeded the allowable limit”.
    So you have to be extra careful that your content query web part in not set up to query more than that amount.Read the Microsoft Article (opens in new window).
    Possible error message:
    The query cannot be completed because the number of lists in the query exceeded the allowable limit. For better results, limit the scope of the query to the current site or list or use a custom column index to help reduce the number of lists.
  2. Error Message when running an application that accesses the object module.
    This is actually something I have encountered with my Utility pack and answered some people in the forums about this, and apperantly MS saw fit to document it properly now.
    When running an appliation on the server that tries to use the object module, you have to run with a user account that has sufficient permissions. Not just on the site, and not just on the server!:

    1. The user is a server farm administrator.
    2. The user has permissions to access the content database.
    3. The user is a site collection administrator.
    4. The user has permissions to access the Windows SharePoint Services site or the SharePoint Server 2007 site through which the code iterates.

    Notice requirement #2? this is where I failed with my utility pack on a client server – I was running the tool with an account that had local administration rights on the server, but the account didn’t have any permissions on the database.
    This is also true for running stsadm operations such as backup and restore, or feature deployments… (something they don’t say in the article…).
    Read the Microsoft Article (opens in new window).
    Possible error messages:
    Unhandled Exception: System.IO.FileNotFoundException
    Access Denied” (The Microsoft article does not mention this, but I have seen this error for the same issue)

Creating a custom save function for InfoPath 2007 browser based forms

I recently had an issue where it was necessary to only save some of the fields on an InfoPath form back to the form library. To do this required a combination of custom code and submission to a form library using a data connection.

The steps to do this were as follows:

1. Add a Save button to the form

2. Right click the save button and select button properties, change Action dropdown to Submit and click Submit Options…

3. In the submit options select Send form data to a single destination and choose SharePoint document library from the dropdown

4. Click Add to add a new data connection and follow the wizard to set this up to submit your form to the required library

5. Now that the data connection has been set up, select Perform custom action using Code and click the Edit Code button – this will create a submit method in the code behind file

6. In the submit method place the code to do the custom “stuff” and then submit the form to the data connection. The code will look something like:

public void FormEvents_Submit(object sender, SubmitEventArgs e)
{

//remove values from the form that you don’t want to be saved
XPathNavigator xPnName = MainDataSource.CreateNavigator().SelectSingleNode(“/my:myFields/my:Name”, NamespaceManager);
xPnName.SetValue(“”);

//submit the form using the data connection

DataConnections["Main submit"].Execute();

//set e.CancalableArgs to be false once form has successfully saved

e.CancelableArgs.Cancel = false;
}

To give the form a unique filename and allow updates to saved forms do the following:

1. Create a new xml node called dtNow, give it a default value of now() and uncheck the Update this value when the result of the formula is recalculated box.

2. Go to Data and Data Connections and Modify the submit data connection created above.

3. In the Filename field add concat(userName(), dtNow) and check the Allow overwrite if the file exists checkbox.

Finally, convert the data connection used to submit the form to be centrally managed as described here

Original From : http://www.aidangarnish.net/post/Creating-a-custom-save-function-for-InfoPath-2007-browser-based-forms.aspx

Custom Saving in InfoPath

A long time ago I wrote an article about extending save functionality in Microsoft Office InfoPath forms. The C# code samples in that article all showed types and members of the Microsoft.Office.Interop.InfoPath.SemiTrust namespace, which is compatible with the Office InfoPath 2003 object model.

Recently, I had to develop custom save functionality for an Office InfoPath 2007 form template. Like one of the samples in the article, the form template had to assume “control” of the Save As dialog box by providing a default location and file name. So, I basically re-wrote that sample with the Microsoft.Office.InfoPath namespace. The following shows what it looks like in the Office InfoPath 2007 solution.

public void FormEvents_Save(object sender, SaveEventArgs e)
{
string userPrincipalName = MainDataSource.CreateNavigator().SelectSingleNode("//my:userPrincipalName", NamespaceManager).InnerXml;
string projectName = MainDataSource.CreateNavigator().SelectSingleNode("//my:project", NamespaceManager).InnerXml;
string startDate = MainDataSource.CreateNavigator().SelectSingleNode("//my:startDate", NamespaceManager).InnerXml;
if (this.New || e.IsSaveAs == false)
{
if (e.IsSaveAs)
{
this.SetSaveAsDialogLocation(@"c:\temp");
this.SetSaveAsDialogFilename(userPrincipalName + "_" + projectName + "_" + startDate);
}
e.CancelableArgs.Cancel = false;
e.PerformSaveOperation();
}
else
{
e.CancelableArgs.Message = "This functionality has been disabled.";
e.CancelableArgs.MessageDetails = "Only new forms can use the 'Save As' functionality.";
}
}

NOTE: Save using custom code is not supported in browser forms.

I found this from: http://blogs.3sharp.com/davidg/archive/2007/12/21/4504.aspx

Follow

Get every new post delivered to your Inbox.