Deleting User Alerts in Sharepoint (MOSS 2007)

Setting alerts in MOSS 2007 is very easy just go to any list or library right click on Actions Tab and the last option available is the Alert Me feature. Configuring these alerts is very simple and is a child’s play but customizing the alert emails which are sent and sending list specific email alerts and stuffs like this are little bit tricky. Don’t worry here we are not discussing those horrifying issues but here we are simply going to discuss on how to delete the alerts which user has set on a particular list. There is a very simple process to do this you don’t need to write code for that but i am sharing this with you as for the novice programmer it’s a tedious task to find actually where to go to delete these alerts.

  • Just go to “Site Actions” on the top right corner of your sharepoint site and then click “Site Settings”.

 

  • Now look for the Site Administration section under that look for the User Alerts.

  • Once the User Alerts page is opened select a user for which you want to delete the alert, as you select the username from the dropdown list then all the alerts related to that user will be displayed.
  • Now you can select single or multiple alerts and click on the “Delete Selected Alert” link to delete the selected alert.

Stay tuned for more articles on Sharepoint (MOSS 2007) Happy Programming!!!!!!!!!!!!!!!!!!!


Finding and changing the default timer interval for timer jobs in Sharepoint

Many times we need to change the default timer settings either by increasing the default time or by decreasing the default time of the timer jobs for a particular sharepoint site. Particularly if you want to send an email as soon as an action is performed within the sharepoint, in such a scenario you will need to decrease the default timing of the timer job. There are two commands by which you can achieve this very easily:-

  1. Finding the default time of the timer job, the delay in sending mails could be due to the default timing of the timer jobs which is by default 5 minutes.
  2. Decreasing the default time of the timer job to 1 minute.

That’s all you need to do to adjust the default timer job timing delays. Happy Programming!!!!!!!!!!!!!!!!!


MOSS 2007 :- Editing a user profile

There are times when you need to edit the user profiles and relate some meaningful data other then the default data which the user brings from its active directory or standalone profile. For this task you need to know where exactly you can modify the user profile. This article will tell you one possible way of modifying the user profile and relating an email address to the user. 1.Open the Central Administration and from the central administration select the Shared Service Provider link.   2.In the shared service provider open the User Profiles and properties link. 3.After clicking the User Profile link you will be redirected to a page where you will find profile and import settings.On this page click on the view user profiles link, clicking on this link will take you to a page where you will find all the details related to the user, you can edit and save changes inside many of the given user related properties. 4. View User Profile will redirect you to a page where you can find all the users now you can click on any of them and as soon as you click the dropdown around them you will find options saying Edit,Delete and Manage Personal Site, now just click on Edit link to start editing the user profile. 5.Now a detailed screen will be opened for you where you can edit any of the properties among several properties which are there.You can associate work phone,title,office,department, email and many other attributes to the selected user which we are editing.   6.After making all your changes, just click on the Save and Close button at the top of the Information to save your changes. And that’s all what you need to change the user’s profile, this is one of the method to reach here there can of course be other ways to reach at the same section, i would love to know about some other ways by which you people are manipulating the user profiles. Happy Programming!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Renaming MOSS 2007 or Sharepoint Server

Many times there are situations when you have to rename a MOSS installation either in your virtual PC environment and also sometimes in production, although the production one is little uncommon but the point is a sharepoint developer at one point or other want’s to rename his sharepoint server. Renaming the server simply will screw up all the settings inside the sharepoint as many places there are hardcoded references to the previous server which has to be remapped in order to run the MOSS server with the new server name. Here in this article i will explain you the step by step process for renaming the MOSS server.There are few resources available on the net which helps you in achieving the same but it was hard for me to find a good resource, so i thought to pen it down so that it can help everyone using Sharepoint. Steps:-

  1. Change Alternate Access Mappings
  2. Run stsadm for renaming the server.
  3. Rename the server physically on windows explorer.
  4. Reboot the server
  5. Update login credentials
  6. Restart IIS
  7. Change identity references in IIS
  8. Reconfigure search index

