General Bloging

Development and Stuff

About the author

Author Name is someone.
E-mail me Send mail

Recent posts

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Adding menu item to single list

Creating Menu Item for a Specific List/Document Library Template

Recently I needed to add a special upload function to a custom Document Library definition that I created. In MOSS creating a custom Document Library/List definition is 20 times more intuitive and easy than in the previous version of SharePoint. So what to do? First, you open the features directory underneath the 12 hive (c:\program files\common files\microsoft shared\web server extensions\12\template\FEATURES). Create a copy of the list or document library feature that you would like to modify. Why create a copy? In my case I needed the new menu item to only be available for my new custom library, not in all document libraries. Our next step is to rename the folder of the feature we just copied to something that mnemonically represents the type of feature we are creating. Next, open the feature.xml file in our feature folder. Then, we need to generate a unique GUID for our new feature. You can generate a GUID inside of Visual Studio or go to the web and there is one on Microsoft's site. Or if your lazy like me type GUID generator in your friendly neighborhood Google search box and you will get plenty of web pages that will generate one for you. Under the Feature ID put your new GUID in place of the existing one. Ok, close the feature.xml were ready to open the next xml file. Our next step is to open the list templates folder and change the list template type number (the first element under the elements node in the file we just opened) from its current number to a new number. Now, if you read Microsoft's example on the technet website they use the number 20, don't do this. This inside word I have received was to use a number greater than 10,000 for your list template type such as 10009. Ok edit the rest of the obvious things like the display name, the description, and even add in a custom icon to show up next to the list/document library type on the create page. Ok we're ready to add our new menu item to our custom feature. We now need to add a CustomAction node inside of the elements node below the listtemplate area. The custom action is what is used to create our new menu item.

<CustomAction Id="MyCustomMenuAction"    

Creates a name for our new custom action

RegistrationType="List"

Sets the type of item this custom action will affect. Other possibilities are ContentType, FileType, ProgId

RegistrationId="10009"

KEY! This says only show this custom action in list templates of type 10009, therefore not everything!

GroupId="UploadMenu"

Sets the group which the new menu item will show up in. Other possibilities are any CustomActionGroup that you have defined, ActionsMenu, etc.

Location="Microsoft.SharePoint.StandardMenu"

The location in which the custom action will be made available. In this case it will be on the standard menu within lists/document libraries. Other options are EditControlBlock, NewFormToolBar, DisplayFormToolBar, EditFormToolBar

Sequence="1001

Specifies the sequence in which this new control will be displayed on the menu referenced by the groupID.

Title="Custom Upload Item"

Title of action the user will see on the menu.

ImageUrl="/_layouts/images/custom/CustomMenuItemIcon.jpg"

Specifies the icon associated with this menu item.

Description="Create a custom action in the upload menu.">

Description text that will go below the title of this action.

<UrlAction Url="/_layouts/myCustomPage.aspx?listName={ListId}"/>

The {ListId} token passes the internal unique identifier GUID for the list in the query string so you can know which list you came from. Other possibilities are {SiteId}.

</CustomAction>

 

 

A complete list of all of the attributes, some of the possible values, and purpose available within the customaction's node please visit http://msdn2.microsoft.com/en-us/library/ms460194.aspx.

Save all our changes and were ready to deploy.

Open a command prompt and navigate to the bin directory of the 12 hive ( address listed above 12\bin). In the command prompt type
stsadm.exe –o installfeature –name MyListTemplateFolderName\feature.xml –force
stsadm.exe –o activatefeature –name MyListTemplateFolderName –url http://SharepointSite/SiteCollectionName -force

So what are those steps again in an easy to follow guide that are not filled with my fluff and tangents?

  1. Copy the default document library Feature Folder and renamed it.
  2. Change the feature ID under Feature.XML to a unique guid <Feature Id="29AFAA71-E117-4E80-AA17-D0C71B360233"
  3. Open the listTemplates folder and edit the DocumentLibrary.xml
    1. Change the Type="101" to a number greater than 10,000.
    2. Change the display name
    3. Change the description
  4. Add a custom action block underneath the list template element in the elements node.
    1. <CustomAction Id="MyCustomMenuAction"

      RegistrationType="List"
       RegistrationId="10009"
        GroupId="UploadMenu"
      Location="Microsoft.SharePoint.StandardMenu"
      Sequence="1001"
      Title="Custom Upload Item"
      ImageUrl="/_layouts/images/custom/CustomMenuItemIcon.jpg"
      Description="Create a custom action in the upload menu.">
      <UrlAction Url="/_layouts/myCustomPage.aspx?listName={ListId}"/>
      </CustomAction>

    2. Now set the Registration ID to the number you set as the type in the listTemplate node (10009)
  5. Deploy the feature now with stsadm.exe
  6. Activate the feature with stsadm.exe


Finally, if you would like to create new menu items and apply them to existing libraries, menus, lists, or administration areas you can do this by simply creating a feature that does not include a list template. To do so, create a folder in the features folder of the 12 hive. In the new folder create text file and name it feature.xml (MUST BE CALLED FEATURE.XML). Insert our xml into page.

<?xml version="1.0" encoding="utf-8"?>

<Feature Id="InsertUniqueGUIDHERE"

Title="OZ Document Management Library"

Description="This Feature adds a new menu item to the upload menu "

Version="1.0.0.0"

Scope="Web"

Hidden="TRUE"

ActivateOnDefault="FALSE"

DefaultResourceFile="core"

xmlns="http://schemas.microsoft.com/sharepoint/">

<ElementManifests>

<ElementManifest Location="MenuItem.xml" />

</ElementManifests>

</Feature>

 

Now create another text file, call it MenuItem.xml, and insert elements node with our custom action inside of it

 

 

<?xml version="1.0" encoding="utf-8" ?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<!—This custom action adds the menu item to all Document Libraries (type=101) -->

<CustomAction Id="MyCustomMenuAction"

RegistrationType="List"
 RegistrationId="101"
  GroupId="UploadMenu"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="1001"
Title="Custom Upload Item"
ImageUrl="/_layouts/images/custom/CustomMenuItemIcon.jpg"
Description="Create a custom action in the upload menu.">
<UrlAction Url="/_layouts/myCustomPage.aspx?listName={ListId}"/>
</CustomAction>

</Elements>

 

Hope this post has been helpful. IT took up about half of my flight from Houston to Fort Lauderdale to write, so mission accomplished. I was entertained and hopefully you are enlightened.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Monday, July 21, 2008 9:55 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Setting up sharepoint 2007

How to install SharePoint Server 2007 on a single machine

One of my first ever blog articles (and by far most popular to date) was a set of instructions on how to install Beta1 of SharePoint Server 2007 on a single machine. I removed this article because it was too much of an overhead updating it with the various Betas and the official guides were being developed. Now that SharePoint is RTM, I do still get a lot of questions from customers on how to do a simple installation of SharePoint (with SQL 2005) on a single machine to be used for a stand-alone development, demonstration or simple 'play-pen' server (normally on a virtual machine). This guide will outline all of the main steps to setup such an environment.

