.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Getting servers list in the farm in WSS 2.0

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :SharePoint

I need to get the list of all servers in the farm. Using WSS 3.0 I can do that

                            using (SPSite startSite = new SPSite(ConfigurationSettings.AppSettings["FarmName"]))
                                SPFarm farm = startSite.WebApplication.Farm;
                                foreach (SPServer spServer in farm.Servers)

View Complete Post

More Related Resource Links

Taming the Stateless Beast: Managing Session State Across Servers on a Web Farm


Running a Web farm means managing session state across servers. Since session state can't be shared across a Web farm with Internet Information Services 5.0, a custom solution is required. One such solution using a tool called the session manager is described here. The article begins with a description of the SQL Server database used to store state information, the stored procedures used to update it, and the retrieval of session data. ASP code drives the session manager tool and the COM and COM+ components that run the stored procedures.

John Papa

MSDN Magazine October 2000

Feature for XXXXXXXX list template XXX is not installed in this farm. vsewss

Hi Do you know why I got the error below and how to solve it ? Feature for XXXXXXXX list template XXX is not installed in this farm.  The operation could not be completed. ThanksMomo

Possibility of overwriting other sites on other servers in the farm?

Hi,   This is my first Sharepoint site so please be gentle :). I'm creating a sharepoint site to function as a local wiki for IT documents. I want to install the site on one server only.  I'm at the section where I'm given the option: If you opt to create a new IIS web site, it will be automatically created on all servers in the farm.  As, I said, I only want the site on one server so the option of using an existing site probably isn't for me since it needs to reside on all of the servers in the farm but in my farm topology I have the following                                                         *Services Running* Our exchange server                           Not configured Server B (correct server)                    Central Sharepoint admin and Services db etc Webmail server              &nbs

Cannot connect new Servers to existing MOSS 2007 SP2 farm


We have Single Server MOSS 2007 SP2 farm with DBA managed database server. We have different web applications running and deployed several solutions (SharePoint Learning Kit, Facet Search, workflow extensions, new themes) in the farm.

Recently we wanted to scale out our farm by adding one WFE and one indexing server. I have installed MOSS 2007 SP2 slipstream in the C drive (default location) of both the new servers. Then before running the SharePoint Product & Technology Configuration Wizard I uninstalled MOSS, restated the servers and reinstalled MOSS 2007 SP2 slipstream in D drive.

I didn't add farm administrators group to the local administrator group of the new servers but I added my own account which is a member of farm administrator group to local administrator group. I didn't add Central Admin Webapp pool identity account (which is a service account) to the local administrator group either. But this service account as well as farm administrators group account has dbcreator & securityadmin privileges in the sql server, both t

Error when clicking on servers in farm link unders Operations in Central Adminstration


Hi All,

I have below error message when click on servers in farm. Any idea how to resolve this. Thanks in advance! This is in WSS3.0

Object reference not set to an instance of an object.   at Microsoft.SharePoint.Administration.SPDatabase.get_Server()
   at Microsoft.SharePoint.ApplicationPages.FarmServersPage.get_ConfigurationDatabaseServer()
   at ASP._admin_farmservers_aspx.__Render__control8(HtmlTextWriter __w, Control parameterContainer) in c:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\ADMIN\FarmServers.aspx:line 27
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Control.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Contro

How to copy a complete list from a sharepoint site to another when both are on different servers and

Hi All,
I have a sharepoint site which has a custom list. This list keeps getting updated with new items probably on a daily basis.
I need a copy of this list on my sharepoint site which is on a different server altogether. And i need the updates too on a daily basis. How can i achieve this programmatically or otherwise?How can i copy the entire list?
Some timer job to get my list updated?
Rgds, Ash

Upgrading servers in a MOSS 2007 farm from Windows 2003 SP2 to Windows 2003 R2

Are they any particular pitfalls to watch out for here?  We have two front ends in a load balance with an index server, andtwo SQL servers forming a failover cluster.

How to get a list of all the BCS services in a farm


This question is pretty similar to this post


I have been searching the web using this post as an example to try and find the missing pieces.  I would like to get a list of all the BCS services in the SharePoint farm and show them in a list to the user.

I have tried searching for SPServiceApplicationProxyGroup, BdcServiceApplicationProxy, and a few other bits and pieces.  I don't know if I am tired or really dense, but I am missing something obvious here.  Hopefully someone can point me in the right direction because right now i am left with reading MSDN object trees hoping to find something that strikes a chord.






SMO Problem getting list of Servers


We have had code in a number of our apps for a few years that presents end-users with list of Servers to assist them in establishing a connection.  I have included this code at the end of this initial post - as you can see, its very simple...

However, users who have upgraded from SQL 2005 to SQL 2008 found that this formerly trusty code now produces an error.  I contacted Microsoft and was told "Oh, you need your users to load the SQL 2005 Compatibility Pack" - so I downloaded that and alerted those users to the link I was given.

We loaded that pack on our test machines - IT DOESNT WORK.  6 of our customers loaded it too - IT DOESNT WORK.  All machines who downloaded and installed this "Compatibility Pack" have found its useless - it doesnt do what Microsoft's own support tech told us it would, and now, trying to support a mix of both SQL 2005 and SQL 2008 users, we are kind of dead in the water.

Can anyone give me an answer that actually works?  Why does the following code work fine in SQL 2005, and not at all in SQL 2008 - and what do I do to fix this problem?  Here is the VB.NET code...


Ready made List Types provided by SharePoint

SharePoint provides some out of the box List Types. Some of the most used ready made list types that SharePoint provides currently are listed below:

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

Binding an array to dropdown list


I have the following string which is a list of urls. How do I get this to work so the url shows for the selection and also is the value?      


allLinks = newAllLinks
        Me.DropDownList1.DataTextField = "Link"
        Me.DropDownList1.DataValueField = "LinkURL"
        Me.DropDownList1.Items.Insert(0, New ListItem(" - Select - ", 0))
        Me.DropDownList1.DataSource = allLinks


 ArgumentNullException: Value cannot be null.
Parameter name: container]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +121
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +8

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend