Tag Archives: SharePoint

SharePoint Governance – Guiding Principles

A few thoughts below that might help others with their implementation.   These are not version or technology specific.   They are meant more as a guidepost to use for making effective collaboration decisions.  Governance doesn’t need to be a 30 page white paper nobody reads.  It can be as simple as a single page with common sense ideas.

 

1. Business owns content – Technology has accountability for availability, performance, and feature set. However, all content should have a business owner who understands the update, security, and retention needs of the data they publish.

2. All content has an owner – Each content item in the system should have an easily identifiable business owner. As people leave the company, ownership will transfer to their manager so long term accountability is preserved.

3. One copy of a document – Duplication should be avoided where possible. Use links to point back to the authoritative source. Email, IM, and other communication should link when possible. This way stakeholders reference the most current copy to stay on the same page.

4. Tag early and Tag often – Metadata tags can help drive search relevance, legal retention, and document context. Encourage tagging on documents and pages when possible. However, too many tags can water down relevance. Deploying a short list of common tags across the company helps give a common framework to navigate across many sites.

5. Grant only needed access – A security model based on least privileged access is more secure and easier to support. Give users the rights they need to perform job functions, but not more. Untrained users with extra buttons can create support issues accidentally. Pair training with access to maintain a safe stable environment for everyone.

6. Native first, code last – Development should only be considered after first testing native Microsoft features. Code, when used carefully, can be very practical. More complex systems come with more support so keep it clean when possible. Operations, migration, and upgrades are all easier with less customization.

7. Two eyes on all code – Development and customization efforts should be peer reviewed at a minimum. A second set of eyes can help spot potential support issues and often suggest improvements.

8. Comply with regulations – Company-wide policies also apply to SharePoint. Acceptable use, copyrighted material, and general common sense help ensure we can be productive without creating new risks.

9. Rules only exist when enforced – Governance and compliance should be baked into the system configuration for success. Word DOCs only describe a rule, they don’t enforce it. For example, giving each site a storage quota via PowerShell ensures users cannot excessively upload and trigger capacity issues.

10. Learn then teach what you know – Encourage others to share their knowledge as well as content. As new tips and tricks are discovered, share them with colleagues so that training becomes a continuous activity in the core culture.

Manually Run “Pause Until” SharePoint Designer Workflows

Recently I needed to simulate a future lapse in time in order to manually trigger the “Pause Until” SharePoint Designer function.  In the example below, the SharePoint server is a local DEV virtual machine running in Oracle VirtualBox.  That means it receives time from the parent machine.

 

Action Steps

  1. Move VM host clock forward 1 day (24hours)
  2. Move VM guest clock forward 1 day (24 hours)
  3. Run the Powershell command “Get-SPTimerJob | ? {$_.name –like ‘*workf*’} | Start-SPTimerJob”

 

What the above steps will do is to simulate a future date and then trigger the SharePoint workflow engine.  If the engine finds any past-due activities (ex:  “Pause Until ___”) then it will execute those immediately.  Using this technique you can build “Pause Until ___” workflows and still test them to ensure everything completes as expected, without having to actually wait the full time.  Smile

 

image

image

image

image

Central Admin – one page with every icon

Solution:   One ASPX page which shows all Central Admins functions.

Background:  I was frustrated with clicking through the 8 different ASPX pages CA offers … or my lack of memory on where to find things.  For example, if you want “Timer Jobs” you need to first know to look under “Monitoring”.   That’s fine and it does make for an overall clean display.   However, I wanted to try something more streamlined for my DEV virtual machine.

  • Explore 14TEMPLATESiteTemplatesCENTRALADMIN
  • Copy “generalapplicationsettings.aspx” to “generalapplicationsettings.BAK”
  • Edit “generalapplicationsettings.aspx”  and insert the below content.
  • Open Central Admin with IE and click “General Application Settings”
  • You should now see a single page with every function.   From here “Ctrl+F” works great to quickly jump to functions.  No more clicking around guessing.  Just scroll the mouse wheel and you’re there.  Smile

TXT16 generalapplicationsettings.aspx

 

image

IIS 7.5 native SharePoint warm up (MUST SEE)

This one feature could be reason enough to upgrade to Windows Server 2008 R2 and IIS 7.5 when running SharePoint.  The unique ability to warm up memory cache while still serving users is something no basic scripting can achieve.  Please note: IISRESET seems to kill all workers and perform a classic flush followed by a warm up (brief outage).  However, INETMGR “recycle” on a single pool triggers the warm up in parallel for a zero outage experience.  Below is a diagram of my understanding of how this all works.  It’s not from TechNet … but hey … my budding art skills need more practice.  Hot

 

image

 

How to configure

  • Download x64 MSI from http://www.iis.net/download/ApplicationWarmUp
  • Login to Windows 2008 R2 as local admin and install
  • Open INETMGR and browse to the website that needs warm up
  • Open Application Warm-Up feature icon
  • Click Add Request and give the relative URL to the homepage ASPX (without / prefix)
  • Click Settings and check both boxes
  • Click Edit User Context, select “Set Username and Type only”, and provide Windows credentials.  This doesn’t have to be the farm account, but that’s what I used for simplicity.  Anyone with Read permission should work.

How to test

  • Open Internet Explorer to the homepage ASPX
  • Open CMD and Task Manager side-by-side
  • Type “IISRESET” and press enter
  • Type “APPCMD LIST WP” and press enter
  • Type “IISRESET” and press enter again
  • Refresh IE while watching Task Manager. 