Please bear in mind that this is just an unofficial guide to getting SharePoint 2007 installed quickly and easily in a demo / test environment. This guide will not necessarily observe best practices with regard to security etc. For production setups, you should seek guidance from the official documentation which is available on TechNet (http://technet2.microsoft.com/Office/en-us/library/3e3b8737-c6a3-4e2c-a35f-f0095d952b781033.mspx?mfr=true).

Pre-Install

There are several things that you must do before you even insert the SharePoint 2007 CD they are:

  • Install Windows 2003 R2 with the latest service pack (2 at time of writing) and all of the latest Windows Updates.

NOTE: Please do not use NewSID to change the SID of the machine if you are using a copy of another VM, this breaks things in SharePoint. My advice is to build Windows from fresh or to use Sysprep if you are using a copy of a VM.

  • Join your machine to a domain or create a domain by running DCPromo.exe from the Start > Run dialog.
  • Install the .net frameworks v3.0 and v2.0 from Windows Update. You can also download the full redistributable packages if your server is not online.
  • Install Windows 'Application Server' from Add/Remove Programs in Control Panel with default settings
  • Prepare a service account in your active directory domain to use for all Sharepoint services.

NOTE: Do not use the main domain\administrator account. This causes a problem if ever you wish to install Project Server 2007 on the same machine.

  • Give your service account local administrator rights and logon as this account throughout the entire installation process.
  • Install SQL 2005 (and latest service pack) with typical settings.
  • Assign your service account to the 'Security Administrators' and 'Database Creators' server roles in SQL server (You will need to use SQL Server Management Studio).

Base SharePoint Server Install

You are now ready to install SharePoint 2007 itself, follow these steps:

  • Login as your service account
  • Insert your CD (or attach your ISO image) and run setup.exe if it does not autorun.

NOTE: If you get an error about web service extensions here, ensure that 'ASP.net V2.0.50727' web service extension is allowed in IIS. If it is not in the list, perform a 'repair' on .net 3.0 framework using add/remove programs and then the web service extension will appear in the list. This is caused when IIS is installed after the .net framework

  • Enter your CD key and accept the license agreement.
  • Choose 'Advanced' on the installation type dialog.

NOTE: The definition of 'Advanced' means that you are using full SQL server (which may or may not be on the same machine). If you had selected 'Basic' then it would have installed the cut down version of SQL (MSDE).

  • Select 'Complete' on the Server Type screen and click 'Install Now'. The setup will now commence and you'll get a blue progress bar.
  • Once installed you will get a screen with a check box that reads "Run the SharePoint products and Technologies Wizard now". Ensure this is ticked and click 'Close'.
  • After a short pause, you'll get a 'Welcome' screen. Click 'Next'.
  • You will get a warning that the wizard is about to reset several services, click 'Yes'.
  • You'll be asked about the farm configuration, select to 'No, I want to create a new server farm'.
  • Provide the database server (your server name) and your account details (account in the domain\user format). Leave the database name as the default. Click 'Next'.
  • Leave the authentication mode as 'NTLM', set a specific port number is desired (not required) and click 'Next'.

NOTE: In a production environment, you would most likely use Kerberos where possible (if your infrastructure supports it).

  • You'll get a summary screen; click 'Next' to kick-off the process.

NOTE: If it fails here, it is most likely that you do not SQL setup correctly. Ensure your service account is in the right groups. Please also note that this section can take a very long time, especially step 2 (up to 45 minutes).

  • You'll get a success screen at the end, click 'Finish'.
  • The wizard will attempt to load the central administration window. You may need to login here, use your service account. You may also get prompted to add the site to your trusted sites; go ahead and do that.

NOTE: This authentication prompt is caused by the secure version of IE on Windows 2003 Server. You can turn if off by modifying the security settings in IE.

Services on Server Configuration

The first bit of configuration to do is set your server to host all services. You do not strictly have to enable all of these services, but I find it helps if you are using the machine to test / investigate functionality.

  • When the Central Administration screen appears, go to 'Operations' tab, then 'Services on Server'.
  • Start the 'Document Conversions Load Balancer Service'.
  • Start the 'Document Conversions Launcher Service', you'll have to choose the 'Load Balancer Server'; there should only be one option. If there are no options, ensure that the 'Document Conversions Load Balancer Service' has been started.
  • Start the 'Excel Calculation Services'.
  • Start the 'Office SharePoint Servers Search' service, observing the following guidelines:
    • Tick both Query and Indexing check boxes
    • Specify a contact email address (this can be any address)
    • Enter your service account in the 'Farm Search Service Account' section
    • Accept all other defaults and click 'Start'
  • Leave all remaining services in their default configuration

Web Application Setup

The next stage is to create the 3 web applications that will be required to host the basic set of sites for a typical deployment, these are:

  • Shared Service Provider Administration Site (Recommended to be called 'SSPAdmin')
  • My Site Host (Recommended to be called 'MySite')
  • The Main Intranet (or 'Portal') Site (Recommended to be called 'Intranet')

It is much simpler if all of these sites are on port 80 in IIS; this means that you do not have to remember to enter the ports all of the time. However having all three sites on port 80 means that each needs their own Host Header (required by IIS to differentiate between sites on the same port). The simplest way to do this is to create new 'Host (A)' records in DNS for each of your three sites. These should point to the IP address of your server; to do this follows these steps:

  • Open the DNS Management tool from Administration Tools on your domain controller
  • Navigate to your DNS zone
  • Create new 'Host (A)' record
  • Enter the Host header (i.e. 'SSPAdmin', 'MySite' or 'Intranet') for the site and the IP address of your server
  • Click 'Add Host' and repeat for each of the three sites

Now the DNS entries are configured, we can create the three web applications in SharePoint; follow these steps for all three of your web applications (i.e. 'SSPAdmin', 'MySite' or 'Intranet'):

  • In Central Administration, go to the 'Application Management' tab
  • Click 'Create or Extend Web Application' and then click 'Create a new Web Application'
  • Fill out the new web application screen observing the following points:
    • Change the New IIS Site description to read something like 'SharePoint – 80 - <Host header name>' where <Host header name> is the name of the web application your are creating (i.e. 'SSPAdmin', 'MySite' or 'Intranet')
    • Ensure the 'Port' is set to 80
    • Set the 'Host Header' to match the DNS record you created (i.e. 'SSPAdmin', 'MySite' or 'Intranet')
    • Change the 'Application Pool Name' to match the 'New IIS Site Description'
    • Enter your service account for the Application Pool account settings
    • Change the 'Database Name' to read something like 'WSS_Content_<Host header name>' where <Host header name> is the name of the web application your are creating (i.e. 'SSPAdmin', 'MySite' or 'Intranet')
    • Leave all other settings on default and click 'OK'
  • Repeat for all three web applications (i.e. 'SSPAdmin', 'MySite' or 'Intranet')

Shared Service Provider Setup

The next stage is to create the Shared Service Provider (SSP). The SSP is required in order to provide several key services such as Search or My Site. You can read more about SSP on my blog article about it here. To configure the SSP, follow these steps:

  • In Central Administration, go to the 'Application Management' tab
  • In the 'Office SharePoint Server Shared Services' section, click 'Create or Configure This Farms' Shared Services'
  • Click 'New SSP'
  • Fill out the 'New Shared Services Provider' screen observing the following guidelines:
    • For the 'SSP Administration Site' web application (the first one you get asked for), choose the web application that you created earlier (suggested name was 'SharePoint – 80 - SSPAdmin')
    • For the 'My Site Location' web application (the second one you get asked for), choose the web application you created earlier (suggested name was 'SharePoint – 80 - MySite')
    • Enter your service account for the 'SSP Service Credentials'
    • Leave all other settings on default and click 'OK'
  • The creation of an SSP can take some time (up to 1 hour on a virtual machine). When it is finished you will see a 'Success!' screen, Click OK.

Collaboration Portal Site Collection Setup

The next stage is to create a collaboration portal which is one of the more feature-filled site types and represents a typical intranet environment. To do this, follow these steps:

  • In Central Administration, go to the 'Application Management' tab
  • In the 'SharePoint Site Management' section, choose 'Create Site Collection'
  • Fill out the 'Create Site Collection' observing the following guidelines:
    • Ensure you have selected the 'Intranet' web application you created earlier (suggested name was 'Intranet')
    • Give your site a title ('Intranet' is suggested)
    • In the 'Template Selection' section, choose 'Collaboration Portal' from 'Publishing' tab
    • Enter you service account for the 'Primary Site Collection Administrator'
    • Leave all other settings on default and click 'OK'
  • When the 'Top-Level Site Successfully Created' message appears you have created the site, simply click the link that is provided (something like http://intranet)

Configure Indexing

The final step of the process is to configure indexing so that you have some search results. Though this step is optional, it is recommended as it will enable you to use the powerful search capabilities of SharePoint. To configure the index, follow these steps:

  • In Central Administration, click the 'SharedServices1' link on the left-side navigation (or whatever you name your SSP)
  • When the SSP Administration site appears, click on 'Search Settings' in the 'Search' section
  • On the 'Configure Search Settings' page, click 'Content Sources and Crawl Schedules'
  • Edit the 'Local office SharePoint Server Sites' content source by hovering your mouse over it and choosing 'Edit'
  • Fill out the 'Edit Content Source' observing the following guidelines:
    • Set a full crawl schedule to be at least once a day
    • Set a incremental crawl schedule for every 10 minutes
    • Tick the 'Start Full Crawl of this Content Source' tick-box
    • Click 'OK'
  • A crawl will now start. Initial crawls normally take up to 10 minutes.

The process is now complete. User should be able to access the main collaboration portal from http://intranet (or whatever you called the DNS record).

I hope this was useful, please comment with any errors or amendments

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Monday, July 21, 2008 9:43 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Adding a custom style sheet

There are many ways you can add and edit CSS in MOSS 2007, the method I will discuss here is lightweight and great to get a general understanding of how style sheets work, and get aquainted with some of the class naming conventions SharePoint uses.

Set up an Alternate CSS URL:

  • Create a Publishing Site. Select Site Actions, Create Site. Then select the Publishing Tab and finally choose Publishing Site. It will take a few moments for your site to provision.
  • Open your editor of choice and create a new file and add /* Custom Styles */ to it.
  • Save it as “Custom.CSS”. If you are using notepad don’t forget to select “All Files” from the “Save as Type” drop down menu before saving, otherwise you will have a .txt extension.

Go to your website in the browser and select Site Actions, View all Site Content

  • Select the Documents Library (create one if you don’t see it). Update:  The best place to store your CSS would be the Styles Library which is already created.  I have no idea why I said to place it in the Documents Library.  You can thank Amanda for reminding me.
  • Select the Upload Drop Down, Then Upload Document. Select Browse and then browse to and select the Custom.CSS file you created to upload it.
  • Go back to the Site Actions menu, then Site Settings, Modify all Site Settings.
  • From the Look and Feel Section, Select Master Page.
  • Scroll Down to the bottom of the page until you find the “Alternate CSS URL” section. Select Specify a CSS file to be used by this publishing site and all sites that inherit from it.

22.jpg

  • Then Click Browse. Select Current Site Documents on the left and finally select your Custom.CSS file. Click Ok a couple of times to return to the site settings page.

31.jpg

  • What you just did was set up an alternate style sheet for your site. Any style you add to this style sheet will take precendence. What that means is if you know there is a certain class applied to an element in your site and you want to change it, just add the class to your Custom.CSS style sheet and it will override the previous.

Identify and Overwrite Classes:

  • Now that you are set up, you’ll need to figure out what elements of your pages you wish to change, and what classes are applied to them. That’s where the Internet Explorer Developer Toolbar comes in. If you have not downloaded and installed the IE Developer Toolbar, you’ll need to do it now.
  • Go back to the browser, and back to the default page of your website.
  • From Internet Explorer Select View, Toolbars, Developer Toolbar. This will turn the bar on. Note: If you are using IE 7 you may need to hit the ALT key to expose your file menu.

42.jpg

  • From the Developer Toolbar now exposed at the top of your screen, select View Dom. This will open a menu at the bottom of your screen.

51.jpg

  • From the bottom menu, select Find, Select Element by Click. When this is enabled, you can click any element on the page to inspect that part of the DOM (Document Object Model) and subsequently see what class is applied to what element.

6.jpg

  • As you hover over elements of your page, you will notice they highlight with a dark blue border. When you find the element you wish change highlighted, you can click it to show the information about it, such as the class which is applied to it.
  • For this example we will assume we need to change the very top horizontal bar so that is has a yellow background, rather than the default blue.
  • Hover over this element and then click it when it has a blue border. Notice that the class in the bottom tells you it’s using .ms-gloablbreadcrumb. That means that if we add that class to our Custom.CSS file, then edit it to have a yellow background, our site will update to reflect the change.

7.jpg

  • To test this, Select Site Settings, View All Site Settings. Select the Documents Library and then Check Out the Custom.CSS file so that you can edit it. You will notice your ICON change slightly once the file is checked out. When it does click it to to open it in your editor.

8.jpg

  • Add the following code to the style sheet:

.ms-globalbreadcrumb {

background-color:#FFFFB0;
}

  • Save your style sheet.
  • Back in the browser, check the style sheet back in, publish/approve it if necessary.
  • You will notice now when you refresh the page that your top bar has changed to yellow.

9.jpg
This is the basis behind overwriting the custom CSS classes in a supported, non-destructive way.

Other Important Notes:

  • These classes are originally defined in the CORE.CSS located in the 12 HIVE on the file system of the SharePoint Server.  Update:  To quickly copy/paste all properties set in the CORE.CSS file, you can “Control + Click” on any underlined class name in SharePoint Designer 2007.  Doing so will not only open the CORE.CSS file (or whatever stlye sheet your class is defined in), but also jump directly to that piece of code!
  • If there is a theme applied to the site the CORE.CSS classes are overwritten by duplicate entries in the THEME.CSS. (It’s also important to note that Themes can be somewhat confusing as when you apply your theme, the THEME.CSS (and other styles) are actually added to a file called 1011-65001.css and then applied to the site).  If you were trying to personalize a theme by connecting to the site using SharePoint Designer 2007, you need to edit the 1011-65001.css file.
  • I would consider it best practice to use the Alternatte CSS URL where possible and copy the classes “from the CORE.CSS (or theme.css)”, paste it to the CUSTOM.CSS and then modify the approrpriate properties, or add new ones.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Tuesday, July 15, 2008 4:22 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Importing User profiles

Let us say that you are setting up SharePoint 2007 in your organization. Typically your users will access a SharePoint installation through a site collection. Which means, you need to give your users access to a particular site.

But where do these users come from? SharePoint 2007 allows you to plug in any kind of authentication using a membership provider, but for many scenarios you will simply install SharePoint 2007 and use it under the default active directory based authentication – a.k.a. 2003 styliee.

When you do setup SharePoint 2007, and a site collection in there, and you enter a UserID such as DOMAIN\smalik, you would note that all the nice goo such as my email addy, phone number etc. – typically stuff you would see in outlook gal or active directory, or any other such system doesn’t get pulled in automatically.

To pull in that stuff, you need to import the user profile information, and here is how you do it.

1.  Create a Shared Services site (for which you need to setup indexing and search beforehand). Typically in a real deployment scenario, you would want to keep shared services being served by a dedicated machine other than your web heads (a tip I learnt from Scott Hillier – whose excellent Apress book on SharePoint 2007 I am reviewing right now).

2. Once that is created go to that shared services site, and under “User Profiles and My Sites”, click on “User Profiles and Properties”.

3. When in there, you need to setup an import connection. You can create as many connections as you want – which means if you have multiple kinds of authentication going on, on the same physical box – you should have some means of uniquely differentiating each user – if indeed your organization uses two different repositories of users. In most scenarios you would use active directory, but SharePoint will let you import from AD, LDAP, ADR or any BDC (supplementary information only).

4. So go ahead and setup an import connection. Then back at “Configure Profile Import” set up an import schedule with proper user access rights. It is a good idea to setup an incremental import – which performs a full import to begin with.  You can schedule such an import, or you can perform such an import on demand. I like to keep full import unscheduled – and I use that for “wipe out and lets start over” scenarios only.

5. Real world – I imported 48,707 profiles in around 29 minutes – not bad eh?

6. Finally, before you actually start the import, you probably want to map the properties appropriately. So “Email Address” shows up in “Work Email” and so on so forth.

Once everything is setup – hit import, and then the incremental job will run at your specified schedule, and your sites in that site collection will begin to recognize users not as “Domain\smalik” but as “Malik, Sahil” with full meta data. Then you can use that information to power hierarchical org charts, searching over the user metabase via SharePoint, membership information to various groups/mailing lists setup on exchange server etc.

Quite powerful I must say J

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Monday, July 14, 2008 9:59 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Sending emails via Sharepoint 2007 code

if you are developing a webpart or any sharepoint customized feature,and you would like to send an email through your webpart or custom code,you can achieve this by 2 ways:

1) use normal .net classes to send email (System.Net.Mail namespace).
2) use below code:

using Microsoft.SharePoint.Utilities;

SPUtility.SendEmail(SPContext.Current.Web, false, false,
"to-address@mail.com", "E-mail title",
"E-mail body");

this code will use the configuration of your sharepoint installation (SMTP server configuraiton),in the central administraiton tool.

the benefit of the second choice,you don't need to store any other configuration for your SMTP server on your code,this code will directly use the sharepoint configuration and free your mind of SMTP configurations, if the sharepoint is configured propely and send email notification (throught workflows for example),then you code will work as well

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Friday, July 11, 2008 4:39 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Loging promts

To prevent IE from promting for loging details all the time change the setting in Internet options->Security.

either move the site into  intranet zone and make sure that automatic logon for intranet zone is selected in the custom level options or

change this option to automatic logon with the current user name password.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Sunday, July 06, 2008 9:27 AM
Permalink | Comments (0) | Post RSSRSS comment feed

sharepoint accounts

Running MOSS Setup

On every server where MOSS is to be installed, the account you run setup with must belong to the local administrators group. In addition, this account must be a Domain User and be a member of the following SQL server security roles: Logins, Securityadmin & Dbcreator. This account is going to be doing a lot – creating new databases, and also creating new IIS sites – so make sure you have enough permissions! Typically, an account such as the domain administrator is used to run the installation, which addresses all of the security requirements.


