<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7235227623336854018</id><updated>2011-07-28T13:48:35.687-04:00</updated><category term='DCOM'/><category term='SiteDefinition'/><category term='Utility'/><category term='Feature'/><category term='Publishing'/><category term='ContentType'/><category term='Errors'/><category term='MOSS2007'/><category term='Workflow'/><category term='MySites'/><category term='Security'/><category term='MetaData'/><category term='BestPractice'/><title type='text'>SharePoint Code Block</title><subtitle type='html'>MOVED TO CORYPETERS.NET</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-4198120946434850839</id><published>2009-01-21T09:59:00.001-05:00</published><updated>2009-01-21T09:59:09.772-05:00</updated><title type='text'></title><content type='html'>&lt;span xmlns=''/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-4198120946434850839?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/4198120946434850839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=4198120946434850839' title='37 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/4198120946434850839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/4198120946434850839'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2009/01/blog-post.html' title=''/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>37</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-3373031895342398880</id><published>2008-10-19T13:06:00.001-04:00</published><updated>2008-10-19T13:07:10.074-04:00</updated><title type='text'>The blog has moved!</title><content type='html'>I've moved my blog to my own hosting and plan to be posting more often on my new site.&lt;br /&gt;&lt;br /&gt;Please check it out at:&lt;br /&gt;&lt;a href="http://corypeters.net"&gt;http://corypeters.net&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-3373031895342398880?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/3373031895342398880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=3373031895342398880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/3373031895342398880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/3373031895342398880'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/10/blog-has-moved.html' title='The blog has moved!'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-7844028816451214118</id><published>2008-08-27T10:38:00.010-04:00</published><updated>2008-08-27T10:56:35.202-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Feature'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>SharePoint Permission Strings</title><content type='html'>&lt;p&gt;SharePoint uses permission or rights strings in numerous places including setting permissions for Custom Actions in your feature XML. A colleague asked this question recently and I had to lookup the answer so I decided I would post for my own reference.&lt;/p&gt;&lt;table width="100%" cellpadding="5" cellspacing="2"&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;AddAndCustomizePages&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Windows SharePoint Services–compatible editor.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;AddDelPrivateWebParts&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Add or remove personal Web Parts on a Web Part Page.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;AddListItems&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Add items to lists, add documents to document libraries, and add Web discussion comments.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ApplyStyleSheets&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Apply a style sheet (.css file) to the Web site.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ApplyThemeAndBorder&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Apply a theme or borders to the entire Web site.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ApproveItems&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Approve a minor version of a list item or document.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;BrowseDirectories&lt;/b&gt;&lt;/td&gt;&lt;td&gt;Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;BrowseUserInfo&lt;/b&gt;&lt;/td&gt;&lt;td&gt; View information about users of the Web site.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;CancelCheckout&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Discard or check in a document which is checked out to another user.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;CreateAlerts&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Create e-mail alerts.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;CreateGroups&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Create a group of users that can be used anywhere within the site collection.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;CreateSSCSite&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Create a Web site using Self-Service Site Creation.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;DeleteListItems&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Delete items from a list, documents from a document library, and Web discussion comments in documents.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;DeleteVersions&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Delete past versions of a list item or document.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;EditListItems&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;EditMyUserInfo&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Allows a user to change his or her user information, such as adding a picture.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;EmptyMask&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Has no permissions on the Web site. Not available through the user interface.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;EnumeratePermissions&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Enumerate permissions on the Web site, list, folder, document, or list item.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;FullMask&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Has all permissions on the Web site. Not available through the user interface.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ManageAlerts&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Manage alerts for all users of the Web site.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ManageLists&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Create and delete lists, add or remove columns in a list, and add or remove public views of a list.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ManagePermissions&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Create and change permission levels on the Web site and assign permissions to users and groups.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ManagePersonalViews&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Create, change, and delete personal views of lists.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ManageSubwebs&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.   &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ManageWeb&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the &lt;b&gt;Site Collection Features&lt;/b&gt; page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;Open&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Allow users to open a Web site, list, or folder to access items inside that container.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;OpenItems&lt;/b&gt;&lt;/td&gt;&lt;td&gt; View the source of documents with server-side file handlers.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;UpdatePersonalWebParts&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Update Web Parts to display personalized information.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;UseClientIntegration&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Use features that launch client applications; otherwise, users must work on documents locally and upload changes.   &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;UseRemoteAPIs&lt;/b&gt;&lt;/td&gt;&lt;td&gt; Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ViewFormPages&lt;/b&gt;&lt;/td&gt;&lt;td&gt; View forms, views, and application pages, and enumerate lists.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ViewListItems&lt;/b&gt;&lt;/td&gt;&lt;td&gt; View items in lists, documents in document libraries, and view Web discussion comments.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ViewPages&lt;/b&gt;&lt;/td&gt;&lt;td&gt; View pages in a Web site.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ViewUsageData&lt;/b&gt;&lt;/td&gt;&lt;td&gt; View reports on Web site usage.  &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;ViewVersions&lt;/b&gt;&lt;/td&gt;&lt;td&gt; View past versions of a list item or document.  &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx"&gt;Source&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-7844028816451214118?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/7844028816451214118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=7844028816451214118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/7844028816451214118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/7844028816451214118'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/08/sharepoint-permission-strings.html' title='SharePoint Permission Strings'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-1804301235983702013</id><published>2008-07-21T11:56:00.022-04:00</published><updated>2008-07-23T13:20:29.933-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MetaData'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><category scheme='http://www.blogger.com/atom/ns#' term='BestPractice'/><title type='text'>Properly Populating and Retrieving SharePoint Field Data</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;SharePoint uses a lot of field types that have different underlying schemas, delimiters and formats. I see a lot of people reverse engineer the field information and "hack" the data into the list using a string such as "1;#Title" for a lookup field. Well this isn't exactly best practice so I've put together a reference table below to assist in using the correct data types for populating or retrieving information from a SharePoint list.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Lookup Field&lt;/h2&gt;&lt;br /&gt;Field Class: SPFieldLookup&lt;br /&gt;Field Value Class: SPFieldLookupValue&lt;br /&gt;&lt;br /&gt;Populating Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;item["FieldName"] = new SPFieldLookupValue("Title"); // SharePoint will do the lookup as long as the LookupValue's are unique&lt;br /&gt;item.Update();&lt;br /&gt;&lt;/code&gt;or&lt;code class="prettyprint"&gt;&lt;br /&gt;item["FieldName"] = new SPFieldLookupValue(1, "Title");&lt;br /&gt;item.Update();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Retrieving Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;SPFieldLookupValue itemValue = item["FieldName"] as SPFieldLookupValue;&lt;br /&gt;int id = itemValue.LookupId;&lt;br /&gt;string value = itemValue.LookupValue;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;Multiple Lookup Field&lt;/h2&gt;&lt;br /&gt;Field Class: SPFieldLookup&lt;br /&gt;Field Value Class: SPFieldLookupValueCollection&lt;br /&gt;&lt;br /&gt;Populating Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;SPFieldLookupValueCollection itemValues = SPFieldLookupValueCollection();&lt;br /&gt;itemValues.Add(new SPFieldLookupValue(1, "Title"));&lt;br /&gt;item["FieldName"] = itemValues;&lt;br /&gt;item.Update();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Retrieving Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;SPFieldLookupValueCollection itemValues = item["FieldName"] as SPFieldLookupValueCollection;&lt;br /&gt;foreach (SPFieldLookupValue itemValue in itemValues)&lt;br /&gt;{&lt;br /&gt;    int id = itemValue.LookupId;&lt;br /&gt;    string value = itemValue.LookupValue;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;User Field&lt;/h2&gt;&lt;br /&gt;Field Class: SPFieldUser&lt;br /&gt;Field Value Class: SPFieldUserValue&lt;br /&gt;&lt;br /&gt;Populating Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;web.EnsureUser(@"domain\username");&lt;br /&gt;SPUser user = web.AllUsers[@"domain\username"];&lt;br /&gt;item["FieldName"] = user;&lt;br /&gt;item.Update();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Retrieving Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;string currentValue = item["FieldName"].ToString();&lt;br /&gt;SPFieldUser userField = list.Fields.GetFieldByInternalName("FieldName");&lt;br /&gt;SPFieldUserValue itemValue = (SPFieldUserValue)userField.GetFieldValue(currentValue);&lt;br /&gt;SPUser user = itemValue.User;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;URL Field&lt;/h2&gt;&lt;br /&gt;Field Class: SPFieldUrl&lt;br /&gt;Field Value Class: SPFieldUrlValue&lt;br /&gt;&lt;br /&gt;Populating Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;SPFieldUrlValue urlValue = new SPFieldUrlValue();&lt;br /&gt;urlValue.Url = "http://www.google.com";&lt;br /&gt;urlValue.Description = "Google";&lt;br /&gt;item["FieldName"] = urlValue;&lt;br /&gt;item.Update();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Retrieving Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;SPFieldUrlValue urlValue = new SPFieldUrlValue(item["FieldName"].ToString());&lt;br /&gt;string url = urlValue.Url;&lt;br /&gt;string description = urlValue.Description;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;Multiple Choice Field&lt;/h2&gt;&lt;br /&gt;Field Class: SPFieldMultiChoice&lt;br /&gt;Field Value Class: SPFieldMultiChoiceValue&lt;br /&gt;&lt;br /&gt;Populating Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;SPFieldMultiChoiceValue itemValue = new SPFieldMultiChoiceValue();&lt;br /&gt;itemValue.Add("Choice 1");&lt;br /&gt;itemValue.Add("Choice 2");&lt;br /&gt;itemValue.Add("Choice 3");&lt;br /&gt;item["FieldName"] = itemValue;&lt;br /&gt;item.Update();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Retrieving Information:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;SPFieldMultiChoiceValue itemValue = new SPFieldMultiChoiceValue(item["FieldName"].ToString());&lt;br /&gt;foreach (string choice in itemValue)&lt;br /&gt;{&lt;br /&gt;    // value is in choice&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-1804301235983702013?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/1804301235983702013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=1804301235983702013' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/1804301235983702013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/1804301235983702013'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/07/properly-populating-and-retrieving.html' title='Properly Populating and Retrieving SharePoint Field Data'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-8336987419874797206</id><published>2008-06-26T17:56:00.005-04:00</published><updated>2008-06-30T09:09:27.467-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='MySites'/><category scheme='http://www.blogger.com/atom/ns#' term='Errors'/><category scheme='http://www.blogger.com/atom/ns#' term='Utility'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>Creating MySites Programmatically</title><content type='html'>Instead of asking every user to click on "My Site" and have the site provisioned for them it's sometimes nice to already have the site created... or create it as part of the Employee Intake process. This is especially true if the My Site plays a role in a custom application as it did for one of my clients.&lt;br /&gt;&lt;br /&gt;Here's a snippet to get you started:&lt;br /&gt;&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;using (SPSite site = new SPSite(url))&lt;br /&gt;{               &lt;br /&gt;    UserProfileManager profileManger = new UserProfileManager(ServerContext.GetContext(site));&lt;br /&gt;    UserProfile profile = profileManger.GetUserProfile(@"domain\user");&lt;br /&gt;    profile.CreatePersonalSite();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;However, I kept getting the following error message:&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic;"&gt;You do not have access to create this personal site.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now.. I'm an admin on the box and within SharePoint but it turns out you will see this error if your user does not have access to Shared Services. You'll either need to impersonate a higher user using SPSecurity or, in my case, simply right click on your command line application and choose "Run as..." and enter the credentials for your Shared Services administrator.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-8336987419874797206?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/8336987419874797206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=8336987419874797206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/8336987419874797206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/8336987419874797206'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/06/creating-mysites-programmatically.html' title='Creating MySites Programmatically'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-6209529010111328289</id><published>2008-06-12T16:12:00.005-04:00</published><updated>2008-12-13T07:49:27.898-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>Denying User Access At The Site Level</title><content type='html'>It's a pretty &lt;a href="http://blah.winsmarts.com/2007-4-SharePoint_2007__Fine_grained_permission_control.aspx"&gt;well&lt;/a&gt; &lt;a href="http://blogs.msdn.com/joelo/archive/2007/06/29/sharepoint-groups-permissions-site-security-and-depreciated-site-groups.aspx"&gt;known &lt;/a&gt;&lt;a href="http://objectmix.com/sharepoint/398038-how-deny-access-single-user.html"&gt;fact &lt;/a&gt;that SharePoint cannot deny access for a user below the Web Application level as shown in the screenshot below. Sadly there will be no code samples for this one as it's pretty proprietary stuff.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IKxcvmXud5Y/SFGE3HGf-8I/AAAAAAAAAG0/HYWb4__90u4/s1600-h/adduserstocustompolicy.png"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_IKxcvmXud5Y/SFGE3HGf-8I/AAAAAAAAAG0/HYWb4__90u4/s320/adduserstocustompolicy.png" alt="" id="BLOGGER_PHOTO_ID_5211092326178356162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, one of my clients had this exact problem. Except that the answer "Sorry, SharePoint doesn't do that." didn't solve the underlying business problem. Here is a scenario and the provided "Out-Of-The-Box Solution".&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Users are given access to a site through a single group "SharePoint Users".&lt;/li&gt;&lt;li&gt;This "SharePoint Users" group is used throughout the rest of the site collection so simply modifying it is not an option.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;John Doe is a member of this "SharePoint Users" group but because of an "Ethical Wall" (Law Firm jargon for blocking one lawyer from seeing another lawyers documents) John Doe cannot have access to this site.&lt;/li&gt;&lt;/ol&gt;After talking with a Microsoft Employee at a training session the recommended approach is to either create smaller groups... ie: "SharePoint Users" and "SharePoint Users Without John" and to maintain these at the site collection level or to simply remove the "SharePoint Users" group from the site and add all your users directly.&lt;br /&gt;&lt;br /&gt;We chose to do the latter in an automated fashion. What we ended up with is as follows.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A custom SQL table that holds the list of people that should be denied access to a particular site.&lt;/li&gt;&lt;li&gt;A Timer Job that constantly ensures that those people are actually denied.&lt;/li&gt;&lt;li&gt;A configuration panel in Central Administration to maintain which web applications are using the functionality and to hold configuration options.&lt;/li&gt;&lt;li&gt;A data input panel built into each SharePoint site to allow administrators to deny users and to view who is currently denied.&lt;/li&gt;&lt;/ol&gt;The bulk of the code exists in the Timer Job. The Timer Job is responsible for breaking the inheritance, looping through all of the current security, removing groups and readding users with the proper security, and finally removing all the denied users.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;This solution has the following pluses&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Will loop through both SharePoint Groups and AD Groups no matter how complicated the nested group structure is&lt;/li&gt;&lt;li&gt;Makes a manual process somewhat automated to ensure less user error&lt;/li&gt;&lt;li&gt;Although it creates an administrative problem for adding new users (users will not have acecss when they should) it does protect against the more dangerous scenario (a user does have access when they shouldn't)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-6209529010111328289?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/6209529010111328289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=6209529010111328289' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/6209529010111328289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/6209529010111328289'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/06/denying-user-access-at-site-level.html' title='Denying User Access At The Site Level'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_IKxcvmXud5Y/SFGE3HGf-8I/AAAAAAAAAG0/HYWb4__90u4/s72-c/adduserstocustompolicy.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-1144516110160491923</id><published>2008-06-11T11:10:00.012-04:00</published><updated>2008-06-11T11:41:14.426-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Publishing'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>Hiding Empty Publishing Fields in a Page Layout</title><content type='html'>Most of the time when you're rendering web content that content will exist in a container or have a header or a footer, etc. If you're rendering an HTML publishing field within SharePoint the user could have simply left the field blank (unless you make the field required of course). In this case you probably don't want to render the container/header/footer if there isn't going to be any content. So let's get down to business...&lt;br /&gt;&lt;br /&gt;First you have you're normal code&lt;br /&gt;&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;&amp;lt;h3&gt;Publishing Header&amp;lt;/h3&amp;gt;&lt;br /&gt;&amp;lt;publishingwebcontrols:richhtmlfield id="PublishingContent1" fieldname="PublishingContent" runat="server"&amp;gt;&amp;lt;/publishingwebcontrols:richhtmlfield&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This is fine but we don't want "Publishing Header" showing if there is no content in the field. So what do we do? First drop the following code at the beginning of the "PlaceHolderMain" in your custom page layout.&lt;br /&gt;&lt;br /&gt;&lt;code class="prettyprint"&gt;&amp;lt;script runat="server"&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;        public static bool FieldHasValue(SPListItem item, string fieldName)&lt;br /&gt;        {&lt;br /&gt;            if (item.Fields.ContainsField(fieldName) &amp;&amp; item[fieldName] != null)&lt;br /&gt;            {&lt;br /&gt;                string html = item[fieldName].ToString();&lt;br /&gt;                Regex regex = new Regex(@"&lt;/?\w+((\s+\w+(\s*=\s*(?:"".*?""|'.*?'|[^'""&gt;\s]+))?)+\s*|\s*)/?&gt;", RegexOptions.Singleline);&lt;br /&gt;                MatchCollection matches = regex.Matches(html);&lt;br /&gt;                foreach (Match match in matches)&lt;br /&gt;                {&lt;br /&gt;                    html = html.Replace(match.Value, "");&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                html = html.Replace("\n", "").Trim();&lt;br /&gt;                return (html.Length &gt; 0);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            return false;&lt;br /&gt;        } &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;code class="prettyprint"&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now we just have to use some inline ASP to check the field before we do our rendering.&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;   if (FieldHasValue(item, "PublishingContent"))&lt;br /&gt;         Response.Write("&amp;lt;h3&amp;gt;Publishing Header&amp;lt;/h3&amp;gt;");&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;%&amp;gt; &lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;&amp;lt;publishingwebcontrols:richhtmlfield id="PublishingContent1" fieldname="PublishingContent" runat="server"&amp;gt;&amp;lt;/publishingwebcontrols:richhtmlfield&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-1144516110160491923?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/1144516110160491923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=1144516110160491923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/1144516110160491923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/1144516110160491923'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/06/hiding-empty-publishing-fields-in-page.html' title='Hiding Empty Publishing Fields in a Page Layout'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-7206826977516174565</id><published>2008-06-10T15:39:00.003-04:00</published><updated>2008-06-11T11:42:51.405-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Publishing'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>Deleting a Page Layout or Master Page that is no longer referenced</title><content type='html'>&lt;a href="http://support.microsoft.com/kb/926812"&gt;There is a fairly well known bug&lt;/a&gt; that prevents you from deleting both page layouts and master pages even though they are no longer in use. If you do try to delete either a page layout or master page you will receive the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(255, 0, 0);"&gt;"This item cannot be deleted because it is still referenced by other pages. "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.katriendg.com/aboutdotnet/2007_1_cannot_delete_page_layout.aspx"&gt;There is a workaround for this problem&lt;/a&gt; but it requires SharePoint designer. Here is my similar solution except that no SharePoint designer is required.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Browse to the "Master Page Gallery".&lt;/li&gt;&lt;li&gt;Select "Actions" and "Open with Windows Explorer"&lt;/li&gt;&lt;li&gt;Right click on the white area and select "New" &gt; "Folder"&lt;/li&gt;&lt;li&gt;Drag the page layout or master page into the new folder&lt;/li&gt;&lt;li&gt;Right click on the new folder and select "Delete"&lt;/li&gt;&lt;li&gt;Confirm the box&lt;/li&gt;&lt;/ol&gt;Done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-7206826977516174565?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/7206826977516174565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=7206826977516174565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/7206826977516174565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/7206826977516174565'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/06/deleting-page-layout-or-master-page.html' title='Deleting a Page Layout or Master Page that is no longer referenced'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-3572002697568625849</id><published>2008-01-08T09:49:00.009-05:00</published><updated>2008-07-23T13:23:34.815-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><category scheme='http://www.blogger.com/atom/ns#' term='BestPractice'/><category scheme='http://www.blogger.com/atom/ns#' term='Workflow'/><title type='text'>Properly Checking Metadata in SharePoint Workflow</title><content type='html'>Since you want your SharePoint workflow to be as fault tolerant as possible it is always a good idea to use the following method when you are accessing fields from an SPListItem. This is especially true if they are custom fields that are deployed via a Site Column or Content Type as your workflow will receive nasty errors such as "Null Reference Exception" and "Array Out of Bounds Exception" otherwise.&lt;br /&gt;&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;if (workflowProperties.Item.Fields.ContainsField("Custom Field") &amp;&amp; workflowProperties.Item["Custom Field"] != null &amp;&amp; workflowProperties.Item["Custom Field"].Equals("Some Value"))&lt;br /&gt;{&lt;br /&gt;// continue with rest of code&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-3572002697568625849?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/3572002697568625849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=3572002697568625849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/3572002697568625849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/3572002697568625849'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/01/properly-checking-metadata-in.html' title='Properly Checking Metadata in SharePoint Workflow'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-6473555156656365743</id><published>2008-01-08T09:43:00.000-05:00</published><updated>2008-01-08T11:02:48.030-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Publishing'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>Updating an Underlying Page Layout</title><content type='html'>Just a quick post as someone recently asked me this question and it is fairly hidden in the site.&lt;br /&gt;&lt;br /&gt;Although changing the page layout of an existing page could be considered equivalent pulling the carpet out from under something it is possible none-the-less. Keep in mind however that if any data was displayed on the page that is not accounted for in the new page layout then that information will no longer be seen by your users. Also if you had web part zones the web parts will probably need reorganizing as they will fall into different zones.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Bring up the publishing toolbar by selecting Site Actions &gt; Edit Page&lt;/li&gt;&lt;li&gt;From the publishing toolbar select Page &gt; Page Settings&lt;/li&gt;&lt;li&gt;From the page settings screen you can select a new page layout and save your changes by clicking "Ok"&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-6473555156656365743?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/6473555156656365743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=6473555156656365743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/6473555156656365743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/6473555156656365743'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2008/01/updating-underlying-page-layout.html' title='Updating an Underlying Page Layout'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-69864473631739134</id><published>2007-12-20T09:28:00.000-05:00</published><updated>2007-12-20T09:46:35.254-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Errors'/><category scheme='http://www.blogger.com/atom/ns#' term='DCOM'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>DCOM Errors</title><content type='html'>This is an issue that I've ran in to multiple times now. I haven't figured out the exact reason that these problems start occurring but it seems to be related to running Windows Update.&lt;br /&gt;&lt;br /&gt;Here's the issue:&lt;br /&gt;&lt;br /&gt;You'll start seeing lots of DCOM errors in your System Log, usually one every minute or so. These errors will look something like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID&lt;br /&gt;{INSERT_GUID_HERE}&lt;br /&gt;to the user DOMAIN\MOSSService SID (INSERT_SID_HERE).  This security permission can be modified using the Component Services administrative tool.Basically your MOSS Service account doesn't have the necessary permissions to one of the DCOM services. So let's fix that.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Go to Start &gt; Run. Type "regedit". Click OK.&lt;/li&gt;&lt;li&gt;Select the root node "My Computer".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Select Edit &gt; Find. And paste your GUID from the error in your system log into the search box and click "Find Next". Keep searching until you have a folder on the left and not the actual GUID itself.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now you know the name of the service that's lacking permissions in my case it was OSearch.&lt;/li&gt;&lt;li&gt;Now go to Start &gt; Administrative Tools &gt; Component Services &gt; Expand Component Services &gt; Expand Computers &gt; Expand DCOM Config&lt;/li&gt;&lt;li&gt;Right click the service you found in my case "OSearch" and choose properties.&lt;/li&gt;&lt;li&gt;Select the "Security" tab.&lt;/li&gt;&lt;li&gt;Under "Launch and Activation Permissions" click "Edit..."&lt;/li&gt;&lt;li&gt;Add your MOSS Service Account and ensure that he has both "Local Launch" and "Local Activation" permissions.&lt;/li&gt;&lt;/ol&gt;Now you can back up and clear your event log and enjoy an error free event log once again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-69864473631739134?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/69864473631739134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=69864473631739134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/69864473631739134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/69864473631739134'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2007/12/dcom-errors.html' title='DCOM Errors'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7235227623336854018.post-6606894887173815313</id><published>2007-11-28T13:56:00.000-05:00</published><updated>2007-11-29T14:13:32.147-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ContentType'/><category scheme='http://www.blogger.com/atom/ns#' term='SiteDefinition'/><category scheme='http://www.blogger.com/atom/ns#' term='Feature'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS2007'/><title type='text'>Deploying Publishing Content Types via Site Definition</title><content type='html'>First let me say welcome to my blog!&lt;br /&gt;&lt;br /&gt;Recently I've been working on a project that involved some heavy branding of a custom publishing site.&lt;br /&gt;&lt;br /&gt;I had to create the following custom items:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Publishing Site Definitions&lt;/li&gt;&lt;li&gt;Master Pages&lt;/li&gt;&lt;li&gt;Site Columns&lt;/li&gt;&lt;li&gt;Content Types (Using the custom site columns)&lt;/li&gt;&lt;li&gt;Page Layouts (Using the custom content types)&lt;/li&gt;&lt;li&gt;Images&lt;/li&gt;&lt;li&gt;CSS Files&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;All of this had to be deployable via features and solutions.&lt;br /&gt;&lt;br /&gt;To accomplish this I created some custom site definitions and deployed the necessary branding files via a feature that was attached to the site definition. However, when my site definition was created my custom content types were not attached to the pages library resulting in a page that correctly used my page layout but was lacking the support fields behind the scenes.&lt;br /&gt;&lt;br /&gt;To remedy this I had to create an additional feature which I called my ContentTypeBindingFeature and attached it to my site definition. This solved my problem.&lt;br /&gt;&lt;br /&gt;Example code below:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;feature.xml&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;br /&gt;&amp;lt;Feature   &lt;br /&gt;   Id="INSERT_YOUR_GUID"&lt;br /&gt;   Title="Content Type Binder"&lt;br /&gt;   Description="Binds a specified content type to the pages library"&lt;br /&gt;   Scope="Web"&lt;br /&gt;   Hidden="TRUE"&lt;br /&gt;   Version="1.0.0.0"&lt;br /&gt;   xmlns="http://schemas.microsoft.com/sharepoint/"&gt;&lt;br /&gt; &amp;lt;elementmanifests&gt;&lt;br /&gt;   &amp;lt;elementmanifest location="ContentTypeBinding.xml"&gt;&lt;br /&gt; &amp;lt;/elementmanifests&gt;&lt;br /&gt;&amp;lt;/feature&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;ContentTypeBinding.xml&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;br /&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;&lt;br /&gt; &amp;lt;ContentTypeBinding ContentTypeId="INSERT_YOUR_CONTENT_TYPE_ID" ListUrl="Pages" /&gt;&lt;br /&gt;&amp;lt;/Elements&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7235227623336854018-6606894887173815313?l=sharepointcodeblock.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sharepointcodeblock.blogspot.com/feeds/6606894887173815313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7235227623336854018&amp;postID=6606894887173815313' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/6606894887173815313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7235227623336854018/posts/default/6606894887173815313'/><link rel='alternate' type='text/html' href='http://sharepointcodeblock.blogspot.com/2007/11/custom-content-types-and-site.html' title='Deploying Publishing Content Types via Site Definition'/><author><name>Cory Peters</name><uri>http://www.blogger.com/profile/09266771165654103518</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
