Wednesday, 28 November 2012

Is it possible to hide "add new announcement item" for the announcement webpart?

If you want to hide this link for all people who see the site, you should go to the webpart properties, and set the "Toolbar type" combo box to "No toolbar".


Enjoy !

Friday, 16 November 2012

Attach/Add an existing Content Database to a sharepoint Webapplication

Scenario: you have the content database from the same server or from your production MSSQL server. Now you want to attach this content database and use it. There are few ways to do that:
1) database attach using SP CA
let's assume that the content database you want to attach has the name 'WSS_Content_New'. You already have a webapplication. Open SP CA-->application management-->content databases-->select the right webapplication --> see the attached content database-->select it-->from drop down select 'offline'--> also check mark-->remove content database--> click ok on the pop-up warning message. [Do not be scared with the pop-up message as the database will still remain in the SQL-DB and can be used in future if needed]-->now come back to manage content databases page and you will see that no more databases are associated with this webapplication-->click on the add a new content database--> in content database text box there will be wss_content_somerandomGUID remove that and type wss_content_new-->ok and now the database is attached. and you should be able to navigate to the webapplication and it will show you the site which resides in the attached content database.
    $ The above process is easy but I encountered the following error:
"The attach operation cannot continue because another object in this farm already contains the same ID. Each object in a farm must have a unique ID. In order to proceed with the attach operation you must assign a new ID to this database. To attach this database with a new ID, use the "stsadm.exe -o addcontentdb" operation with the -assignnewdatabaseid parameter. Note that if this new database and an existing database contain the same site collections, attaching this database will likely result in orphaned site collections due to conflicts between the two databases. "
    $ As the error mentions you can use the stsadm command which we will discuss later
    $ The possible cause for this error is - it's already being used by another webapplication. Check for every webapplication and its associated content database to make sure that this content database is not already being used by any other webapplication and try again.
2) using stsadm command:
stsadm -o addcontentdb -url http://server:port/ -databasename WSS_Content_New -assignnewdatabaseid
(If you happen to get the above stated error then only u need to use -assignnewdatabaseid parameter)
3) creating a new webbapp
open SPCA-->create or extend a webapplication-->create a new webapplication--> in content database text box there will be wss_content_somerandomGUID remove that and type wss_content_new-->fill-out other details-->click ok
    $ After performing all the above stated steps correctly, if you still get 404 webpage not found error, it may be possible that the content database does not have any sites. To check that navigate to the manage content database page-->select the appropriate webapp and see the content database' sites column if it says 0 you cannot see the site when you try to navigate. You can of-course create the new site in the new content database.
how to check?
navigate to the site and you will see the site.
BENEFIT: This is a part of the SharePoint backup and recovery using database attach and detach method. You can use this method to attach a moss 2007 content database to the MOSS 2010 webapplication and have a new look and feel!!!

Thursday, 15 November 2012

Import\ Export SharePoint Subsite Using Powershell

Import\ Export  SharePoint Subsite Using Powershell



Run PowerShell as Administrator.

Export Subsite:

export-spweb -identity http://mysite/mysubsite  -path D:\subsitebackup\mysubsitebackup.cmp

 Import Subsite:

import-spweb -identity http://mysite/mysubsite  -path D:\subsitebackup\mysubsitebackup.cmp

Note:

To use import or export subsite command in power shall both source and destination template should be same.



Tuesday, 6 November 2012

The Three-State Workflow - The Out-Of-The-Box Workflow for Both WSS and MOSS


Many people believe that MOSS comes with only four out-of-the-box workflows (Approval, Collect Feedback, Collect Signatures, and Disposition Approval), and that WSS v3 doesn't come with any out-of-the-box workflows. In actuality, there is another work flow that is available out-of-the-box to both WSS v3 and MOSS—it's called the Three-state workflow.

The reason that even many seasoned SharePoint professionals don't know much about the Three-state workflow is because the feature isn't activated by default—you will have to go into the Site collection features, and activate it


 Once you have activated the Three-state workflow feature, it will be available as a workflow template to all your lists, libraries, and content types.



