in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Robert J Wheeler

...a blog to remember...
  • SharePoint Backup Error

    Recently a colleague had a client who had errors performing backups and restores in Central Administration.  The jobs showed as failed, the timer would seemingly hang, and you could not delete the job.  He said the account used was a local admin, was an admin in SQL, et cetera.  Although an account may be a local administrator, that does not mean the account is not affected by policies.

    Here is what I suggested that they do with the server administrator.  (I like to let them run the commands with me, since they generally will insist that it should work, and they can see potentially where the policy needs to be changed).

    To test if the user has access to perform a backup, use the account SharePoint has and run the stsadm utility for a backup.
    If you see a message like this:

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o backup -backupmethod full -directory "\\vanilla\Backup"

    Access to the path '\\vanilla\Backup\spbrtoc.xml' is denied.

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>

    then you are failing with the permission to access the UNC path.

    You should get the service account that was used to connect to the database in the original instance (or one with little policy limitations).  Log onto the server using this account.  The account should be able to access the database server from the SharePoint server running the sts commands, and be able to do the reverse; go from SQL to the SharePoint server.  This will give the stsadm utility the service account to use with the connection object.
     
    If you can perform the backup procedure of a site you will have found your problem.  To fix you will need to check the policies for the account that is registered with SharePoint.
     
    If you can execute the stsadm utility and begin the process of backup, then watch the commands that scroll through the window - there will be some SQL statements for the execution of the backup.  You can analyse these further to see which part of the connection is failing.  And read the log files.
     
  • Dynamic CAML Query

    Occasionally the need arises to build dynamic CAML queries in order to get items from a SharePoint list.  This was the case recently while delivering a solution for a customer.  In my solution I used a combination of controls including ASP .NET and SharePoint controls.


    In my solution I created a form which posted to the server the values which were to be used for the query.  For the solution I decided to use a string builder function and a string array to store the values, and then I looped through the results and used those which contained values to build the CAML query.

     

    Read the article

  • How To Access the Controls In A Master Page

    Ever wonder how to access the placeholders in a Sharepoint masterpage and add new controls programmatically?  Let's assume you are adding a Label control with some text to display.  You could create the control and then call the master page from within your ASPX page.  When SharePoint renders the page you can programmatically add the control.  To catch the error if one is generated, use the InnerException.Message to see what it is since SharePoint will return a very generic message.

    Label label = new Label();
    label.Text = "Something to display";

    try
    {
        this.Master.FindControl("PlaceHolderMain").Controls.Add(label);
    }
    catch (Exception ex)
    {
        Response.Write(ex.InnerException.Message);
    }

  • Create Wizards in SharePoint

    Recently I developed a wizard using SharePoint lists.  The challange was to use only WSS 3.0, no compiled code, and it needed to be designed so that users could manage the questions themselves.  The extra limitations were that the solution had to be provided using only the basic templates (Surveys were no available) and it needed to be generic enough to cover a wide range of questions.

    To see how this was accomplished, and in a very short time, read my article Create Wizard Functionality With SharePoint Lists

  • Adding file shares to Enterprise Search

    Adding file shares to search within MOSS is relatively easy.  The results of searching within the scope of the file share will display the links as 'file://...' and will display the first few lines of the content.

    For this example, on the SharePoint Server, create a shared folder: i.e. C:\Shared => \\[server]\Shared

    Open the SharePoint Central Administration and navigate to the Shared Services where the index will be created.  Click on the Search Settings link under the Search section.

    We want to add the shared drive as a content source but we do not want to add it more than once.  When satified that the source is unique and can be access for crawling, click the link next to Content Sources.  This will get us into the Manage Content Sources screen where we will add a new content source.  Click New Content Source from the menu to add the source.

    Give the source a name: e.g. Shared Drive Content and then select File Shares from the options below.  Enter the start address for the content which should be the one that was created earlier: i.e. \\[server]\Shared.  Choose whether or not to crawl sub-folders or just the share itself.

    When finished, click OK which will take you back to the ‘Content Sources’ page.  Click on the content source created to show the context menu and select "Start Full Crawl".  This will begin the process of indexing the items on the shared drive.

    Next we will add a scope which will use the content source created above. Back on the Search Settings page, scroll down to Scopes and click the link next to the item 'Scopes'.  You will find the content sources and the number of files created next to them.  Click 'New Scope' and enter a Title for this.  Click Okay to save.

    Back on the View Scopes page you will see the scope that was just added with a link to 'Add Rules'.  Click this link to add the content source.  On the Add Scope Rules page select Content Source, and select the source created above.  Click OK to save.

    Navigate back to the Search Settings page and scroll down to Scopes again.  Click 'Start Update Now' which will update the scopes that were added.

    Navigate to the site that will use the new scope and click Site Settings -> Manage All Settings -> Search Scopes.  Create or select the group that will use the scope created.  You will see the list of scopes included in the group, and all scopes that are available to use, and the order of preference.  Select the scope created and click OK.At this point the scope is added and the drop-down list next to the search box will display the name.  Select this scope and then search for the items.

    Notice that the results are returned like other search results with a hyperlink pointing the files.  This is all well and useful except what about security on the file share?  What about results that we do not want people without access rights to see?  This will be explained in the next part 'Using Folder Access Permissions with Shared Drive Indexes in MOSS'.

     

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts