STSADM -o backup -directory: Error Cannot open backup device Operating system error 5 (error not found)

By peter.stilgoe









STSADM -o backup -directory: Error Cannot open backup device Operating system error 5 (error not found)

Ensure the SQL service account is a domain account and it has permissions to
the Shared folder.

Also ensure the account used to execute the backup command has the correct rights on the DB’s as per MS recommendations ie. Owner, creator etc.

Share

Leggi tutto

Sharepoint 2010 Service Pack 1 (SP1) – Features

By peter.stilgoe









Sharepoint 2010 SP1 new features include:

- The usual stability, performance and security enhancements rolled up.

- A site recycle bin, basically we could always recover files etc from the recyclye bin but in SP1 you can now recover whole Sharepoint site collections & sites aswell!

- A new improved storage space allocation feature enabling site collection owners to have a better understanding of their storage usage, similar to the one in MOSS 2007 but better.

- Remote storage support for shadow copies ensuring better reliability and recoverability.

- New Powershell cmdlet (Move-spsite) for moving Site Collections between databases without moving content back in the db when using remote blob storage.

- Improved backup & restore functionality for Sharepoint Server 2010

- Project Professional synchronises scheduled tasks with Sharepoint task lists

- Google Chrome Support for SharePoint 2010 and Office Web Apps

Share

Leggi tutto

Sharepoint: Removing illegal characters from filenames prior to bulk uploading

By peter.stilgoe









If you are doing a migration from a filesystem to Sharepoint you will more than likely come across problems uploading documents to Sharepoint that contain illegal characters in their filenames.

In Sharepoint the following characters are classed as illegal characters – & ” : * ? <> # {} % ~ / \ Tab

The + character can also cause problems & should be avoided in filenames & sitenames.

Below are some useful Powershell scripts to help you remove the illegal characters prior to uploading your documents to Sharepoint.

List all files containing a specific character (in this case ‘&’)

gci -rec | ? {-not $_.psicontainer -and $_.name.Contains("&")}

Count the number of files containing a specific character (in this case ‘&’)

(gci -rec | ? {-not $_.psicontainer -and $_.name.Contains("&")}).Count

Replace a specific character with another, in our case the ‘&’ with the word ‘and’

gci -rec | ? {-not $_.psicontainer -and $_.name.Contains("&")} | % {rename-item $_.fullname -newname ($_ -replace "&","and")}

Share

Leggi tutto

Pingar – Discover new value from unstructured data

By peter.stilgoe









This looks very interesting tool & very useful in creating and maintaining your companies taxonomy.

“At PINGAR we have been building semantic search applications for business enterprises since 2007.

Consider the facts. The volume of data companies need to manage is growing 40 percent a year. Fifty percent of data searches are unsuccessful — employees may lose up to 25 percent of their productive time searching for information. And the cost to enterprises from failed searches is approximately USD $5.3 million per year, for every 1000 enterprise workers employed.

PINGAR’s research teams had three objectives:

•Deliver applications to assist enterprise workers to find more relevant data, faster
•Improve employees’ search experience
•Improve enterprise productivity and drive down costs.

These objectives were achieved with PINGAR’s Microsoft SharePoint 2007 and 2010, and Apache SOLR semantic search applications. Each can be purchased as an easy to install ‘plug-in’ server application, for distribution across enterprise networks.”

Find out more Pingar.com

Share

Leggi tutto

K2 Blackpoint In one way trust environment – process not showing as running in K2 Process Portal

By peter.stilgoe









Configuring K2 Blackpoint in a one way trust as per previous post. Deployed a new process & then triggered it by creating a new document. The process started & I could click on it & see it as ‘In progress’.

When I went to the K2 Process Portal the ‘Processes’ webpart showed the process as deployed with all the relevant data. However the process never displayed in the K2 Worklist webparts nor did it show as ‘Running’ in the K2 Instance Summary Webpart.

