Wednesday, December 9, 2009

Run STSADM from anywhere by changing "Path" Environment Variable

Getting "'stsadm' is not recognized as an internal or external command, operable program or batch file." when trying to run stsadm command line tool? This is because stsadm tool is located at: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN folder and when you try to access it from other folder (typically, command line opens in "C:\Users\Your-User-Name") , command shell may not be knowing where exactly stsadm.exe is located.

So, How to run stsadm from any directory from your SharePoint servers? Simple. Just add the stsadm's location to the "Path" Environment variable. here is how:
  1. Start > All Programs > Control Panel > System.
  2. Select Advanced System Settings, click the Environment Variables button.
  3. Under System Variables, Scroll to Path and click the Edit button.
  4. Add the following to the end of the Variable value field:
      ;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

For SharePoint 2010 it would be: ;C:\Program Files\Common Files\Microsoft Shared\web server extensions\14

Run STSADM from any directory
How About SharePoint 2010 and SharePoint 2013?
  • For SharePoint 2010, Set this path to: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\BIN 
  • For SharePoint 2013, Its goes as: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, October 30, 2009

Migrated SPS 2003 Sites still has Old Look and Feel?

In a Migration project, sites migrated from SharePoint 2003 to SharePoint 2007 has broken structure like this..
Migrated SharePoint 2003 has old Look and Feel

Changing the Master page didn't help.. After some trial and error, figured out: Reset the default.aspx to site definition fixes the issue!
Reset Default.aspx page to Get SharePoint 2007 Look and Feel



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, September 27, 2009

Hide Title Column in SharePoint List

Often, SharePoint users wants to remove(or hide at-least) 'Title' column from the lists and document libraries. We can hide title column in SharePoint 2007 by enabling content types.

How to hide title column in SharePoint list?
Follow these steps to hide the title column in SharePoint List or Library:  
  1.  Navigate to the List setting >> Advance setting hide title column sharepoint list
  2. check Yes radio button for "Allow Management of Content Types"hide title column sharepoint 2007 / 2010
       3. Now in List Setting again >> Select Content Type "Item"

       4. Then Select Title >> Select Hidden
remove title column sharepoint list
 Finally, you can remove the Title field from views (But you can't delete the Title column!). Same steps applies to both SharePoint 2010 and SharePoint 2007 list to hide title column. If you want, You can Rename the Title column even.
  •     Go to the List settings
  •     Click on the Title field
  •     Rename it, Save your changes by clicking "Ok" button

Disadvantages When You Hide Title column from SharePoint list:
By default Title column gets the context menu, if you hide it then, will loose the Context menu functionality. So, you may need to put the Edit button in all of your views just to edit the item or you can use SharePoint Designer to link with Edit/Views item.

Another disadvantage is we can't control the order of columns on the list settings page again until we turn off  "Allow management of content types".

Alternatively, You can hide title column (or any other column) programmatically: Hide Columns in NewForm, EditForm and DispForms

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, September 25, 2009

Move SharePoint Search Index Files Location to Another Drive

Again C:\ is running out of disk space in a SharePoint Farm, due to the fact Search index files are growing! Huh.. So this time I decided to move  move SharePoint 2007 index files from C:\Program Files\Microsoft Office Servers\12.0\Data\Office Server\Applications to E:\. 

Here are the steps to move SharePoint search index to another drive:
Move SharePoint Search Index Files from One Drive to Another

Its a good idea to pause the crawling schedules before we proceed moving SharePoint index location. After the index has been moved to the new location we have to resume the crawl that we have paused.

Run the below stsadm in Index Server:
stsadm -o editssp -title sharedservices1 -indexlocation e:\SharePointIndex

or you can run: stsadm -o osearch -indexlocation "E:\SharePointIndex"
This will reset the index and create new location.

In each query server, run the below command:
stsadm -o osearch -propagationlocation e:\SharePointIndex

If its a SharePoint Services (WSS), in Index server, you can run:
stsadm -o spsearch -indexlocation E:\SharePointIndex

To view what is being indexed and the current location of the Index:
stsadm -o spsearch -action list

now you can delete the old search index file from its old location.

Here is the Technet article: Change the content index location for an index server 

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, July 9, 2009

Expand-Collapse for Multiline Text columns in Sharepoint

Some times, when working with the Multiline fields, they may occupy the whole page :-).

