Friday, October 31, 2008

Browser Compatibilty forOffice SharePoint Server

The newer version of sharepoint , MOSS 2007 has better cross browser compatibility than the older version .It supports the following browswer :

Windows
Firefox 1.5+
Netscape 8.1+
Mozilla 1.7+

Macintosh
Safari 2.0+
Firefox 1.5+

Unix/Linux
Firefox 1.5+
Netscape 7.2+

Check out the following article to completely understand the browser compatibility:
http://technet.microsoft.com/en-us/library/cc263526.aspx

Tuesday, October 28, 2008

Restrict Anonymous Users to view Form Pages in MOSS 2007

If you enable the anonmous access in MOSS 2007 Site. The anonmous user will able to access the form pages like:
http://server/pages/forms/allitems.aspx

If you want to restrict anonymous users to access those default form pages.

Enable the ViewFormsPagesLockdown Feature to restrict anonymous users to access the site

Syntax:
stsadm.exe -o activatefeature -url -filename

Example:
stsadm.exe -o activatefeature -url http://server -filename ViewFormPagesLockdown\feature.xml

How to change your personal information in MOSS 2007

Remember how you had to scan through user information pages to get the correct display name. In MOSS 2007 this is more convenient. By default SharePoint will display 'domain\username' in the fields related to who was last participating in a document, list, survey, etc...

To change from 'domain\username' to show your actual name follow the instructions below:
  1. Log into the Portal
  2. Click the Welcome domain\username in the upper right hand corner
  3. A drop down menu will appear
  4. Click My Settings
  5. Click Edit Item
  6. Change your Name field and fill in any additional fields as necessary
  7. Click OK

To verify your name has changed look at the Welcome message. It should say 'Welcome Your Name' instead of your domain\username.

This tip is not for Moss 2007 but for WSS v3 ! It won't work with Moss !With Moss, you have 2 ways to modify profile information:

  1. on the ssp edit profile page (ony for admins)
  2. on my site, edit my profile

Limiting the SharePoint People Picker

In SharePoint there will be times where you will want to control what results the people picker returns. The most common scenarios are in an extranet or hosting environment.
There are four strategies which can be used to limit the people picker. All of these are managed using STSADM commands. The four strategies are:-
  1. Applying a custom active directory filter
  2. Limiting the people picker search to within a site collection
  3. Limiting the people picker search to within an Active Directory(AD) Organisational Unit(OU)
  4. Disable returning windows accounts when the authentication method for the web application is via forms based authentication

    Some of these commands are not very well known and some are new in MOSS SP1.

Custom Active Directory Filter

To limit the search to a custom AD filter use the STSADM property peoplepicker-searchadcustomfilter

This property is new in SP1 and when a people search is executed it will return results that only match the combination of the built in query and the custom filter that is defined for the site collection.

To create a custom filter which will only return users with a title of Vice President run the following command for their site collection.

stsadm -o setproperty -url http://server/sites/vp-site -pn peoplepicker-searchadcustomfilter -pv ((Title=Vice President))

There is also a similar property with slightly different functionality called peoplepicker-searchadcustomquery. This command is also available pre-SP1 however you should ensure that the Active Directory attribute that is being queried is indexed; otherwise there may be performance problems.

Search only within a site collection

This option is suitable to a classic extranet environment where the internal and external user accounts are in the active directory however you do not want the extranet users to be able to search and browse the directory listing. Note that this is not 100% secure, users can still search Active Directory using a fully qualified logon name, regardless of this property setting. To only list users who have been added to a site collection use the property - peoplepicker-onlysearchwithinsitecollection. As an example:

stsadm -o setproperty –url http://extranet.company.com/sites/project1 –pn peoplepicker-onlysearchwithinsitecollection –pv yes

Consider for this site collection there is an AD user account: 'Gavin Adams COMPANY\gadams)' who is not a member of the site collection and the user 'John Doe (COMPANY\jdoe)' is already a member of the site collection. The behaviour that the users will see when they add a user to the site is as follows.

Search only within an AD OU

To limit the search to a path with AD (ie an OU) use the operation setsiteuseraccountdirectorypath

This operation is new in SP1. Once this is set for a site collection no other users can be added to the site collection that are not within that OU. Note that only one OU path can be specified per site collection. An example of this command is:-

stsadm -o setsiteuseraccountdirectorypath -path "OU=Employees,DC=Company,DC=com" –url http://server/sites/teamsite

Often administrative user accounts are in a different OU from the users for a site collection, therefore after the above operation has been applied to a site collection, the property peoplepicker-serviceaccountdirectorypaths is used to define the location of the administrator accounts. For example:-

stsadm -o setproperty -url http://server/sites/teamsite -pn peoplepicker-serviceaccountdirectorypaths -pv " OU=MOSS-Gods,DC=Company,DC=com

Non Windows Accounts only via FBA

If you have a web application that is configured to use forms based authentication and the account and membership provider is not Active Directory (eg a SQL database), then the property peoplepicker-nowindowsaccountsfornonwindowsauthenticationmode can be set against the web application or zone so that the people search will not return any active directory user accounts.

An example of the command with a web application https://extranet.company.com would be:

stsadm -o setproperty -url https://extranet.company.com -pn peoplepicker-nowindowsaccountsfornonwindowsauthenticationmode -pv yes

Note:
To use peoplepicker-searchadforests with credentials, which you need to specify if you don’t have two-way trusts in place, you must first set an encryption key:
stsadm.exe -o setapppassword -password key
This sets a key that will be used to encrypt/decrypt the password in the content database. Failure to do this results in a “command line error” message.
Secondly, the peoplepicker runs under the credentials of the application pool the site is running in(password of this credential user). Make sure the application pool identity is a domain account with the right permissions.

Thursday, October 23, 2008

Detect, and then delete orphaned items in Windows SharePoint Services content databases

You can use the Stsadm.exe command-line tool with the databaserepair operation to detect, and then delete the following orphaned items in Windows SharePoint Services:
  • A Windows SharePoint Services Web site that does not have a parent Windows SharePoint Services Web site.
  • A subweb that does not have a parent Windows SharePoint Services Web site
  • A list that does not have a parent Windows SharePoint Services Web site
  • A document that does not have a parent document library
  • A list item that does not have a parent list
  • A Web page that does not have a parent Windows SharePoint Services Web site

The databaserepair operation uses the following parameters:

  • Required parameters: url, databasename
  • Optional parameter: deletecorruption

The syntax that the Stsadm.exe command-line tool and the databaserepair operation uses is as follows:

Troubleshooting SharePoint: When Good Servers Go Bad



It summarizes the most-common issues with SharePoint, how to avoid them, and how
to fix them. Here is a list of topics:



  • Install Service Pack 1

  • Runaway Transaction Logs

  • Runaway SharePoint Logs

  • Protected Memory Errors

  • IISWAMREG Admin Service Errors

  • Timer Job Errors

  • Update Conflicts

  • Performance Issues

  • Customization Errors

  • Security Errors



Install Service Pack 1



The first recommendation is to make sure that you have SP1 installed. SP1 has
over 2500 fixes, and can go a long way to helping you avoid issues.



WSS SP1 Download



MOSS SP1 Download





Runaway Transaction Logs



One of the most common issues with SharePoint farms is runaway transaction logs
associated with the SQL Server databases. This is really not a SharePoint issue,
but a SQL Server issue. This issue is caused by the fact that most SharePoint
databases are created in Full-Recovery mode. This means that SQL Server retains
a log of every transaction that occurs on the database since the last database
backup. If you never backup your SharePoint databases, then the transaction log
will continue to grow until all the disk space is used up.



Symptoms



  • Little or no available disk space on SQL Server

  • Huge transaction log files



Recovery



Step 1: Backup the Transaction Log manually from the UI. This will truncate
the log, but not shrink it.



From
http://support.microsoft.com/kb/873235



When the transaction logs grow to an unacceptable limit, you must immediately
back up your transaction log file. While the backup of your transaction log
files is created, SQL Server automatically truncates the inactive part of the
transaction log. The inactive part of the transaction log file contains the
completed transactions, and therefore, the transaction log file is no longer
used by SQL Server during the recovery process. SQL Server reuses this
truncated, inactive space in the transaction log instead of permitting the
transaction log to continue to grow and to use more space.



Step 2: Manually shrink the log file from the UI.



From
http://support.microsoft.com/kb/873235



The backup operation does not reduce the log file size. To reduce the size of
the transaction log file, you must shrink the transaction log file. To shrink a
transaction log file to the requested size and to remove the unused pages, you
must use the DBCC SHRINKFILE operation. The DBCC SHRINKFILE Transact-SQL
statement can only shrink the inactive part inside the log file.



Prevention



Option 1: Switch to Simple recovery Mode for non-production SharePoint
databases.



This will prevent the transaction log from growing because simple recovery mode
does not keep transaction history. Use the following SQL Statement:



USE Master

SELECT Name, Recovery_Model_Desc FROM Sys.Databases



ALTER DATABASE [name] SET RECOVERY SIMPLE WITH NO_WAIT



Option 2: Create a database maintenance plan for all SharePoint databases




Creating the Database Maintenance Plan



1. Open SQL Server Management Studio



2. Right click the SQL Server Agent and select Start from the context menu.



3. Expand the tree and select Management►Maintenance Plans



4. Right click the Maintenance Plans folder and select Maintenance Plan Wizard
from the context menu.



5. On the Welcome screen, click the Next button.



6. On the Select Plan Properties screen, name the plan “MOSS Maintenance”



7. Click the Change button



8. Modify the schedule (daily recommended) and click the OK button.



9. Click the Next button



10. On the Select Maintenance Tasks screen, check the following tasks:



  • Check Database Integrity

  • Reorganize Index

  • Update Statistics

  • Clean Up History

  • Backup Database (Full)



11. Click the Next button.



12. On the Select Maintenance Task Order screen, click the Next button.



13. On the Define Database Check Integrity Task screen, drop the list and select
all of the SharePoint databases.



14. Check the Include Indexes box.



15. Click the Next button.



16. On the Define Reorganize Index Task screen, drop the list and select all of
the SharePoint databases.



17. Check the Compact Large Objects box.



18. Click the Next button.



19. On the Define Update Statistics Task screen, drop the list and select all of
the SharePoint databases.



20. Select the All Existing Statistics option.



21. Select the Full Scan option.



22. Click the Next button.



23. On the Define History Cleanup Task screen, click the Next button.



24. On the Define Back Up Database (Full) Task screen, drop the list and select
all of the SharePoint databases.



25. Check the box titled “Create a subdirectory for each database”.



26. Change the backup location, if desired.



27. Click the Next button.



28. On the Select Report Options screen, click Next.





Creating the Transaction Log Maintenance Plan



If this installation is not a production environment, consider changing the
recovery mode for all databases to SIMPLE using the following

ALTER DATABASE [name] SET RECOVERY SIMPLE WITH NO_WAIT



1. Open SQL Server Management Studio



2. Right click the SQL Server Agent and select Start from the context menu.



3. Expand the tree and select Management►Maintenance Plans



4. Right click the Maintenance Plans folder and select Maintenance Plan Wizard
from the context menu.



5. On the Welcome screen, click the Next button.



6. On the Select Plan Properties screen, name the plan “MOSS Log Maintenance”



7. Click the Change button



8. Under the Frequency section, Select Daily from the Occurs drop-down list



9. Under the Daily frequency section, select the Occurs Every option.



10. Set the Start Time to 9:00:00 AM.



11. Set the End Time to 5:30:00 PM



12. Click the OK button.



13. Click the Next button.



14. On the Select Maintenance Tasks screen, check Backup Database (Transaction
Log)



15. Click the Next button.



16. On the Select Maintenance Task Order screen, click the Next button.



17. On the Define Back Up Database (Transaction Log) Task screen, drop the list
and select all of the SharePoint content databases.



SSP, WSS Search and MOSS Search databases are set to simple recovery model, so
their transaction logs will not grow.



18. Check the box titled “Create a subdirectory for each database”.



19. Change the backup location, if desired.



20. Click the Next button.



21. On the Select Report Options screen, click Next.






Runaway SharePoint Logs



Another area where disk space can be used up quickly is through the SharePoint
Unified Logging Service (ULS). The ULS writes text-file logs to the LOGS folder
in the System Directory (\Program Files\Common Files\Microsoft Shared\web server
extensions\12).



Symptoms



Many large text files located in the LOGS directory



Recovery



Delete old files to regain space as necessary