This is because the account that you are using to run your Sharepoint web application needs ‘Admin’ & ‘Impersonate’ rights on the K2 server.

Share

Leggi tutto

K2 Blackpoint/Blackpearl In a one way trust environment – Error: Authentication required for session

By peter.stilgoe









If you are trying to get K2 Blackpoint or K2 Blackpearl working in a one way trust environment using K2′s pass thru authentication there is a blog post here on how to get it to work:

Working with a one-way trust using K2 4.5 with KB001290

I followed the instructions but every time I tried to access the settings page in the K2 process portal (/_layouts/K2/PPManagementConsole.aspx) I would get the error:

Authentication required for session xxxxxxxxxxxxxxxxxxxx

This was because the account(s) running my Sharepoint app pool(s) also need to be in the trusted domain along with the K2server service account.

Hopefully this may help someone if they have similar problems!

Share

Leggi tutto

Sharepoint 2010: 2 service application databases with the same name showing in Central Admin –> Manage Databases Upgrade Status

By peter.stilgoe









I had a strange problem where if I went into:

Central Admin –> Manage Databases Upgrade Status

in Sharepoint 2010 I had 2 Business Data Connectivity Service databases with the same name! The status of the one in use was ‘No action required’ & the rogue one had ‘Database is too old and upgrade is required’

There was only one database showing on the SQL server, the one in use, if you find you get 2 service application databases with the same name (somehow!?) the command to delete it is:

Stsadm -o deleteconfigurationobject -id b9b3e713-9e53-42ab-a634-a2c54e90a0d6

(replace the guid with the rogue database guid)

Share

Leggi tutto

The K2 Setup Manager requires the logged on user to have domain user privileges to proceed

By peter.stilgoe









Installing K2 Blackpoint / Blackpearl in a one way trust environment you need to run the K2 server service account & application pool using an account from the ‘trusted’ domain. It is also recommended that you install K2 components using this account:

Note: It is recommended to install all K2 components using the K2 Service Account. Log on to the server as the K2 Service Account before installing.

However if you try you will get the following error:

“The K2 Setup Manager requires the logged on user to have domain user privileges to proceed”

As you are in a one way trust environment you cant easily give the required permissions (if at all) so the work around is –

“If you have a scenario where you have multiple domains, you can disable the Installer’s domain check. 1. Please browse to the directory where you are executing the installation files from. 2. Look for an configuration file called product.config. This file will reside in the installer directory. 3. Please edit the file and change the Domainusercheck from true to false as shown below. 4. Save the file and execute the setup.exe again.

setting key=”domainusercheck” value=”false”

source: K2underground

Share

Leggi tutto

How to restart the Sharepoint Timer Service (SPtimer)

By peter.stilgoe









SharePoint 2010: net stop SPTimerV4 / net start SPTimerV4

SharePoint 2007: net stop SPTimerV3 / net start SPTimerV3

SharePoint 2003: net stop SPTimer / net start SPTimer

Share

Leggi tutto

K2 Blackpoint Blackpearl not showing in Sharepoint Central Administration

By peter.stilgoe









If you are installing K2 Blackpoint / K2 Blackpearl in a distributed Sharepoint environment, you install K2 for Sharepoint on your web front ends but the K2 section still doesnt appear in Sharepoint Central Administration.

This is probably because you are hosting your central admin web app on a different server ie. an application server, if this is the case you need to install K2 on this server hosting your central admin as well as your Sharepoint Web Front End servers.

Share

Leggi tutto

Sharepoint 2010 CQWP: Make the CQWP portable by using tokens to point to the current site instead of static URL

By peter.stilgoe









Target the CQWP to the current site export the CQWP, Edit & replace the WebUrl with below:

<property name="WebUrl" type="string">~Site</property>

To target the CQWP for the Site Collection its currently located on:

<property name="WebUrl" type="string">~sitecollection</property>

Share

Leggi tutto

Sharepoint CQWP: XSL to link document icon to document and open in edit mode

By peter.stilgoe









The xsl code will display & make the document icon link to the sepcific document & open it in edit mode in your content query webpart:

<a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
<xsl:if test="$ItemsHaveStreams = 'True'">
                   <xsl:attribute name="onclick">
                     <xsl:value-of select="@OnClickForWebRendering"/>
                   </xsl:attribute>
                 </xsl:if>
                 <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                   <xsl:attribute name="onclick">
                     <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                   </xsl:attribute>
                 </xsl:if> 

                 <img class="image" src="{@DocumentIconImageUrl}" title="" />
				 </a>




Share

Leggi tutto

Sharepoint CQWP How to format date from mm/dd/yyyy to UK dd/mm/yyyy

By peter.stilgoe









To format your Sharepoint content query webpart to UK date format do the following:

In your ItemStyle.xsl add the following line to your declarations:

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"

Then use the following line to display & format your date field in UK date format:

<xsl:value-of disable-output-escaping="no" select="ddwrt:FormatDate(string(@Modified), 2057, 5)" />

@Modified is your date field that you want to format




Share

Leggi tutto

Sharepoint 2010 One Way Trust users on the trusted domain do not return any search results

By peter.stilgoe









If you have you Sharepoint 2010 Farm setup in one domain & your users are in a seperate domain using a one way trust, when they perform a search they will not return any search results. This is because the account running the app pool for the search query service is running using a domain account on the trusting domain.

This account has no rights on the domain where the users sit to determine how the search results should be security trimmed etc. My initital thought was we need to run the search query app pool account using an account on the same domain as the users which does / will work.

However a better way is to run the following powershell command:

$searchapp.SetProperty("ForceClaimACLs",1)

now run a ‘Full Crawl’ and you users should now return search results as expected over the one way trust.

You can display you Search App details with the following command:

Get-SPEnterpriseSearchServiceApplication

Note: After performing the above search alerts will be broken. If you do need search alerts you can try running your search app pool with an account from the user domain.




Share

Leggi tutto

How to delete & create Sharepoint 2010 managed accounts using Powershell

By peter.stilgoe









To list your managed accounts use:

get-spmanagedaccount | ft username

(| ft username) returns the full text of the username

Then to delete the account use:

Remove-SPManagedAccount

press enter & enter the name of the managed account to delete

New-SPManagedAccount

create a new managed account

Set-SPManagedAccount

set a new password expiration & notication settings on a managed account




Share

Leggi tutto

Sharepoint Workflow Task Error: This task is currently locked by a running workflow and cannot be edited

By peter.stilgoe









Error in Event Log on Sharepoint Server: This task is currently locked by a running workflow and cannot be edited

When a workflow processes a task normally, the following sequence of events is expected to occur:

1. The process begins.

2. The workflow places a ‘lock’ on the task so nothing else can change the values while the workflow is processing.

3. The workflow processes the task.

4. The lock is released when the task processing is finished.

The error occurs because the lock never gets released, which usually occurs between steps 2 – 4. You can read more from this forum post.

http://connect.nintex.com/forums/thread/6503.aspx

Anyway I was getting this problem in a K2 Blackpoint / Blackpearl workflow which was preventing my workflow from moving to the next step. I resolved it by creating a new task list & pointing my K2 process to the new task list, no locking errors & the workflow runs fine now.

You may get similar errors with any workflow product ie. Nintex, Sharepoint Designer Workflow, C# Workflow etc, anything that uses the Sharepoint Workflow Engine & Sharepoint Task Lists.




Share

Leggi tutto

Sharepoint – How to setup a one way trust & required ports

By peter.stilgoe









1. Open Command Prompt.
2. Type: netdom trustTrustingDomainName/d:TrustedDomainName/add

TrustingDomainName – Specifies the DNS name (or NetBIOS name) of the trusting domain in the trust being created.

TrustedDomainName – Specifies the DNS name (or NetBIOS name) of the domain that will be trusted in the trust being created.

