Wednesday, June 29, 2011

How to Change the Site Logo in SharePoint


What you will need:
  • A small version of your logo – preferably no taller than 60 pixels.
    • Use a transparent background when possible, so the image looks great under multiple site color themes.
  • A URL location to this logo – either by uploading it to a document library, an external site, or the “14 hive” on the file system.
    • If you select the file system within the “14 hive” (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES), then you will need to copy the image to this location on each front-end web server in the SharePoint farm.
>Click “Title, description, and icon” under the Look and Feel section on the Site Settings page:



Enter your logo URL location and a description – you can even click to test the URL to see if the address works:
**NOTE** If you added the image to the “14 hive” on the file system, then the URL location would be “/_layouts/images/yourlogo.gif” (without quotes).

Click Ok and you will be taken back to the Site Settings page where you should now see your logo displayed in the top of the site!

Where Workflow History is saved in SharePoint site

Siteurl/ Lists/Workflow%20History/AllItems.aspx

Siteurl is your root site name ex- http://win2008:6767/Lists/Workflow%20History/AllItems.aspx
Workflow history is saved at following path

Configure State Service in Sharepoint 2010

When you get error like  Form not rendered due to misconfiguration of State Service
By using PowerShel cmdlets you are able to start the state service on for your web application.
$stateName = “State Service”
$stateDBName = “StateServiceDB”
$stateDB = New-SPStateServiceDatabase -Name $stateDBName
$state = New-SPStateServiceApplication -Name $stateName -Database $stateDB

New-SPStateServiceApplicationProxy -Name “$stateName Proxy” -ServiceApplication $state –DefaultProxyGroup
If you already have state service configured check that
State Service and State service proxy both should have started.

If State Service and State service proxy both are not started.
Do below steps -
Goto Application Management->Manage Service application

Select State Service and delete it as shown above.
Then again run command in powershell with administrative permission.
$stateName = “State Service”
$stateDBName = “StateServiceDB”
$stateDB = New-SPStateServiceDatabase -Name $stateDBName
$state = New-SPStateServiceApplication -Name $stateName -Database $stateDB

New-SPStateServiceApplicationProxy -Name “$stateName Proxy” -ServiceApplication $state –DefaultProxyGroup
Now check in Application Management->Manage Service application
State Service and State service proxy both should have started.

How to Configure SMTP for Incoming and Outgoing Email in Sharepoint

Goto Administrative Tools->Server Manager
1.     Verify that you have the following administrative credentials: You must be a member of the Administrators group on the local computer
2.     Click Start, point to Administrative Tools, and then click Server Manager.
3.     In Server Manager, click Features.
4.     In Features Summary, click Add Features to open the Add Features Wizard.
5.     On the Select Features page, select SMTP Server.
6.     In the Add Features Wizard dialog box, click Add Required Features, and then click Next.
7.     On the Confirm Installation Selections page, click Install.
8.     On the Installation Results page, ensure that the installation is complete, and then click Close.
Below screen will appear



To set the SMTP service to start automatically

1.     Click Start, point to Administrative Tools, and then click Services.
2.     In Services, right-click Simple Mail Transfer Protocol (SMTP), and then select Properties.
3.     In the Simple Mail Transfer Protocol (SMTP) Properties dialog box, on the General tab, in the Startup type list, select Automatic.
4.     Click OK.

Configure outgoing e-mail from Central Administrator

1.     Verify that you have the following administrative credentials: You must be a member of the Farm Administrators group on the computer that is running the SharePoint Central Administration Web site.
2.     In Central Administration, click System Settings.
3.     On the System Settings page, in the E-Mail and Text Messages (SMS) section, click Configure outgoing e-mail settings.
4.     On the Outgoing E-Mail Settings page, in the Mail Settings section, type the SMTP server name for outgoing e-mail (for example, mail.example.com) in the Outbound SMTP server box.
5.     In the From address box, type the e-mail address as you want it to be displayed to e-mail recipients.
6.     In the Reply-to address box, type the e-mail address to which you want e-mail recipients to reply.
7.     In the Character set list, select the character set that is appropriate for your language.
8.     Click OK.
Select Yes option radio button for Enable Incoming Email in screenshot above and click ok.
Now finally check for Emails working.

Deploying Webpart in Sharepoint

>if webpart not shown in site then we need to check the url while deployement from Visual Studio
>If it gives some Guid error then clean and again deploy.
>If it doesn’t solve problem then go to Task manager as below and delete vssphost4.exe.
>And again deploy.
·                 Go to Central Administration->System Settings->Farm Management ->
        Manage farm solutions

This should display web part deployed.
We can deploy web part to two web application from here by clicking on web part and selecting application to deploy.


Create Timer Job in Sharepoint

1. Create empty SharePoint project
2. Create class inherits from the Microsoft.SharePoint.Administration.SPJobDefinition
3. To implement this class, you need to create a few constructors and override the Execute() method as following
4. Right click on the Features >Add Feature
5. Right click on the Feature1 ” you can rename the Feature1 to any name” > Add Event Receiver
6. But we need FeatureActivated & FeatureDeactivated event handler to install/uninstall our custom timer job .
7.Before Deploying you should select the right scope of the Feature in other words in which scope you will activate the Feature(Farm,Site,Web,WebApplication) in our case we will activate Feature1 on Site which is mean Central Site Collection.
8. Take care that SPContext is not used anywhere in this project. Before deploying,
10. Now let us deploy our custom timer job >Right Click on Custom_TimerJob project > Click Deploy
11. Open now your SharePoint site -in job timer we will see our deployed job.
12. if deploy succeeded We should be able to see timer job in central site under job definitions.
13. set this timer job for specific time now.

How to Debug Timer job if problem occurs –

As scheduler is set to specific time for application to run, we can debug it when it runs
Debugging In Visual Studio
Set a breakpoint in your timer job code, and then open the "Attach to Process" dialog from the Debug menu. Check the box at the bottom of the dialog titled "Show Processes from All User", and select OWSTIMER.EXE from the list of available processes. Click the Attach button.....Now click Debug to run application.
Triggering the Job
Now you just need to trigger your timer job. One suggestion for this is to modify the schedule of the job to occur frequently

Sharepoint 2010 - Task/Job Scheduler


TASK SCHEDULER-

Ø  Create file to run in Task Scheduler
Ø  Debug Task Scheduler
Ø  Schedule Task scheduler to run at specific time.
Below are points showing this-

Create file to run in Task Scheduler

Step 1: Add new project-> class library
Step2: Choose output type as console application and Target Framework as .Net framework 3.5.
Step3: Rename Class.cs as Program.cs..
Step4: add reference as Sharepoint.dll and add using Microsoft. SharePoint in file
Step 5: All methods and variables should be static

How to Debug Task Scheduler

Just select project as “Set as start project”, we can directly run project by clicking Debug.

Set Task scheduler/Job scheduler

Go to -> C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\System Tools\Scheduled Tasks
Or
Go to -> Administrative Tools/Task scheduler
>Right click on Task scheduler library and click Create Task, below window will appear.
>Add name and choose “Run whether user is logged on or not” and then select Triggers tab
         


>Select date to schedule job and select Actions tab     


>Click browse and in project application go to bin->debug->choose (filename).exe file as shown below.

>Click ok it will ask for username and password, enter that and select ok.