We can solve this issue by introducing Expand-Collapse Trick with jQuery. On clicking on the little Arrow that row will be expanded, then again clicking will collapse.
Expand-Collapse for Multiline Text columns in Sharepoint

Here is How: Add the CEWP webpart and place the below code, then hide the webpart.
<script type="text/javascript">

if(typeof jQuery=='undefined'){

var jQPath = 'https://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js'
document.write('<script src="',jQPath,'" type="text/javascript"><\/script>');
}
</script>
<style type="text/css">
.expandText {height:auto;}
.collapseText {height:28px;overflow:hidden}
</style>
<script type="text/javascript">
function ExpGroupRenderData(htmlToRender, groupName, isLoaded) {
$("#tbod"+groupName+"_").attr("isloaded",isLoaded)
.html(htmlToRender)
.show("fast",collapseText("#tbod"+groupName+"_"));
}

function collapseText(group){
if (!group) group = "#MSO_ContentTable";
var html ="<img alt='collapseText' style='cursor:pointer;' src='/_layouts/images/menudark.gif'/>";
$(group+" td.ms-vb2>div").each(function(i,e){
$(e).css({display:"inline-block"});
if (e.clientHeight > 35){
$(e).toggleClass("collapseText")
.prepend(html);
}
});
$(group+" img[alt='collapseText']").click(function(event){
$(event.target).parent().toggleClass("collapseText");
});
}
$(function() {
collapseText();
});
</script>
<style type="text/css">
.ms-vb{
vertical-align: middle
}
.ms-vb2{
vertical-align: middle;
}
.ms-vh2-nograd
{
text-align: center;
}
</style>

Thanks to: https://www.nothingbutsharepoint.com/sites/eusp/Pages/jquery-for-everyone-collapse-text-in-list-view.aspx?replytocom=15961

Other ways:
Codeplex project: http://spcollapser.codeplex.com/

Jquery: http://www.myrocode.com/post/2009/04/22/Collapse-or-Expand-SharePoint-web-parts-in-your-pages-get-OpenCloseWps.aspx
http://fitandfinish.ironworks.com/2010/02/how-to-expand-collapse-web-parts-in-sharepoint-using-jquery.html

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, June 24, 2009

Server error: http://go.microsoft.com/fwlink?LinkID=96177

SharePoint Central Administration displayed just "Server error: http://go.microsoft.com/fwlink?LinkID=96177" error message on a SharePoint Farm.
Server error: http://go.microsoft.com/fwlink?LinkID=96177

After little research, Found Hot fixes are installed, but Products and Technologies wizard has not Run! After running "SharePoint Products and Technologies Configuration Wizard" everything turned up.

In case psconfig fails, try:  stsadm –o upgrade –inplace -url <URL-Of-the-Web-app> -forceupgrade

If you still get issues after upgrade, You can follow the Microsoft KB: http://support.microsoft.com/kb/944267

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, May 13, 2009

Web Part Maintenance Page in SharePoint

Once, I ran across the issue where a web part is dropped on to a page, and then SharePoint errors out for one reason or the other. I had to use the Web Part Maintenance Page to fix the problem.

However, there is no way to get to this page from any easily available link. Where is SharePoint link to web part maintenance page?

Resolution: To get to the Web Part Maintenance page, I appended the query string ?contents=1 to the URL in the browser. say for e.g. SharePoint web part maintenance page URL would be:
http://crescent.com/test/default.aspx?contents=1
Web Part Maintenance Page in SharePoint
Web Part Maintenance Page could be a real saver when faulty web parts crashing SharePoint. Open web part maintenance page and Remove the faulty web part to get the sites back.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, February 14, 2009

SharePoint 2003 to SharePoint 2007 Migration using Database Attach Method: Step by Step

In this article, I'm walking through the complete step by step procedures on Migrating from SharePoint 2003 to MOSS 2007 using database attach method.

Overview
How to migrate SharePoint 2003 to SharePoint 2007? Migrating from SPS2003 to SharePoint 2007 on Database attachment method involves the below 4 tasks.
  1. Run PreScan.exe in SPS 2003 server.
  2. Take the back up of content database of SharePoint Portal Server 2003.
  3. Restore the content databases back up on SQL Server of MOSS 2007.
  4. Create web application in MOSS 2007.
  5. Attach the SPS 2003 databases to MOSS 2007.

1.     Run Prescan.exe in SPS 2003 Server

  • Download & Run the prescan.exe as below in command prompt:
prescan.exe /c preupgradescanconfig.xml /all

2.     Take the Content Database Backup from SPS 2003

Set the database to read-only before taking backups.
Set the database as read only:
1.       In Microsoft SQL Server Enterprise Manager, right-click the name of the database that you want to set to read-only, and then click Properties.
2.       In the Properties dialog box, click the Options tab.
3.       Under Access, select the Read-only check box, and then click OK
Backup the database:
Follow these steps to take backup:
1.       On the SPS2003’s database server, click Start, point to All Programs, point to Microsoft SQL Server, and then click Enterprise Manager sharepoint 2003 to sharepoint 2007 migration
2.       Traverse to Databases node by expanding the tree.
3.       Right-click the database you want to back up, point to All Tasks, and then click Backup Database
migrating from sharepoint 2003 to sharepoint 2007  
4.       In the SQL Server Backup dialog box, specify a name for the backup, select Database - complete, select an existing destination, and then Click OK to start the backup process.
5.       Repeat these steps to back up the databases that are used by SharePoint Portal Server 2003 in your environment,

3.  Restore the back up on MOSS 2007's SQL Server:

  1. Open the SQL Server Management studio, traverse to “Databases” node. Then right click the “Databases” and choose “Restore Database…” from the context menu. sharepoint 2003 to 2007 database migration
  1. Specify the Database name, Restore Source, Destination, File names in the following screens. migrate sharepoint 2003 site to sharepoint 2007
Specify the file name and locations
restore sharepoint 2003 to sharepoint 2007

sharepoint 2003 to moss 2007 upgrade database migration
  1. Click “OK” to start the restore operation and Wait for the restore to complete! The time of restoring database depends upon the database size and server’s capacity.

Once the migration from SharePoint 2003 to SharePoint 2007 is completed, set the database compatibility level to the recent version in SQL Server.

4. Create web application in MOSS 2007

  1. In the SharePoint Central Administration, click on “Application Management” and click on “Create or extend Web application” under “SharePoint Web Application Management”.
  2. Again click on “Create Web application”. Set the settings according to the needs say http://migration.CompanyName.com
  3. Don’t create any site collection.
  4. Install & Copy the solutions, file system changes (like images, themes) from SPS 2003 to MOSS 2007 servers.
Remove content database of the newly created web application in MOSS 2007:
Now, we need to delete the content db of the newly created web application in order to avoid any URL conflicts. Run the below stsadm command:
stsadm -o deletecontentdb -url http://migration.CompanyName.com -databasename <MOSS2007_Migration_Content>

5. Attach restored database with the newly created web application in MOSS 2007

Finally, we need to attach the restored SPS 2003 database to MOSS 2007 by running the STSADM
stsadm -o addcontentdb -url http://migration.CompanyName.com -databasename <SPS2003_Portal_Content>
sharepoint 2003 to moss 2007 migration

Unit Test: 

We are done with SharePoint 2003 to SharePoint 2007 migration! Browse the migrated sites in MOSS 2007 and check their look& feel and functionality.

Related Post:
Migrate from MOSS 2007 to SharePoint 2010 - Step by Step

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, January 1, 2009

How to Adjust Column Width in SharePoint List View?

Requirement: Adjust SharePoint column width in list view.

To change column width in SharePoint, There are two options:
  1. Set column width using SharePoint Designer
  2. Change SharePoint column width using jQuery, as below:
sharepoint change column width jquery


To set width of column in SharePoint 2007, place the below code in CEWP, place it below list view web part and hide it!
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(function(){
$("TH.ms-vh2-nograd:contains('Reason')").css("width", "150px");
});
</script>


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...