Archive

Posts Tagged ‘SharePoint’

Adding Person or Group data to List Instance in CAML

October 26, 2012 Leave a comment

Here’s a quick gem from the comments on MSDN for Field Element (List -Definition).

…to set the value of a “Person or Group” field if the ID of the user is not known, …use the value “-1;#<domain>\<username>”.

This is useful in the scenario that you want to pre-populate a List Instance with data for a ‘Person or Group’ field (Type=”User” in CAML). 

The numeric component of the field’s value is the ID of the user within the UserInfo list within SharePoint and this value will change for the same user in different environments (for example development, test and production).  By setting this to ‘-1’, SharePoint will resolve the specified fully qualified domain name of the user against the UserInfo list for the current environment.

Thanks to Rudolph de Wet for the advice.

Don’t include a plus (+) sign in filenames for files uploaded to SharePoint

February 15, 2010 Leave a comment

This one is for my own sanity as much as for anyone else’s benefit: don’t include a plus sign (+) in filenames for files uploaded to a SharePoint document library.

The + character is permitted in a filename within Windows, and SharePoint will permit the file to be uploaded, however when the file is accessed the + is not escaped within the URL and an HTTP 404: File Not Found will be displayed.

Further to this, Tim Jones provides an excellent solution (and discussion leading up to his solution) on how to strip invalid characters from files when uploading to SharePoint.

Are we there yet?

You need to know what you want to achieve before you can claim to have achieved it.

Lately I’ve been reading a lot of Paul Culmsee’s insightful blogging at CleverWorkarounds and in particular his series focussed on the importance of shared understanding in preventing SharePoint projects from failing.

This has all come from advising on SharePoint development recommendations which transformed into providing detail on more general SharePoint governance that then metamorphosed into attempting to define the business requirements for implementing SharePoint in the first place. I’d liken the experience to taking a series of steps backward to gain a wider view of an sculpture only to discover that you’ve inadvertently left the art gallery.

The real problem is that currently there are no clear business requirements and little awareness throughout the organisation about the potential benefits. This threatens to result in other, more business critical, projects venturing down paths that don’t lend themselves to SharePoint integration at a later date.

This is something of a journey of discovery beyond that of the normal technical nature of this blog but if I can glean anything of value for other developers/architects then I’ll carry on posting on this theme.

Categories: SharePoint Planning Tags:

Renaming a single-server MOSS Virtual PC

September 23, 2008 5 comments

Background

Virtual PCs are commonly used for SharePoint development, an organisation might create a virtual server environment and allow developers to each have a copy.   In this scenario, SharePoint will typically have been installed and essential services such as Central Administration and Shared Services configured.

 

Each virtal environment will initially have the same computer name which must be changed to prevent problems with resolving the correct server if the virtual servers are added to the network.

 

Unfortunately renaming a SharePoint server is fraught with difficulty.   

 

Renaming a single-server MOSS virtual server

What is presented below is a step-by-step guide to renaming a single-server MOSS farm, with SQL Server on the same computer, which is typical of a developer virtual environment. 

 

Note: before starting this process, ensure that the virtual machine being renamed is not connected to the network, this will prevent inadvertently accessing the wrong Central Administration site.

 

The key is to rename SharePoint before renaming the server: 

  • Start the virtual machine and login
  • Open the Central Administration site for the server
  • On the Operations page, click on the Alternative Access Mappings link and update the link for the Central Administration site to use the new server name
  • Rename the SharePoint server using STSADM.  Open a command window and type:
    • stsadm -o renameserver -newservername <new name> –oldservername <old name>
  • Rename the computer to match.  Right-click on My Computer and select Properties.  Click on the Computer Name tab and then click the Change… button.  Type in the new server name.
  • Reboot when prompted
  • Update the farm administrator credentials.  Open a command window and type:
    • stsadm –o updatefarmcredentials –userlogin <new name>\<farm admin account> –password <password>
  • Reset IIS using the command window by typing:
    • iisreset /noforce
  • Open the Central Administration site:
    • Click on the server name in the Farm Topology
    • Click on the Office SharePoint Server Search link and update the accounts to use new server name
    • Click on the Windows SharePoint Services Help Service and update the accounts to use the new server name
  • Still within Central Administration:
    • Click on the Operation link in the left-hand navigation
    • Click on the Service Accounts link
    • Update the Service Accounts for both of the Shared Services and My Site Windows SharePoint Service Web Applications to use the <new name> in place of <old name>
  • Open the Shared Services Administration site:
    • Click on the Personalization Services permissions link
    • Update the accounts listed to use the <new name> in place of <old name>
  • Check the services on the farm by typing in the following URL: http://<central admin site>/_admin/checkfarmservices.aspx?source=/default.aspx
    • If the Search Service cannot be started, click on the link within the report and ensure that the accounts use the new server name
  • Reset IIS using the Command Window by typing:
    • iisreset /noforce
  • Open the SQL Server Management Studio and connect to the database called <new server>:
    • Expand the server tree to display the contents of the Security > Logins folder
    • Open the properties window for the service account used for the SharePoint Timer Service
    • On the User Mapping tab, ensure that the Map checkbox is ticked for each SQL Server database to which the account requires access (especially the Shared Services databases)
    • Rename each of the service accounts to use the <new name> in place of <old name>; just right-click on the account and select rename 

At this point the virtual machine should be ready for connection to the network.

 

Alternative

An alternative to doing this configuration on a per-machine basis is to create a clonable environment, Paul Horsfall describes just such an approach on his site.

Adding required files to Source Control for VSeWSS projects

May 20, 2008 1 comment

After creating a new project in Visual Studio 2005 using the extensions for WSS 3.0, only part of the project’s required files are visible in Solution Explorer.

You can view all the files used to create the WSP for deployment using the WSP View (Views>Other Windows>WSP View) but that still doesn’t help you when you need to add the files to source control.

Instead, I recommend that using Solution Explorer, you click on the Show All Files button and then add the pkg folder to the Visual Studio project.  This will ensure that the XML files required to deploy your solution are saved to source control along side your actual coded solution.