Wednesday, October 28, 2009

Sync WSS User Profile with AD

SPSite site = new SPSite("http://localhost");
SPWeb web = site.RootWeb;
SPList lstUser = web.Lists["User Information List"];
foreach (SPListItem itemUser in lstUser.Items)
{
SPPrincipalInfo info = SPUtility.ResolveWindowsPrincipal(site.WebApplication, itemUser["Account"].ToString(), SPPrincipalType.User, false);
if (info == null)
{
// User has been deleted
itemUser["Title"] = "***" + itemUser["Title"].ToString();
}
else if (info.PrincipalId < 0)
{
itemUser["Title"] = info.DisplayName;
itemUser["Department"] = info.Department;
itemUser["Job Title"] = info.JobTitle;
}
else
{
throw new Exception("");
}
itemUser.Update();
}

Wednesday, April 1, 2009

RAVE about Our Measurements

  • Relevant for the purpose: Does it measure the rightthing?
  • Adequate to find the desired changes: Can processchanges be detected with the system?
  • Valid & consistent from time to time: Can ameasurement be believed?
  • Easy (and inexpensive) to make the measurement(relatively)?

Why Do We Measure?

“We don’t know what we don’t know.

If we cannot express what we know in numbers,we don’t know much about it.

If we don’t know much about it, we cannot controlit.

If we cannot control it, we are at the mercy ofchance.”

Mikel Harry

“If we cannot express what we know in terms of numbers then ourknowledge is of a meager and unsatisfactory kind.”

Lord Kelvin