1.Change Alternate Access Mappings This is the first and foremost step to rename the Sharepoint server.Alternate access mappings can be found at Central Administration>Operations>Alternate Access Mappings Click on the web application url and edit the url to have the new server name.This you have to do manually for every website.   2.Run stsadm for renaming the server. You have to rename the server using stsadm before actually or physically renaming the sharepoint server. The command to rename the server is “stsadm –o renameserver –newservername “[yournewservername]”   -oldservername “[youroldservername]“ ” and this is also shown in the figure below:- stsadm can be found in “C:ProgramFilesCommon FilesMicrosoft Sharedweb server extensions12bin Developers can set the path to be globally accessible for ease of using stsadm instead of navigating to the whole path.How to configure environment variables in order to get the stsadm available globally can be found here :- http://localhost/smallworkarounds/index.php/2009/07/19/sharepoint-quick-tip-add-stsadmexe-to/ 3.Rename the server physically in the windows explorer For this step just right click on the My Computer icon in the start menu and click on properties then on the Computer Name tab just click Change button and rename it to whatever new name you want to give to your sharepoint server installation. 4.Reboot the server After following all the 3 steps mentioned above just reboot your sharepoint server. 5.Update Login Credentials Updating credentials is must as sharepoint server is still mapped to the old username inside the domain and will thus cause problems.To update credentials we will again use stsadm.exe “stsadm –o updatefarmcredentials –userlogin “newservernameusername” –password “yourpassword”   6.Restart IIS IIS needs to be restarted in order to reflect the changes which we have just made in the above steps. Remember to restart the IIS using iisreset/noforce from the command prompt. 7.Changing Identity references in IIS After doing all these changes still sharepoint website’s application pools are mapped to the old username and servername which were used to install the Sharepoint inside the farm.So in order to get rid of this old server name we have to manually change the Identity references in the IIS. Remember if the identity says “Predefined” and the value is set to Network Service then there is no need to play and touch those settings, let them be like that only.     But if the Identity is configurable then you have to replace the old servername with the new servername in the username section and if you want to change the password then you have to type the password and retype it to confirm and press ok After this step almost everything is done you just have to configure search index to function properly. 8.Reconfigure Search Index After renaming the sharepoint server the search index have to be reconfigured the best possible solution is to drop the search index and rebuild it.
After doing all these changes you may still find at some places where few links are referencing your old server name and clicking those links does nothing more then giving a blank page to user saying nothing exists on the server like that which he is asking for. In such scenarios you have to use your hit and trial method and have to find the root element which is causing this trouble and definitely that would be configurable just you have to figure out which is the right spot to configure this. After doing this you might face problems with MySite which can be fixed once editing the People & Groups section of the MySite administration. At last you can navigate through various pages to check that whether your MOSS 2007 server is working or not. Disclaimer :- This article is based on my testing under my virtual environment things may vary and i advice not to test and play with your production farm sharepoint installations as this might damage your sharepoint server. Happy Programming !!!!!!!!!!!!!!!!!!


Integrating Silverlight 2.0 with Sharepoint MOSS2007

Silverlight is a revolutionary technology and its much in demand these days,Sharepoint is an old player but very extensive and offer a lot of features which make it alluring for medium to large enterprise. Sharepoint already provide a lot of out-of the box features but as silverlight is catching up every now and then you will have a requirement from the client to integrate silverlight with sharepoint. So in this article i will tell you how to integrate silverlight with sharepoint.Although there can be various ways of doing so i m following the webparts approach as it seems simple to me there are other simple approaches in which we can add a contentweb part in which we can give the source of the iframe as an hosted xap on silverlight live streaming server’s but being a developer this approach seems to me a little creepy and also there are very few resources which clearly tell how to integrate silverlight 2.0 into Sharepoint or MOSS2007.

  1. Create a silverlight 2.0 application and copy the xap and project .dll file in a separate folder.
  2. Configure MIME Types on the sharepoint server to accept .xap,.xaml,.xbap file extensions.
  3. Change the web.config of the application or website where you want silverlight to be integrated.
  4. On the sharepoint server create a WebPart project.
  5. Copy the resources i.e xap and the project dll file in the directory specified in the web part project silverlightcontrol source
  6. Deploy the webpart project to the required site where you want silverlight to show up.
  7. Edit the page where you want to add the silverlight control and click add webpart and you are done.

 

  1. Create Silverlight 2.0 application
    • Create a silverlight 2.0 application and build that solution and copy and past its xap file and the project dll file into another folder whose content we will copy later into the wwwroot and website name of the sharepoint site where we want to deploy this silverlight application.
  2. Configure MIME types in IIS on the sharepoint server
    • If you don’t have mime types configured on your iis server on the machine where you have your sharepoint installed, then first step is to configure the mime types on the IIS.
    • For IIS 6 you can either right click on whole of the website section or on specific website where you want the mime types to be configured.After right clicking go to the http header section from there select the mime types.

    • After selecting mime types click on new if the silverlight mime types are not present.

    • Add all the three mime types shown in the above figure and then click ok.Now your IIS is configured to accept and render xaml, xap and xbap