SQL Server (SQL_Service)

This account is specified when a new SQL server is being brought online or a new instance installed. It typically is used for running both the SQL Server & SQL Server Agent, however, each can have their own account. For our purposes, we will utilize one account for both SQL Server & the Agent. The account only needs to be a basic Domain Account with no specific permissions set. When SQL Server is installed, all of the other appropriate permissions will be granted to the account.
 


Database Access Account / Farm Account (Farm_Service)

This account serves a few roles. The first is that it is used by MOSS to access the databases… it acts as the account by which the server(s) MOSS is installed on communicates back and forth to SQL with (read/write). Additionally, it is used as the identity for the Central Administration application pool & the WSS Timer service. This account needs to be a Domain Account - but note that it is believed to have to be a local admin on every MOSS box - this is not true, as Spence points out very eloquently.


Shared Service Provider (SSP#_Service)

Each shared service provider can run under its own account, therefore, it is desirable to name the account using a number. This way, if your MOSS farm ends up having a large number of SSPs, you can map the SSPs back to their specific service accounts easily. This account is used for the SSP web services & the SSP timer jobs. The account only needs to be a basic Domain Account with no specific permissions set.
 

Office SharePoint Server Search (Search_Service)

This account is utilized by all of the Shared Service Provider to crawl local & remote content. This account should be a Domain Account & have local administrator permissions on each MOSS server.
 

Default Content Access Account (SSP#ContentAccess_Service)

When a shared service provider crawls content, this is the default account used if a specific account (see below) is not specified for the content source being crawled. This account is specific for each individual SSP. This account should be a Domain Account & have read access to the content sources it needs to crawl.
 

Content Access Account (XXXXContent_Service)

If you have specific content sources that need to be crawled, and you do not want to allow the default content access account to crawl them, then you specify an individual content access account (specified at the time a Crawl Rule is setup). This account is a Domain Account with read permissions specifically on the content source it crawls.
 

Windows SharePoint Services Search Account (WSSSearch_Service)

The WSS Services Search is used only to provide search capabilities within the Help content. If this search feature is desired, then this account should be configured as a Domain Account with no specific permissions.
 

Application Pool Process Account (XXXXPool_Service)

When each application pool is setup, you must specify an account that will be used for that specific application pool’s identity. This account will be used to access the content databases associated with the web application. It is recommended that a new service account is created for each application pool. This should be a Domain Account with no specific permissions. When the account is specified & SharePoint creates the application pool, it automatically grants the account additional needed permissions.

 

More information at 

http://www.datasprings.com/Resources/ArticlesInformation/OverviewonInstallingSharepoint2007/tabid/774/Default.aspx

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by gurney on Saturday, July 05, 2008 9:54 PM
Permalink | Comments (0) | Post RSSRSS comment feed