July 28th, 2010 by Jeff
No comments »
I’ve built a virtual machine to learn from a few weeks ago. Since then I’ve been updating bookmarks and watching #SharePoint on Twitter to see what’s new. Below are some of my favorite download links to share with people regarding SharePoint 2010.
2010 Information Worker Virtual Machine (RTM) – AWESOME!!
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=751fa0d1-356c-4002-9c60-d539896c66ce
Technical diagrams
http://technet.microsoft.com/en-us/library/cc263199.aspx
MCPD & MCITP Certifications
http://razi.spaces.live.com/blog/cns!612EA30171E9AE3A!1836.entry?wa=wsignin1.0&sa=739400126
Changes in SharePoint Designer 2010
http://technet.microsoft.com/en-us/library/cc179083.aspx
Cumulative Updates
http://blogs.architectingconnectedsystems.com/blogs/cjg/archive/2010/07/22/The-first-cumulative-update-for-SharePoint-2010-family-has-been-released.aspx
SharePoint Manager 2010
http://spm.codeplex.com/
Compare Editions
http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx
Developer Dashboard Toggle
stsadm -o setproperty -pn developer-dashboard -pv ondemand
stsadm -o setproperty -pn developer-dashboard -pv on
stsadm -o setproperty -pn developer-dashboard -pv off

July 11th, 2010 by Jeff
No comments »
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.
Just use “SendMail.exe” with parameter 5 being the text file full path and name.
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);
}
}
}
July 6th, 2010 by Jeff
No comments »
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 Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\web.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. 
Before (out of the box)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
<system.web>
<webServices>
<protocols>
<remove name="HttpGet" />
<remove name="HttpPost" />
<remove name="HttpPostLocalhost" />
<add name="Documentation" />
After (unlocked for development)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
<add name="HttpPostLocalhost" />
<add name="Documentation" />

July 3rd, 2010 by Jeff
No comments »
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?
- Easy to repeat
- Easy to test
- 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:
- 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.
- 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.
- 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! 

June 12th, 2010 by Jeff
No comments »
Oh yeah, time for fun stuff! There are only maybe 50 people on the entire planet that care about this but here goes nothing…
The Privacy class has enumerations which are fine for C# IDE coding but if you ever run a direct TSQL select against the SSP database those become hard to read. [UserMemberships.ItemSecurity] on the Shared Service Provider database stores these raw integer values if you ever need to query Membership data directly. And here they are:
http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.membergroup.sourcereference.aspx
| Contacts |
2 |
| Manager |
8 |
| NotSet |
|
| Organization |
4 |
| Private |
16 |
| Public |
1 |
SELECT UserProfile_Full.NTName, MemberGroup.Url, MemberGroup.Description, MemberGroup.LastUpdate,
MemberGroup.MemberCount, MemberGroup.WebID, UserMemberships.GroupTitle, UserMemberships.GroupType,
UserMemberships.ItemSecurity, UserMemberships.PolicyId
FROM UserProfile_Full
INNER JOIN UserMemberships ON UserProfile_Full.RecordID = UserMemberships.RecordId
INNER JOIN MemberGroup ON UserMemberships.MemberGroupId = MemberGroup.Id
WHERE (UserProfile_Full.NTName = N‘domain\user’)

June 7th, 2010 by Jeff
No comments »
May 12th, 2010 by Jeff
1 comment »
Have you ever wanted to add a web part to a SharePoint page (New, Edit, Display Form) and not found the “Edit Page” option under Site Actions? Here’s a little trick for getting into Edit Page mode.

Add ?PageView=Shared&ToolPaneView=2 to the end of your URL and hit enter.
You’ll now be in edit mode and can add additional web parts to your page. Easy! 

May 6th, 2010 by Jeff
No comments »
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 (www.sharepointdev.net) 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)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xmp>
<xsl:copy-of select="*"/>
</xmp>
</xsl:template>
</xsl:stylesheet>
April 29th, 2010 by Jeff
No comments »
Yesterday I found some great articles on how to create SSP search scopes and SSP Managed Properties via code. This isn’t for developers. This is for administrators! If you need to repeat something with high quality a console EXE in Visual Studio is a great way to script against SharePoint 2007 (no offense to PowerShell in 2010).
Bundling these up as Console EXE that take in paraneters like args[0] allows you to easily build CMD files that can run many commands (even across many farms). Excel fill down is my favorite way of doing this … then you just copy/paste over to CMD! 

static void Main(string[] args)
{
//USAGE
//0= SSP Name
//1= Root site URL prefix
ServerContext serverctx = ServerContext.GetContext(args[0]);
SearchContext searchctx = SearchContext.GetContext(serverctx);
Scopes scopes = new Scopes(searchctx);
Scope newScope = scopes.AllScopes.Create("RecordsActiveArchived", string.Empty, null, true,
"results.aspx", ScopeCompilationType.AlwaysCompile);
string[] urls =
{"/sites/records_mgmt/dept1/Lists/Active",
"/sites/records_mgmt/dept1/Lists/Archived",
"/sites/records_mgmt/dept2/Lists/Active",
"/sites/records_mgmt/dept2/Lists/Archived",
"/sites/records_mgmt/dept3/Lists/Active",
"/sites/records_mgmt/dept3/Lists/Archived"};
foreach (string url in urls)
{
newScope.Rules.CreateUrlRule(ScopeRuleFilterBehavior.Include, UrlScopeRuleType.Folder, args[1] + url);
}
newScope.Update();
}
April 25th, 2010 by Jeff
1 comment »
Admins and Devs seem different. They often argue, yet can learn from each other. I’ve done both and neither is the complete picture. Below is an idea for scripting, scaling, and growing by learning both. “DevAdmin” is a role with incredible potential. Please leave a comment, email me, or send a tweet. I’d really like to hear your feedback.
| Dev |
|
Admin |
- Says “yes”
- Goal = More features
-
Liberal approach
|
|
- Says “no”
-
Goal = More stability
- Conservative approach
|
Above is my stereotype of both groups. While not perfect it’s a useful frame of reference. When speaking to one group (or the other) keep their unique perspective in mind to communicate more clearly. Below is an outline for mixing both to create a more balanced IT worker:
RDP sucks at scaling. But it’s great for small tasks. How do you admin 300 servers? Hmm … that’s a bunch of windows to juggle!
I developed a working concept called the “grid” script that would place real-time configuration on a single page. Each machine/server is a vertical column. Each configuration point is a row. On a single page I can tell exactly what settings are missing, where changes are needed, and ensure high quality with lower costs. I must be a DEV to code this tool. I must be an ADMIN to read and use it.
http://spdash.codeplex.com/
I’ve reserved the URL above to place my code and EXE once complete for all to enjoy. More to come soon …


The technology environment will only grow more complex. ADMINs must learn some DEV (script, powershell, dot net, etc.) to remain marketable. DEVs must learn some ADMIN (performance, capacity, uptime) to know how to scale up their application and ensure stable delivery to end users.
Related Posts