3.Change the web.config file of the sharepoint website for which you want to integrate silverlight.

    • This is very important step because if you leave this step in between even if you do all other things correctly then also nothing will get rendered in the final webpart when you deploy the webpart and include it on your page.
    • So we have to follow a little hacky approach in order to get the configuration file correct.
    • So first step is open your visual studio and create a new asp.net 2.0 application

    • We are creating asp.net 2.0 application because sharepoint is using mostly asp.net 2.0 references and it’s not having any web.config enteries related to silverlight and ajax features of the 3.5 framework.
    • It is recommended to make a copy of the web.config so that if any error occurs you can restore the original version.
    • Now we should open the web.config of the sharepoint website in the same solution.web.config of the sharepoint website can be found at “c:inetpubwwwrootwssVirtualDirecotriesyourwebsitenameweb.config”
    • Open this web.config and copy and paste the content in the original asp.net 2.0 web application web.config.
    • Now right click on the web project and click properties and change the target framework to .net framework 3.5 and then save the web.config file for the sharepoint website.

    • Now you have to add the following two entries in your web.config, first one is in the <system.web><compilation><assemblies> section add the below line
<add assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    • Next entry to be added is in the <system.web><pages><controls> section just add the line as given below
<add tagPrefix="asp" namespace="System.Web.UI.SilverlightControls" assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    • After adding these two entries just save the web.config file and you are done with the web.config changes.

4.Create a webpart project on the sharepoint server

    • For creating a web part project in Visual Studio 2008 you need to install  “Windows SharePoint Services 3.0 Tools: Visual Studio 2008 Extensions, Version 1.2” which can be downloaded from here
    • After installing WSS3.0 tools Visual studio extensions you will have a new Sharepoint project type in C# section,from there choose webpart project and give your project some name.

    • Delete the default webpart folder which will be created and click on the add new item and then select webpart from the list.

    • Add two references to this project one is System.Web.Extensions and the other one is System.Web.Silverlight

 

    • In the yourwebpartname.cs file make changes so that it should look similar in code as given below
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.SilverlightControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

namespace TangramWP
{
    [Guid("6b31932f-7245-4d78-912c-56033008e775")]
    public class TangramSilverlightWP : System.Web.UI.WebControls.WebParts.WebPart
    {
        private Silverlight silverlightControl = null;
        public TangramSilverlightWP()
        {
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
            if(scriptManager==null)
            {
                scriptManager = new ScriptManager();
                this.Controls.AddAt(0,scriptManager);
            }
        }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            silverlightControl = new Silverlight();
            silverlightControl.ID = "TangramSilverlight";
            silverlightControl.Source = "/Bin/Tangram.xap";
            silverlightControl.Width = new Unit(500);
            silverlightControl.Height = new Unit(400);
            Controls.Add(silverlightControl);
        }
    }
}

5.Copy resources such as xap and the project dll inside the specified location inside the sharepoint website.

    • Now in the bin directory of your sharepoint website just copy your .xap file and the silverlight application which is in my case Tangram.dll.

6.Deploy the web part solution created

    • Right click on the solution and click properties in the debug section just change the “Start Browser with url” with the location of your sharepoint website.

    • Right click on the webpart solution which you have created and just click deploy to deploy the solution to the sharepoint website.

    • After successful deployment click on the edit page section in the site actions of your website and select the web part which you just deployed its generally in the miscellaneous section.

If all goes well and you have followed each step you will see the silverlight application rendered in your webpart.

Happy Programming!!!!!!!!!!!!!!!!!!!!


Sharepoint Quick Tip:- Add stsadm.exe to your environment variables to execute it from anywhere

This is a very small but tremendously useful tip for the beginners of WSS 3.0 or MOSS 2007.Especially when you are using the free version WSS 3.0 many times you need to use this command line utility call stsadm.exe. As you need it many times every time you need to navigate to its directory which is “C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12bin” So as a quick workaround what you can do to save your time is to set this path in environment variables section. Just right click on your MyComputer and select Properties   In the advanced section select environment variables and then below select the path.In the path put semi-colon after the last entry and add one more path as c:Program FilesCommon FilesMicrosoft Sharedweb server extensions12bin. After doing this just click OK and you are done. Now you can run stsadm.exe from anywhere in the command prompt as it’s available globally as an environment variable. This tip is meant for a sharepoint newbie.