The Three-state workflow allows you to track the status of an item between three states. This is very useful when tracking issues, project tasks, leads, or other similar items.
I won't bore you with details on how to use it; Microsoft has already done an excellent job of explaining how to use the Three-state Workflow. My mission here is just to let you know that it exists. I will leave you with one small screenshot though, just to whet your appetite. Look at all the options you have for the task and email details for each transition step.

Hope it will help you.  :)

Display names show as DOMAIN\UserName instead of FullName in SharePoint 2010


To overcome the User Profile Synchronization service issue as Display names show as DOMAIN\UserName instead of FullName in SharePoint 2010

In my previous blog i have explained the step by step process that "How to remove DomainName form user display name". But in this blog you can find the step by step process for SharePoint 2010
  • Open the PowerShell
  • cmd for one user
    •  Set-SPUser -Identity ‘ChandanKumar’ -DisplayName ‘Chandan Kumar’ –Web http://myintranetsite.com
  • cmd for all users 
    • Get-SPUser –Web http://myintranetsite.com | Set-SPUser –SyncFromAD
Below are few point to consider:-
  • When using –SyncFromAD switch, make sure that the Display Name field is set correctly in User Properties of Active Directory.
  • This is not an ideal solution if you are frequently adding new users and changing the user properties in AD. Tho you can schedule the above in Task Scheduler as per your requirement.
  • The above will not fix the Display Name for all Web Application in your farm, you will need to run the above command separately for all sites or create a script for the same or you can setup the User Profile Synchronization Service.
 
 Hope this will help .
 

UserName showing up as DomainName\UserName instead of Full Name in SharePoint 2007


I have seen a lot of people facing a problem in SharePoint 2007, where the UserName is displayed as DomainName\UserName instead of its Full Name. As a solution a lot of people are suggesting to setup the User Profile Synchronization service,



·         Navigate to Central Administration page (start > administrative tools > SharePoint 3.0 Central administration)
·         Select your Shared Service provider
·         Select user profiles and properties link
·         Select view user profile link
·         Find the account of the user and select edit
·         Make sure the Name field contains the name you like to be displayed rather than domain\username
·         Give it about 30min and test it out
Hope this will help all of you. :)

Wednesday, 17 October 2012

Using out-of-the-box ways to get Email into SharePoint

Bellow are the implications on how easy is it to access the saved email and how much of the email (including it’s attributes) can be accessed after it has been transferred to SharePoint.



1. Manually Save an email message to SharePoint
Process
Treat the email as a file just like any other file that you would upload to SharePoint.
  • In Outlook open an email then select File | Save As…
  • Choose a format from the ‘Save as type’ drop down. I recommend saving it in Outlook Message Format (.msg)

  • Save the email (msg file) to a local drive
  • Now browse to the SharePoint list/library through the web browser and upload the file through the native SharePoint UI.
Pros
  • Upload occurs through native SharePoint UI so you will have the opportunity to set content type, enter/select column values, apply validation, trigger custom event handlers etc
  • The email is stored in msg format so it can be opened back up in Outlook without loss of data or email integrity.
  • You are left with the item open in the SharePoint UI so you can continue working on it (e.g. start a workflow)
Cons
  • Very time consuming and laborious
  • The entire process has to be repeated for each email, can’t do multiple at once
  • No email attributes get prompted to SharePoint columns
2. Email enable a SharePoint List or Library
Process
Selected SharePoint lists & libraries can be enabled to receive incoming email on an email address that is unique to the list/library. Users can then include the email address of the SharePoint list with the recipients of an email to have the email stored in SharePoint.
Great post from Joel Olsen for more detail on email enabled lists/libraries (SP2007)http://blogs.msdn.com/b/joelo/archive/2007/10/23/email-enabled-lists-and-inbound-email.aspx
Pros
  • Quick and simple method for the user to get the email into SharePoint
  • From a governance point of view only selected lists/libraries can be configured to accept incoming email