You’ll see a new PID (process identifier) number for the newly created W3WP worker process.  The IE page should continue to load instantly without delay.  By running “APPCMD LIST WP” again you will see a new PID for the application pool.  The warm up feature has successfully created and warmed up a new worker thread without any outage.  The only downside I can foresee is the need for more RAM.   Running parallel W3WP threads requires more physical memory during the full process (recycle / warm up / release).

IIS 7.5 native SharePoint warm up (MUST SEE) from Jeff Jones on Vimeo.

image

image

image

image

image

Don’t Delay – PreUpgradeCheck Today!

More than 2010 upgrade readiness, this tool is a one stop 2007 best practices analyzer.   Most 2007 farms have dozens of small customizations.  Get started today because it will require time to take inventory and review the output.   The results help build a deep awareness of your system configs.  This command is read-only and safe to run in production any time, even during the work day.

So go ahead, RDP over and run “STSADM –O PREUPGRADECHECK” now!

http://bobfox.securespsite.com/foxblog/Lists/Posts/Attachments/120/PreupgradeCheck_2_3BF5F7FD.png

STSADM CMD with email output

Waiting and watching STSADM run on the CMD line is an exercise in patience.  Lately I’ve been incorporating two techniques to email myself updates for the freedom to walk away from the keyboard.

A quick command line EXE project allows me to send email by giving parameters (number 0-5).   If 5 is blank, no big deal just send a plain email with subject and body.   If 5 exists then attempt to open that text file, read content, and send as email body.

That’s great, but … how does this help me?  Great question!!

1) Send email at key script milestones

The freedom to walk away and receive alerts as progress continues allows you to be stay confident and know progress is moving forward.  Just add “SendMail.exe” inline with your existing CMD files to send an email at that step in the process.

 

2) Send email with script outcome

The detailed knowledge of what return value came from the CMD when it finished is helpful.   Imagine running a site move (STSADM backup/delete/restore) and heading out for dinner.   It’s very nice to get an email showing “Operation completed successfully” three times.  Smile   Just use “SendMail.exe” with parameter 5 being the text file full path and name.

image

image 

using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Mail;
using System.IO;
 
namespace SendMail
{
    class Program
    {
	static void Main(string[] args)
	{
		//0-from
		//1-to
		//2-subject
		//3-body
		//4-server
		//5-filename
		string textFile = "";
		if (!String.IsNullOrEmpty(args[5]))
		{
			//send text file as body
			TextReader tr = new StreamReader(args[5]);
			textFile = tr.ReadToEnd();
			tr.Close();
		}
		//create message
		Console.WriteLine("from {0} to {1} subject {2} body {3} on server {4}", args[0], args[1], args[2], args[3], args[4]);
		MailMessage message = new MailMessage(args[0], args[1], args[2], args[3]);
		//if file was given modify body
		if (textFile != "") message = new MailMessage(args[0], args[1], args[2], textFile);
		SmtpClient emailClient = new SmtpClient(args[4]);
		emailClient.Send(message);
		}
    }
}

Unlock ASMX for easy manual invoke (developers)

For SharePoint development I like to use the .ASMX web services for reading data.  Out of the box default security prohibits manual remote HTTP queries.  A quick edit to “C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12ISAPIweb.config” for changing <protocols> from “remove” to “add” and then you’ll be able to manually Invoke.

The raw XML returned by a manual invoke is incredibly valuable for developers.  Open-mouthed

Before (out of the box)

 
 
     
         
             
                 
                 
                 
                

image

After (unlocked for development)

 
 
     
         
             
                 
                 
                 
                

image

Always use CMD files

I rarely use absolutes but CMD files are amazing and you really should always use them.  For anything, no matter how small.

Why bother?  What’s in it for me?

  1. Easy to repeat
  2. Easy to test
  3. Can modify while running

The only cost is time.  It takes a little longer to build a CMD file and plan it out.  However, measure twice and cut once pays off with quality.  Let’s explore the benefits one at a time:

  1. Reusing a CMD file is very easy.  Search replace in Notepad++ can switch scope easily.  Also, input parameters like %1, %2, etc. can make the tool modular for using in a slightly different way quickly next time.
  2. Copy a CMD file to lower environments for practice is quick, easy, and helps mitigate risk.  Before you typo against production, try copying the file to a different server first.
  3. This is awesome and very little known!   While a CMD file is running (after you hit enter) you can still open Notepad.exe and modify the file.  Adding an extra line, commenting out with REM, or removing a line can all be done.  As long as CMD has not made it down to that line already you’re edits will be picked up as it steps down.   Great for real-time adjustments.

Thanks for reading!  Open-mouthed

image

FIXED – DeleteElementAddToMyColleaguesURL People Search

If you ever see the below People Search error go double check your indexed User Profile Properties.   I saw this recently and the root cause was a missing “Indexed” checkbox.   Enabling the Indexed checkbox for Account Name and crawling again fixed the issue.   Thanks to Puneet for the tip on this one.

System.NullReferenceException: Object reference not set to an instance of an object. at System.Xml.XmlNode.RemoveChild(XmlNode oldChild) at Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.DeleteElementAddToMyColleaguesURL(XmlNode result) at Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.CreateXmlDocument() at Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.SortBySocialDistance() at Microsoft.Office.Server.Search.WebControls.PeopleCoreResultsWebPart.GetXPathNavigator(String viewPath)

image





<xsl:copy-of select="*"/>