Opening Sharepoint Sites in Firefox:-Firefox always asks for credentials

If you are working on Sharepoint and your sharepoint sites always asks for credentials in Firefox then there are two workarounds which you can do.There can be others but the below mentioned two workarounds are most efficient. 1.Using IE Tabs plugin in Mozilla Firefox You can download IE Tabs plugin from here https://addons.mozilla.org/en-US/firefox/addon/1419 This plugin will simulate the behaviour of Internet Explorer Tabs inside Mozilla Firefox.And if your sharepoint site is correctly configured to run in IE then after opening it with IE Tab it will work fine in Mozilla Firefox also.   2.Change the network.automatic-ntlm-auth.trusted-uris entry in the about:config in Firefox Just go to the address bar in firefox and type about:config.Now a configuration file will be opened for you, now here search for the entry named as "network.automatic-ntlm-auth.trusted-uris" Double click this entry and enter the name of your webserver or the server for which you want firefox to inherit the ntlm credentials. If you are working locally and have configured your Sharepoint Server also locally then generally adding localhost,Your computer name will do.You can enter comma separated lists for all the sites for which you want firefox to inherit automatic NTLM credentials. After this step just press ok and refresh your page you will find that now your sharepoint sites can run equally well in firefox also.   If you are facing the same problems in IE 7 then you can read this article to fix the problems http://localhost/smallworkarounds/index.php/2008/10/25/internet-explorer-always-ask-for/


Internet Explorer always ask for password for my Sharepoint Site.........is this causing havoc

  1. Although When you install Sharepoint it by default configures all the settings to be used with Internet Explorer, but sometimes it may happen that when you installed sharepoint server at that time you were having IE6 or some other version and now you want to switch to some other version.
  2. Now when you install this new version every setting made by Sharepoint is gone  and if you open your sharepoint website in the browser it always asks for the credentials
  3. So what you have to do is follow these simple steps to again configure Sharepoint Sites to run smoothly with you IE browser
  4. Now in Internet Options go to Local Intranet and make the security lever for this zone to low
  5. Then click on the sites tab

 

Now click on the advanced tab   Here in advanced settings make sure that you sharepoint site is included,and if not than just write the url of your site and press add and then close and then press OK     Now you sharepoint site should work fine in IE7 or others If you still have some queries than do leave a comment. There is also another article on how to configure and install sharepoint http://localhost/smallworkarounds/index.php/2008/10/24/share-point-series-basic-sharepoin/


Share Point Series:- Basic Sharepoint Installations And Configurations Part1

This is the first article in the series of Sharepoint articles, a lot of stuff will be coming in next few months. Here in this first article i will just talk about simple steps to follow to install Microsoft Office Sharepoint Server 2007 on Windows Server 2003. It will refer MOSS 2007 to Sharepoint Server from now on. It should be made clear in early phase of this article series that Sharepoint Server can only be installed on Windows Server Installations it cant be installed on Windows XP and Windows Vista Installations. Installing Sharepoint Server

  1. Just follow this useful link already present on MSDN to install Sharepoint Server.I will not rewrite the whole thing but i will discuss where ever required and some problems i faced and their solutions.
  2. http://technet.microsoft.com/en-us/library/cc263202(printer).aspx
  3. As satated at last in the above article when the installation finishes than you have to click next and then it will ask you for the configurations,so you can just click next and start the configurations.
  4. If you install the standalone install with all basic settings it basically performs 10 diffrent basic configuration tasks and these tasks may take time so be patient.
  5. If everythings goes on smoothly after sometime it will say configuration completed successfully.
  6. Now at this stage we are ready to test our first sharepoint site.     
  7. If this is the scenario with your system than probably you might be running something else on your port 80 such as your Source Controls Server Such as SVN or Source Vault.
  8. So first you have to stop those or configure them on another port to work in synchronization with Sharepoint Server.
  9. If you are using SVN than you just have to stop the Default running apache server which is uses by default and configures it to use port 80.
  10. Make sure if you have made the default install of Sharepoint Server than no other thing is running on port 80 or your default Sharepoint website will not run.