Cons
  • Considerable administration overhead to initially setup and configure
  • Users have to know which email addresses correspond to which lists/libraries
  • Constant admin overhead to enable new lists/libraries and setup email addresses and broadcast out to the user base
  • No email attributes get prompted to SharePoint columns
  • Attachments and email are stored as separate items in SharePoint
  • User cannot get the original email into SharePoint after the fact. That is, if a user receives an email they can forward it to the SharePoint list but it is the forwarded email that gets stored, not the original email as it was received by the user.
  • Email is stored in .eml format so it cannot be easily opened back up in Outlook and viewed/worked on with full integrity
  • At the time of writing, email enabled lists/libraries are not supported in BPOS or Office 365 / SharePoint Online
Further reading
Configure incoming e-mail (SharePoint Server 2010)
Configuring incoming email in SharePoint 2010 with Exchange – Step by Step Guide
Enable and configure e-mail support for a list or library (SharePoint 2007/WSS 3.0)
3. Map a drive to a SharePoint Library
Process
It’s possible to map a network drive (or create a shortcut to a network location) to provide access to the content of a SharePoint library in Windows Explorer much like it is just another directory structure on a file server.
For example, I have a library located at http://vs-server82/subsite/Email

I can map a drive to \\vs-server82\subsite1\email
You can also just bring up the run command and enter the location in directly \\vs-server82\subsite1\email
Either of these techniques should result in Windows Explorer displaying the contents of the library

You can now drag and drop email messages from Outlook into the Windows Explorer window and the files will be saved to SharePoint.

Pros
  • If you are trying to do a simplistic transfer of multiple emails from Outlook to a single SharePoint library with no setting of SharePoint column values than this might be sufficient. I’d see it more as an ad-hoc or one-off technique to get you out of trouble rather than a technique to rely on day-in-day out.
  • Email is saved in .msg format
Cons
  • Only works for libraries (you can see lists, but due to the way list items and there attachments are stored it’s not really useable)
  • Provides a very rudimentary interface to SharePoint and you may encounter problems with SharePoint specific functionality in some libraries (such as check in, check out, validation)
  • No SharePoint column values set
  • I’ve come across several discussion threads that warn against modifying SharePoint content accessed through this technique (see further reading links below)
  • Allowing (or promoting the use of this technique) may circumvent controls that have been put in place in SharePoint for data validation and document management
Further reading
4. Use the SharePoint WebDav View
Process
In the SharePoint 2010 Library ribbon there is an option to ’Open with Explorer’.

This will open Window Explorer and display the contents of the current SharePoint library in an almost identical way the the previous technique of using a mapped drive. Again you can drag and drop email from Outlook into the Explorer Window.
Pros
  • Similar to the previous technique but I would recommend this over the previous technique as it is using the WebDav standard for communicating with SharePoint
  • Email saved in .msg format
Cons
  • WebDav only goes so far, it’s a standard that existed long before SharePoint so as you would expect it only supports a very basic subset of SharePoint functionality
  • No SharePoint column values set
  • Known issues in an environment with a load balancer
  • Allowing (or promoting the use of this technique) may circumvent controls that have been put in place in SharePoint for data validation and document management
Further reading
5. Use a Discussion Forum
Process
It is possible to connect a SharePoint discussion board to Outlook to obtain the ability to drag/drop email to the discussion board.
    • Ensure incoming email is enabled on your farm
    • Create a discussion board in SharePoint

  • From within SharePoint, open the discussion board you just created and click on Connect to Outlook in the ribbon.

  • The discussion board will now appear in Outlook under ‘SharePoint Lists’

    • You can now drag and drop emails to the discussion board from within Outlook, and they will be copied across to SharePoint
    • You can view the contents of the discussion in Outlook (emails are converted to posts). One gotcha is that if you have automatic signatures setup then the post that is created will have your signature added to it (just as though you forwarded the original email) – see screenshot below. I’m sure with some tinkering you could probably come up with a solution for this.

Pros
  • Simple drag/drop method for the user to get the email into SharePoint
  • User self-service (not ongoing administration required to setup/maintain)
  • Discussion board content visible from Outlook or SharePoint
Cons
  • Email is not stored in .msg file format
  • No SharePoint column values set
  • Integrity of the email message is not preserved (that is you can never open it back up in Outlook as an email)
Further reading