• To perform this procedure, you must be a member of the Domain Admins group or the Enterprise Admins group in Active Directory, or you must have been delegated the appropriate authority. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups [http://technet2.microsoft.com/WindowsServer/en/library/f6e01e51-14ea-48f4-97fc-5288a9a4a9b11033.mspx], Default groups [http://technet2.microsoft.com/WindowsServer/en/library/1631acad-ef34-4f77-9c2e-94a62f8846cf1033.mspx], and Using Run as [http://technet2.microsoft.com/WindowsServer/en/library/8782f8ab-9538-4111-8a68-7bfd130c21c01033.mspx].
• To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.
• This command-line method requires the Netdom Windows support tool. For information about installing Windows support tools, see Related Topics.
• Other switches can be used to assign a password or determine the direction of the trust. For example, to make a two-way, transitive trust, you can use the following syntax:
netdom trustTrustingDomainName/d:TrustedDomainName/add/twoway
• To view the complete syntax for this command, at a command prompt, type:
netdom trust | more

One Way trust validation

Inbound
————–

LDAP 389 UDP and TCP
MS DS 445 TCP
DCE Endpoint resolution – portmapper 135TCP
Netlogon fixed port

Using object / people picker

Outgoing
—————
LDAP 389 UDP and TCP
LSA fixed port
Kerberos 88 UDP
DCE endpoint 135 TCP

Netlogon to external forest with NTLM

Outgoing
————

DCE endpoint 135 TCP
netlogon fixed port




Share

Leggi tutto

K2 Blackpoint Blackpearl – How to update a Sharepoint list items using common meta data

By peter.stilgoe









In a K2 Sharepoint process you will quite often have to update the same piece of meta data in multiple locations ie. you have a status column which is part of the list your process is attached to but you may need to reflect this status update on another list item in another list for reporting purposes or something similar. Your lists will need to have a common piece of metadata like a ‘reference number’ or something similar in order for you to return the List IDs’.

You can do this fairly easily using the ‘Sharepoint Search’ event wizard in K2.

- Drop the Sharepoint Search Event wizard on to your design canvas

- Choose ‘Search in a Sharepoint List or Library’ this will just search the specific list your point it at

- Add the URL of the Sharepoint site where the list resides & pick the list you want to search

- Now specify you search parameters ie

Content Type: Order

Field: Reference Number

Operator: Equal

Value: Order Number (This column exists on your other list ie. the one attached to your existing process)

This is now searching your list for a reference number that matches the order number on your original list.

- Create a content field in order to store the results on the next screen

- Finish the process and save

- Now if you go into your process explorer you can browse your new content field that will contain the List ID of your item everytime your search event fires

ie. Object Browser –> XML Fields –> ‘Process Name’ –> ‘Content Field Name’ –> Items –> Item –> Item (This contains the List Item ID of the item you wish to update on the other list)

ps: I wrote this in a hurry which is probably apparent!




Share

Leggi tutto

How to delete a corrupted Sharepoint list

By peter.stilgoe









Sometime you will find you have a currupted list that you cant delete through the normal way as when you try & access the list or the list settings the webpage throws errors. In this case use STSADM

stsadm.exe -o forcedeletelist -url http://devapp01/Lists/<MyListName>/

Share

Leggi tutto

Merging documents into a single document using Open XML SDK 2.0 and Word Automation Services

By peter.stilgoe









The code below will create a webpart that can be added to any document library, when the button ‘Merge Reports’ is clicked it will merge all the documents together in the library in to a single document using Open XML SDK & Word Automation Services.

You will need to add the following references:

DocumentFormat.OpenXml
Microsoft.Office.Word.Server
Microsoft.Sharepoint
Microsoft.Sharepoint.Client
Microsoft.Sharepoint.Client.Runtime
Windows.Base

using System;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using System.Linq;
using System.IO;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using System.Text;
using Microsoft.SharePoint.Client;
using ClientOM = Microsoft.SharePoint.Client;
using Word = Microsoft.Office.Word.Server;
using Microsoft.Office.Word.Server.Conversions;

namespace DocumentMerge.VisualWebPart1
{
    [ToolboxItemAttribute(false)]
    public class VisualWebPart1 : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/DocumentMerge/VisualWebPart1/VisualWebPart1UserControl.ascx";

        protected override void CreateChildControls()
        {
            System.Web.UI.Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
            base.CreateChildControls();
            Button btnSubmit = new Button();
            btnSubmit.Text = "Merge Reports";
            btnSubmit.Click += new EventHandler(OnSubmitClick);
            Controls.Add(btnSubmit);
        }

        void OnSubmitClick(object sender, EventArgs e)
        {
            // String to store the output path
            string outputPath = string.Format(@"{0}/masterreport-{1}.docx", SPContext.Current.RootFolderUrl, DateTime.Now.ToString("ddMMyyyy"));

            // String containing the blank document part for our new DOCX
            string strEmptyMainPart = "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" +
            "<w:document xmlns:w='http://schemas.openxmlformats.org/wordprocessingml/2006/main'>" +
            "<w:body><w:p><w:r><w:t></w:t></w:r></w:p></w:body></w:document>";

            // In-memory stream for our consolidated WSR DOCX.
            MemoryStream memOut = new MemoryStream();

            // Out output document's OpenXML object
            WordprocessingDocument outputDoc = WordprocessingDocument.Create(memOut, DocumentFormat.OpenXml.WordprocessingDocumentType.Document);

            MainDocumentPart mainPart = outputDoc.AddMainDocumentPart();

            Stream partStream = mainPart.GetStream();
            UTF8Encoding encoder = new UTF8Encoding();

            // Add our blank main part string to the newly created document
            Byte[] buffer = encoder.GetBytes(strEmptyMainPart);
            partStream.Write(buffer, 0, buffer.Length);

            // Save the document in memory
            mainPart.Document.Save();

            SPListItemCollection files = SPContext.Current.List.Items;

            int id = 1;
            foreach (SPListItem item in files)
            {
                SPFile inputFile = item.File;

                string altChunkId = "AltChunkId" + id;
                id++;
                byte[] byteArray = inputFile.OpenBinary();

                AlternativeFormatImportPart chunk = outputDoc.MainDocumentPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.WordprocessingML,
                    altChunkId);

                using (MemoryStream mem = new MemoryStream())
                {
                    mem.Write(byteArray, 0, (int)byteArray.Length);
                    mem.Seek(0, SeekOrigin.Begin);
                    chunk.FeedData(mem);
                }

                AltChunk altChunk = new AltChunk();
                altChunk.Id = altChunkId;

                outputDoc.MainDocumentPart.Document.Body.InsertAfter(altChunk,
                    outputDoc.MainDocumentPart.Document.Body.Elements<Paragraph>().Last());
                outputDoc.MainDocumentPart.Document.Save();
            }

            outputDoc.Close();

            memOut.Seek(0, SeekOrigin.Begin);

            ClientContext clientContext = new ClientContext(SPContext.Current.Site.Url);
            ClientOM.File.SaveBinaryDirect(clientContext, outputPath, memOut, true);

            // Conversion

            string docPath = string.Format(@"{0}{1}", SPContext.Current.Site.Url.Replace(@"\\", ""), outputPath);
            //string pdfPath = docPath.Replace(".docx", ".pdf");

            ConversionJobSettings JobSettings = new ConversionJobSettings();
            JobSettings.OutputFormat = SaveFormat.Document;
            JobSettings.OutputSaveBehavior = SaveBehavior.AlwaysOverwrite;

            ConversionJob ConvJob = new ConversionJob("Word Automation Services", JobSettings);
            ConvJob.UserToken = SPContext.Current.Site.UserToken;
            ConvJob.AddFile(docPath, docPath);
            ConvJob.Start();

        }
    }
}

Share

Leggi tutto