Prevention





  • Throttle the logging service by opening Central Administration, clicking the
    "Operations" tab and going to "Diagnotic Logging". On the Diagnostic logging
    page, throttle the logged events by selecting a minimum level of severity for
    logging.




  • Make use of the
    LogViewer feature to examine logs. This adds a log
    viewing utility to Central Admin.






Protected Memory Errors



This error shows itself as several different errors in the Event Log all saying
that SharePoint attempted to read or write protected memory.



Symptoms



  • Event Log entries: Attempted to read or write to protected memory

  • Can’t open IIS Manager

  • Can’t make new web applications



Recovery & Prevention






IISWAMREG Admin Service Errors



Symptoms



In the Event Log, you see the following:



Type: Error

Source: DCOM

Category: None

Event ID: 10017

Description:

The application-specific permissions settings do not grant Local Activation
permission for the COM Server application with CLSID {CLSID} to the user
DomainName\UserName SID {SID}. This security permission can be modified using
the Component Services administration tool.



Recovery & Prevention




1. Click Start, click Run, type dcomcnfg in the Open box, and
then click OK.

2. Expand Component Services, expand Computers, expand My
Computer, and then click DCOM Config.

3. Right-click IIS WAMREG admin Service, and then click
Properties.

4. Click the Security tab.

5. Under Launch and Activation Permissions, click Edit.

6. In the Launch Permission dialog box, click Add.

7. In the Select Users, Computers, or Groups dialog box, type
the domain user account that you specified as the Windows SharePoint Services
3.0 service account, click Check Names, and then click OK.

8. In the Permissions for UserName list, click to select the
Allow check box that is next to Local Activation, and then click OK two times.




Here are some additional references:




http://support.microsoft.com/kb/920783




http://blogs.vertigo.com/personal/steventap/Blog/Lists/Posts/Post.aspx?ID=21






Timer Job Errors



There are two timer services in SharePoint that are responsible for running
various jobs that keep the farm healthy. If you have issues with these services,
then you may see these jobs fail.



Symptoms



  • Failed jobs in Central Admin

  • Installed solutions fail to deploy

  • Created web apps fail to create on every server



Recovery



  1. Recycle "Windows SharePoint Services Timer" and "Windows SharePoint Services
    Administration" on every server in the farm.

  2. Run stsadm -o execadmsvcjobs on every server in the
    farm



Prevention



To prevent these issues, create a batch file that periodically recycles the
services.




1. Open NotePad and add the following lines:



NET STOP "Windows SharePoint Services Timer"

NET START "Windows SharePoint Services Timer"

NET STOP "Windows SharePoint Services Administration"

NET START "Windows SharePoint Services Administration"

STSADM -o ExecAdmSvcJobs



2. Save the file as "C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\ISAPI\RecycleSharePointServiceTimer.bat"

3. Select Control Panel►Scheduled Tasks►Add Scheduled Task.

4. In the Schedule Task Wizard, click the Next button.

5. Click the Browse button and locate the file "C:\Program Files\Common
Files\Microsoft Shared\web server
extensions\12\ISAPI\RecycleSharePointServiceTimer.bat."

6. Select to perform the task daily and click the Next button.

7. Schedule the task to start at 4:00 AM Every Day and click the Next button.

8. Enter credentials for executing the task and click the Next button.

9. Check the box to open the Advanced Properties and click the Finish button.

10. Click the Schedule tab and then click the Advanced button.

11. Check the Repeat Task box.

12. Schedule the task to repeat every 4 hours.

13. Select the Time option and enter 3:00AM.

14. Click the OK button.

15. Click the OK button.






Update Conflicts



Whenever you update SharePoint system passwords, you can have issues with
SharePoint being able to access databases and run jobs.



Symptoms



In the Event Log, you see the following error:



An update conflict has occurred, and you must re-try this action. The object
SPApplicationPool Name=SharePoint Central Administration v3 Parent=SPWebService
Name=WSS_Administration is being updated by {...}, in the STSADM process, on
machine {...}. View the tracing log for more information about the
conflict.



Recovery & Prevention



Clear the File System cache on the SharePoint front end servers using this
procedure: (From
http://support.microsoft.com/kb/939308
).




1. Stop the Timer service. To do this, follow these steps:



a. Click Start, point to Administrative Tools, and then click
Services.


b. Right-click Windows SharePoint Services Timer, and then click
Stop.



2. Delete or move the contents of the following folder:

%ALLUSERSPROFILE% \Application Data\Microsoft\SharePoint\Config\GUID


3. Start the Timer service. To do this, follow these steps:



a. Click Start, point to Administrative Tools, and then click
Services.


b. Right-click Windows SharePoint Services Timer, and then click
Start.




Note The file system cache is re-created after you perform this procedure. Make
sure that you perform this procedure on all servers in the server farm on which
the Timer service is running.




Here's a great article on password changes for SharePoint:

http://blogs.msdn.com/joelo/archive/2006/08/22/712945.aspx






Performance Issues



Various performance issues like slow page loads.



Symptoms



  • Slow Page loads



Recovery



  • Reduce number/complexity of web parts

  • Evaluate lists

  • Evaluate web part architecture



Prevention



  • Control number of web parts

  • Delete unused web parts

  • List Maintenance (2000 Items, Indexed columns)

  • Avoid programming pitfalls (undisposed objects, excessive looping)

  • Enable caching



<BlobCache location="C:\blobCache"
path="\.(gifjpgpngcssjs)$" max enabled="true"
/>





Customization Errors



Symptoms



  • Generic SharePoint Error Page



Recovery



  • Add "?contents=1" to the web of the web page request to open web part management
    page. Delete offending web part

  • Restore default master page if your custom one is causing the problem.

  • Deactivate offending feature

  • Disable custom errors by editing web.config file by making the following
    changes:



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



<customErrors mode="Off" />



<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10"
TotalFileDependencies="50" AllowPageLevelTrace="false">



Prevention



  • Implement a Dev->QA->Production process






Security Errors



Symptoms



Request for the permission of type
'Microsoft.SharePoint.Security.SharePointPermission,
Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c' failed



Recovery



Adjust security policy in web.config file as follows:



<trust level="WSS_Medium"
originUrl="" />



Prevention



Implement custom security policies on all web parts. Start with Dan Larson's
blog entry on the topic.


SharePoint 2007 URL Quick List

The following is a list of SharePoint URLs to get to commonly used administrative functions on a MOSS or WSS v3 site. Not all links listed on this page are accessible to all user levels of a site. This is a quick list for speedy reference as compared to tracking down links through the admin screens or for faster jumping around sites within a site collection.

Add Web Parts Pane
url: ?ToolPaneView=2

Add to the end of the page URL; WILL ONLY WORK IF THE PAGE IS ALREADY CHECKED OUT

Create New Site Content
url: /_layouts/create.aspx

List Template Gallery
url: /_catalogs/lt

Manage Site Collection Administrators
url: /_layouts/mngsiteadmin.aspx

Manage Sites and Workspaces
url: /_layouts/mngsubwebs.aspx

Manage People
url: /_layouts/people.aspx

Manage User Permissions
url: /_layouts/user.aspx

Master Page Gallery
url: /_catalogs/masterpage
Also includes Page Layouts
Modify Navigation
/_layouts/AreaNavigationSettings.aspx

Recycle Bin
url: /_layouts/AdminRecycleBin.aspx

Site Column Gallery
url: /_layouts/mngfield.aspx

Site Content Types
url: /_layouts/mngctype.aspx

Site Content and Structure Manager
url: /_layouts/sitemanager.aspx

Site Settings
url: /_layouts/settings.aspx

Site Template Gallery
url: /_catalogs/wt

Site Usage Summary
url: url: /_layouts/SpUsageWeb.aspx

User Alerts
url: url: /_layouts/sitesubs.aspx

View All Site Content
url: /_layouts/viewlsts.aspx

Web Part Gallery
url: /_catalogs/wp

Web Part Page Maintenance
url: ?contents=1

Add to the end of the page URL
Workflows
url: /_layouts/wrkmng.aspx

Monday, October 13, 2008

Custom field type that can hold more than the 255

Many people ask me, they need to use field holds more than the 255 characters. They used MultiLine text. It worked fine with custom list but failed (generate error can't hold than 255 characters) with content type.
Many bloggers suggest to create custom field type, I tried this suggestion but gave me same result.
I found simplest solution Create Site Column of type MultiLine text, and set property UnlimitedLengthInDocumentLibrary to TRUE.
You can use tool Imtech Fields Explorer v1.5.0.0 to set this property.
download Imtech Fields Explorer v1.5.0.0