Showing posts with label Sharepoint 2010. Show all posts
Showing posts with label Sharepoint 2010. Show all posts

Monday, July 29, 2013

SharePoint 2010 - Hidden Querystring options

Some commands to change the mode of a page your are on.


Add Web Parts \ Search ToolPaneView=3
Add Web Parts \ Browse ToolPaneView=2

View Mode mode=view
Edit Mode mode=edit

Personal Mode PageView=Personal
Shared Mode PageView=Shared



example newForm.aspx?ToolPaneView=2&PageView=Personal


AllItems.aspx?contents=1 will open Web Part Page Maintenance: AllItems




Friday, May 3, 2013

SharePoint 2010 Server rename - Cannot connect to configuration database error

Assumptions (not best practice): You have a standalone SharePoint 2010 farm installation.

Problem: Oh dear, you ran the stsadm renameserver command after you renamed the actual server name.  Now you getting the dreaded Cannot connect to the configuration database error.

Never fear, there is a solution to this and its relatively easy, its worked for me.

1. Create an alias from oldservername, to newservername in mssql configuration manager.  If you are using named instances for your SharePoint farm databases, setting up an alias for a named instance can be a bit tricky, but here is how its done http://bigjimindc.blogspot.com/2009/08/ms-sql-server-named-instances-and.html

2. Once the alias is done and is working, you will now be able to access the central administration.  Once in, go an update the alternate access mappings in central administration , then simply run the stsadm renameserver command again.  


stsadm -o renameserver -oldservername "oldserver" -newservername "newserver"

3. Now, remove the aliases (delete them)

4. Reboot server (if you can, else restart mssql and iis).

5. You should now have a working SharePoint farm again.


I believe you HAVE to run the stsadm renameserver command before you rename a actual servers name.  But sometimes you cannot do this and therefore my steps above should help you fix a "broken" SharePoint farm.  Well it did at least for me :-)


Friday, April 20, 2012

Sharepoint 2010 Event Receiver - Deploy and Remove manually

So you want to deploy an event receiver created in Visual Studio 2010 and cant!!!

Well its easy when you right-click the event receiver in VS2010 and click DEPLOY, oh how easy that makes things, butt what if you need to deploy that event receiver on another server.  Good luck with that.

Anyway, along the way, I eventually managed to do it, not without some pitfalls.  Here I describe a method that worked for me.

1. Create event receiver in VS2010

2. Right-click event receiver and click PACKAGE, the WSP file will be created in either your debug/release folder in your bin directory.

3. Copy WSP file to new server.

4. Open SharePoint Powershell

5. Run the following commands

6. Add-SPSolution -LiteralPath "path to wsp file\EventReceiverProject.wsp", you can check if it was installed using: Get-SPSolution "EventReceiverProject.wsp"

7. Install-SPSolution -Identity "EventReceiverProject.wsp"  -GACDeployment -CASPolicies

8. You will likely get an message saying admin service needs to run to Install, then just run this command: "stsadm.exe -o execadmsvcjobs"

9. Now to activate the feature, use the following command: stsadm -o activatefeature -n "EventReceiverProject2_Feature1" -url http://win-dtze75zqh6a

I discovered this at the following link http://social.technet.microsoft.com/Forums/en-AU/sharepoint2010programming/thread/5b8d6a87-1722-4dd3-af8e-767859291db9


You are done.  You can use SharePoint manager to check if you event receiver was correctly attached to your list.


To undeploy, its basically the above steps in reverse :-)


stsadm -o deactivatefeature -n "EventReceiverProject_Feature1" -url http://win-dtze75zqh6a/

Uninstall-SPSolution -Identity "EventReceiverProject.wsp"

Remove-SPSolution -Identity "EventReceiverProject.wsp"