<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Shared Points for SharePoint</title><subtitle type="html">The blog of the SharePoint Team from Microsoft Consulting Services, Norway</subtitle><id>http://blogs.msdn.com/b/mcsnoiwb/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/mcsnoiwb/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2010-05-25T11:47:49Z</updated><entry><title>How to copy a file via remote desktop connection</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/06/29/how-to-copy-a-file-via-remote-desktop-connection.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/06/29/how-to-copy-a-file-via-remote-desktop-connection.aspx</id><published>2012-06-29T11:29:53Z</published><updated>2012-06-29T11:29:53Z</updated><content type="html">&lt;p&gt;In some cases, you may need to copy a file from your local computer to a server, or vice versa, via a remote desktop connection (RDP). In most cases, you can easily do it by exposing your local disks directly to the remote machine. But in some case, this is not possible. For example, where I work now, I have to RDP to one machine, and then from there to a third machine. Copying a log file from that external machine to my local PC for further investigation is then a challenge.&lt;/p&gt;  &lt;p&gt;Fortunately, I colleague of mine, Denis Heliszkowski, had a cunning solution. Starting on your source environment, follow these steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Copy (Ctrl-C) the file from the Explorer window&lt;/li&gt;    &lt;li&gt;Open WordPad and paste the document in there, it will then look something like this:     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/1651.image_5F00_4A268C06.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/6428.image_5F00_thumb_5F00_7FEBF72D.png" width="341" height="231" /&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Now, copy this file again, but now from WordPad.&lt;/li&gt;    &lt;li&gt;Switching to your target environment (typically your own PC)&lt;/li&gt;    &lt;li&gt;Open WordPad and paste into the empty document&lt;/li&gt;    &lt;li&gt;Again, copy this file from WordPad&lt;/li&gt;    &lt;li&gt;Open Explorer and paste&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Voila – your file has been transferred to your local disk!&lt;/p&gt;  &lt;p&gt;This of course also works in the other direction, which can be useful if you need to copy something like the Sysinternal tools to a server which does not have connectivity to the internet.&lt;/p&gt;  &lt;p&gt;I must admit that I cannot in detail explain why or how this works. According to Denis, it’s about the file object being converted to a COM object when inserted into a document. I gues the most important thing is that it just works. &lt;img style="style" class="wlEmoticon wlEmoticon-smile" alt="Smilefjes" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/3678.wlEmoticon_2D00_smile_5F00_1D5FA254.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10325471" width="1" height="1"&gt;</content><author><name>Thomas Svensen</name><uri>http://blogs.msdn.com/Thomas-Svensen/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Lost authentication cookies in SharePoint</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/06/10/lost-authentication-cookies-in-sharepoint.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/06/10/lost-authentication-cookies-in-sharepoint.aspx</id><published>2012-06-10T22:39:00Z</published><updated>2012-06-10T22:39:00Z</updated><content type="html">&lt;p&gt;Are your users complaining about losing their session in your&amp;nbsp;SharePoint&amp;nbsp;environment? Or do your users complain about being thrown out&amp;nbsp;after a while? This might be the explanation.&lt;/p&gt;
&lt;p&gt;When the user has entered his credentials,&amp;nbsp;a cookie is returned to the client (when using claims authentication or other cookie-based authentication methods). This cookie is contained in the header of the requests as long as the user is logged in.&lt;/p&gt;
&lt;p&gt;Internet Explorer stores up to &lt;a href="http://support.microsoft.com/kb/941495"&gt;50 cookies per domain&lt;/a&gt;. This means that if your code generates a lot of cookies, your authentication cookie might sooner or later be lost (as cookies are handled on a First-In-First-Out basis).&lt;/p&gt;
&lt;p&gt;SharePoint list view pages generates cookies (normally 2). After browsing a number of list view pages&amp;nbsp;the browser&amp;nbsp;will receive a high number of cookies. When the number reaches 50, the authentication cookie will be replaced in IE. What the user will experience is that he is "thrown out" (redirected to the log-in page).&lt;/p&gt;
&lt;p&gt;If we log on through firefox&amp;nbsp;we can easily see all the cookies generated through firebug&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/8611.1.png"&gt;&lt;img border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/8611.1.png" /&gt;&lt;/a&gt;&lt;br /&gt;This picture shows the "View all site content page". There are currently 6 cookies&amp;nbsp;from&amp;nbsp;the site domain. After browsing all the list view pages linked from this page we get the following cookies:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/3348.2.png"&gt;&lt;img border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/3348.2.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you might&amp;nbsp;see at the picture, the cookies &lt;em&gt;stsSyncIconPath,&lt;/em&gt; &lt;em&gt;stsSyncAppName, databaseBtnText &lt;/em&gt;and&lt;em&gt; databaseBtnDesc &lt;/em&gt;(depending on list type)&amp;nbsp;cookies are written to list relative paths. After browsing a number of pages like these, the number of cookies will sooner or later reach 50. If the user is browsing through IE, the authentication cookie (FedAuth in this example) will be lost.&lt;br /&gt;Note: if you debug the same behavior through Fiddler you will not be able to see these cookies as they are generated client side (through javascripts).&lt;/p&gt;
&lt;p&gt;If you do experience this&amp;nbsp;issue you could consider a couple of workarounds:&lt;/p&gt;
&lt;p&gt;- Wait for a future fix (the behavior will hopefully be changed in one of the next SharePoint CUs)&lt;/p&gt;
&lt;p&gt;- Avoid exposure of list views unless you really need them&lt;/p&gt;
&lt;p&gt;- Take a look at how the cookies are generated (hint: ows.js/init.js). Remember that modifying the out of the box files is not supported by Microsoft&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10318134" width="1" height="1"&gt;</content><author><name>Tarjei  Lægreid</name><uri>http://blogs.msdn.com/tarjei.laegreid_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Deploying search synonyms to SharePoint Search</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/06/06/deploying-search-synonyms-to-sharepoint-search.aspx" /><link rel="enclosure" type="application/zip" length="2540" href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-31-58-41/ConfigureSearchSynonyms.zip" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/06/06/deploying-search-synonyms-to-sharepoint-search.aspx</id><published>2012-06-06T11:08:00Z</published><updated>2012-06-06T11:08:00Z</updated><content type="html">&lt;p&gt;SharePoint 2010 Search enables you to add search synonyms via XML configuration files on the server. The configuration is well described on &lt;a href="http://technet.microsoft.com/en-us/library/dd361734.aspx" target="_blank"&gt;TechNet&lt;/a&gt; and seems pretty straighforward. There are sample files in the installation, that you can use as a starting point, but straight away, we saw some challenges related to governance and deployment:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Manual editing of XML files only works for really small files&lt;/li&gt;
&lt;li&gt;Deployment is cumbersome - it must be done on each server, and the path includes GUIDs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We therefore decided to script the rollout, taking a CSV file as input. CSV is easily edited using Excel, and PowerShell is great at parsing CSV and writing XML. This way, both problems could be easily solved. But, as we started trying this out, we ran into additional challenges:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Adding anything except letters, numbers and spaces seem to breaks the feature&lt;/li&gt;
&lt;li&gt;In some environments, the reference to the XML schema causes problems&lt;/li&gt;
&lt;li&gt;Duplicate synonym entries makes the feature fail silently (this caused us a lot of headache&amp;hellip;)&lt;/li&gt;
&lt;li&gt;We needed to log onto each individual search server to restart it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The XML schema problem appears in the event viewer and looks like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/0285.clip_5F00_image002_5F00_002250B9.gif"&gt;&lt;img style="display: inline; background-image: none;" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/1447.clip_5F00_image002_5F00_thumb_5F00_71972EC6.gif" width="704" height="186" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We found that removing the XML namespace reference at the start of the XML file solved the problem.&lt;/p&gt;
&lt;p&gt;To make a long story short, we have created a script which handles everything you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Converts CSV to XML&lt;/li&gt;
&lt;li&gt;Replaces, &amp;amp;, :, ;, etc. with spaces&lt;/li&gt;
&lt;li&gt;Barfs at you if you have duplicates&lt;/li&gt;
&lt;li&gt;Looks up the correct guid-folders for your servers&lt;/li&gt;
&lt;li&gt;Distributes the XML files&lt;/li&gt;
&lt;li&gt;Does an automatic&amp;nbsp;restart of the OSearch14 windows service on all servers listed&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Configuration is done via a simple PowerShell file which is passed as input to the main script. A couple of things to note regarding configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An arbitrary number of columns can be added - just make sure to add corresponding dummy-headings. Headings are required for PowerShell to parse the CSV properly.&lt;/li&gt;
&lt;li&gt;Deploying to "tsneu" is probably sufficient, as is done in the supplied config, but you can add a list of languages if needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Download the attached zip for the complete source. Thanks to my colleague Stig Lytjohan for doing much of the hard work! &lt;img class="wlEmoticon wlEmoticon-smile" alt="Smilefjes" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/5483.wlEmoticon_2D00_smile_5F00_08760043.png" /&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10315841" width="1" height="1"&gt;</content><author><name>Thomas Svensen</name><uri>http://blogs.msdn.com/Thomas-Svensen/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>How is the link to people’s My Site from Outloook provided?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/05/30/how-is-the-link-to-people-s-my-site-from-outloook-provided.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/05/30/how-is-the-link-to-people-s-my-site-from-outloook-provided.aspx</id><published>2012-05-30T10:27:35Z</published><updated>2012-05-30T10:27:35Z</updated><content type="html">&lt;p&gt;In Lync and Outlook you can hover over a contact to get a popup showing ways to interact with the person. This is what it looks like in our environment:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/1273.image_5F00_4E49C413.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/3326.image_5F00_thumb_5F00_3DEE4C5A.png" width="304" height="95" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When hovering over the persons name, you &lt;em&gt;should&lt;/em&gt; get the option to view the persons profile page, or “My Site”. But in a standard installation, this connection is not enabled, and you will only be able to highlight the name, e.g. as shown here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/7633.image_5F00_519B35EE.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/2350.image_5F00_thumb_5F00_49A3938C.png" width="304" height="95" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In an installation with a proper MySite-link, it will look like this when I hover over “Thomas Svensen” in the popup:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/8117.Link_2D00_to_2D00_My_2D00_site_5F00_6F9943E2.png"&gt;&lt;img style="display: inline; background-image: none;" title="Link to My site" border="0" alt="Link to My site" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/1373.Link_2D00_to_2D00_My_2D00_site_5F00_thumb_5F00_27D7BAFB.png" width="304" height="80" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And clicking the name will open the person’s MySite in your default browser. Worth noting here is that &lt;strong&gt;there is not a direct link to the user’s MySite&lt;/strong&gt;, instead the My Site that you are connected to, is queried using the email address of the person in question. This can be verified by using &lt;a href="http://www.fiddler2.com" target="_blank"&gt;Fiddler&lt;/a&gt; to show the trace of network calls made.&lt;/p&gt;  &lt;p&gt;This link to the user’s MySite is stored in the Registry:&lt;/p&gt;  &lt;p&gt;[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Server Links\Published\&lt;font style="background-color: rgb(255, 255, 0);"&gt;My Site&lt;/font&gt;\Profile Site]     &lt;br /&gt;&amp;quot;LinkType&amp;quot;=hex(b):00,00,00,00,00,00,00,01     &lt;br /&gt;&amp;quot;IsMember&amp;quot;=dword:00000000     &lt;br /&gt;&amp;quot;IsPublished&amp;quot;=dword:00000001     &lt;br /&gt;&amp;quot;Url&amp;quot;=&amp;quot;http://my:80/Person.aspx?user=&amp;quot;&lt;/p&gt;  &lt;p&gt;I have highlighted “My Site” in the registry path, because this name can be anything. Testing has shown that the first entry listed under “Published” is used, whatever the name is. With SharePoint 2010, the only way we have found to create this link in the registry, is to:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Open some document library&lt;/li&gt;    &lt;li&gt;Click “Library tools &amp;gt; Library” in the ribbon&lt;/li&gt;    &lt;li&gt;Click “Connect to Office &amp;gt; Add to SharePoint sites”&lt;/li&gt;    &lt;li&gt;Click “OK” in the dialog that appears.&lt;/li&gt;  &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/4426.image_5F00_192D0F16.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/2766.image_5F00_thumb_5F00_2CD9F8AA.png" width="604" height="199" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This procedure is not really something we can instruct all our thousands of users to do, of course. There are some suggestions floating around on the net, saying that the PortalConnect popup that appeared in earlier SharePoint version can be enabled for SP2010, e.g. as described by &lt;a href="http://vanhooijdonk.wordpress.com/2010/05/21/set-default-mysite-not-working-with-office-2010-rtm-x64/" target="_blank"&gt;Stef van Hooijdonk&lt;/a&gt;. But applying those registry updates didn’t not change anything for us; neither does it seem to work &lt;a href="http://social.technet.microsoft.com/Forums/lv/sharepoint2010setup/thread/fbb66a06-d45f-4ef8-b7d0-5b99d985d279" target="_blank"&gt;for others on the SharePoint TechNet forum&lt;/a&gt;. The obvious alternative is pushing out the registry update shown above via a GPO – Group Policy Object, but there is no official guidance on this, e.g. in the &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=18968" target="_blank"&gt;Office 2010 Group Policy and OCT Settings reference spreadsheet&lt;/a&gt;. We are trying to get some guidance, but currently, this is the state of affairs. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10311772" width="1" height="1"&gt;</content><author><name>Thomas Svensen</name><uri>http://blogs.msdn.com/Thomas-Svensen/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Removing an invalid WebConfigModification using Powershell</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/05/29/removing-an-invalid-webconfigmodification-with-powershell.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/05/29/removing-an-invalid-webconfigmodification-with-powershell.aspx</id><published>2012-05-29T10:29:00Z</published><updated>2012-05-29T10:29:00Z</updated><content type="html">&lt;p&gt;SharePoint supports adding web.config modifications programmatically.&amp;nbsp;Here is an&amp;nbsp;&lt;a title="example  " href="http://msdn.microsoft.com/nb-no/library/microsoft.sharepoint.administration.spwebconfigmodification(v=office.12).aspx"&gt;example&lt;/a&gt; from MSDN.&amp;nbsp;Each modification is stored&amp;nbsp;with a&amp;nbsp;web application, and you are able to list them using the following command:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;$webapp = Get-SPWebApplication http://&amp;lt;your web app&amp;nbsp;url&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;$w.WebConfigModifications&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you want to remove an invalid entry, use the following commands:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;$modification = $webapp.WebConfigModifications | where { $_.Name -eq "&amp;lt;the name of your key&amp;gt;" }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;$webapp.WebConfigModifications.Remove($modification)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;$webapp.Update()&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10311263" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Incorrect syntax near the keyword 'AS'</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/05/22/incorrect-syntax-near-the-keyword-as.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/05/22/incorrect-syntax-near-the-keyword-as.aspx</id><published>2012-05-22T07:24:30Z</published><updated>2012-05-22T07:24:30Z</updated><content type="html">&lt;p&gt;The error "Incorrect syntax near the keyword 'AS'" can occur when you try to run SQL scripts that require SQL Server 2008 on an earlier version of SQL Server. In my case it occurred while installing NewsGator Social Sites. SharePoint 2010&amp;nbsp;supports SQL Server 2005 (in some scenarios), but NewsGator requires SQL Server 2008 SP1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10308702" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>How to speed up SharePoint Management Shell startup</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/04/25/how-to-speed-up-sharepoint-management-shell-startup.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/04/25/how-to-speed-up-sharepoint-management-shell-startup.aspx</id><published>2012-04-25T10:27:57Z</published><updated>2012-04-25T10:27:57Z</updated><content type="html">&lt;p&gt;On&amp;nbsp;virtual machines&amp;nbsp;without internet access it may take 1-2 minutes to start SharePoint Management Shell. The problem is that when loading signed assemblies the .NET Framework checks the Internet based certificate revocation list. The timeout for each check is 30 seconds. To avoid this check, set the following registry key:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,courier;"&gt;[HKEY_USERS\&amp;lt;userid&amp;gt;\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new,courier;"&gt;"State"=dword:00023e00&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10297539" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Troubleshooting SharePoint logging</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/04/24/troubleshooting-sharepoint-logging.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/04/24/troubleshooting-sharepoint-logging.aspx</id><published>2012-04-24T08:48:00Z</published><updated>2012-04-24T08:48:00Z</updated><content type="html">&lt;p&gt;Both the Event Log and the&amp;nbsp;ULS log&amp;nbsp;are invaluable sources of information when monitoring or debugging your SharePoint solution. Sometimes logging doesn't work. In my experience these are the most frequent reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The log disk is&amp;nbsp;full.&lt;/li&gt;
&lt;li&gt;The application pool account of your web application is not a member of the&amp;nbsp; "Performance Log Users" group on ALL servers in the farms.&lt;/li&gt;
&lt;li&gt;For being able to create custom event logs from an event receiver,&amp;nbsp;the timer service account needs&amp;nbsp;write permissions&amp;nbsp;to the following key in registry:&lt;br /&gt;&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servicese\Eventlog&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you are just starting to implement logging in&amp;nbsp;your application, a few tips may help you on the way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A good logging experience requires some effort, so you may find&amp;nbsp;that using the logging classes in &lt;a title="Patterns &amp;amp;amp; Practices SharePoint Guidance" href="http://spg.codeplex.com/" target="_blank"&gt;Patterns &amp;amp; Practices SharePoint Guidance&lt;/a&gt;&amp;nbsp;can save you some work.&lt;/li&gt;
&lt;li&gt;ULS Viewer is&amp;nbsp;of great help when reading the ULS log. Download it&amp;nbsp;from MSDN: &lt;a href="http://archive.msdn.microsoft.com/ULSViewer"&gt;http://archive.msdn.microsoft.com/ULSViewer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10297060" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Configure redirect via IIS using command line script</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2012/04/20/configure-redirect-via-iis-using-command-line-script.aspx" /><link rel="enclosure" type="text/plain" length="1460" href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-29-57-64/ConfigureIISRedirect.cmd.txt" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2012/04/20/configure-redirect-via-iis-using-command-line-script.aspx</id><published>2012-04-20T12:03:00Z</published><updated>2012-04-20T12:03:00Z</updated><content type="html">&lt;p&gt;In our current project, we were moving an old SharePoint installation to a new farm, As part of this migration, we got a new, nicer DNS name. We wanted to support old users who had bookmarks etc., by doing a redirect. First of all, we configured both DNS&amp;rsquo;s to point to the same IP address, like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;long-old-url.company.com &amp;ndash;&amp;gt; 10.10.10.10&lt;/li&gt;
&lt;li&gt;nice-url.company.com &amp;ndash;&amp;gt; 10.10.10.10&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This way, both new and old users could access the same backend transparently. But, we wanted the old users to be redirected to the new URL, so that going forward everyone would see &amp;ldquo;http://nice-url.company.com&amp;rdquo; in their browser address bar. Fortunately, version 7 of IIS added support for redirects. But it turns out that the redirect module is not enabled by default. You must go into the &amp;ldquo;Windows features&amp;rdquo; to enable it.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/7752.Redirect-_2D00_-windows-feature.png"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/7752.Redirect-_2D00_-windows-feature.png" border="0" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/3125.Redirect_2D002D002D00_windows_2D00_feature_5F00_34660A58.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once the redirect feature was enabled, it was easy enough to configure the redirect using the UI.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/7002.Redirect_2D00_config_2D002D002D00_IIS_5F00_661101E0.png"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/4762.Redirect-config-_2D00_-IIS.png"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/4762.Redirect-config-_2D00_-IIS.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;UPDATE:&lt;br /&gt;I though it was this easy, but it turns out that query parameters are not passed along when using the straightforward redirect function, but you need to add $V$Q and check the "Exact destination", like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/5305.iis_2D00_redirect_2D00_with_2D00_query_2D00_parameters.png"&gt;&lt;img alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07/5305.iis_2D00_redirect_2D00_with_2D00_query_2D00_parameters.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As&amp;nbsp;we have multiple environments were this needs to be configured, we wanted to do it all via the command line. It took some research to figure out the steps to activate the windows feature and even more to do the IIS configuration via the command line. So, for your convenience, here is a complete batch script which takes as input four parameters and sets it all up in one go. The four parameters are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Old URL&lt;/li&gt;
&lt;li&gt;New URL&lt;/li&gt;
&lt;li&gt;Old port (defaults to 80)&lt;/li&gt;
&lt;li&gt;New port (defaults to 80)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And here is the complete script with inline comments to explain the required steps:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;@echo off&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;REM Configuration &lt;br /&gt;set oldUrl=%1 &lt;br /&gt;set newUrl=%2 &lt;br /&gt;if "%3" == "" (set oldPort=80) else (set oldPort=%3) &lt;br /&gt;if "%4" == "" (set newPort=80) else (set newPort=%4)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;set siteId=1001 &lt;br /&gt;set siteName=%oldUrl% &lt;br /&gt;set virtualDir=c:\inetpub\wwwroot\wss\VirtualDirectories\%oldUrl%-%oldPort%&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;REM ************************************************ &lt;br /&gt;REM Enable HTTP Redirect feature &lt;br /&gt;REM ************************************************ &lt;br /&gt;dism /online /Enable-Feature /FeatureName:IIS-HttpRedirect&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;REM ************************************************ &lt;br /&gt;REM Create virtual directory for site &lt;br /&gt;REM ************************************************ &lt;br /&gt;mkdir "%virtualDir%"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;REM ************************************************ &lt;br /&gt;REM Create site &lt;br /&gt;REM ************************************************ &lt;br /&gt;%windir%\system32\inetsrv\AppCmd ADD SITE /name:%siteName% /id:%siteId% /bindings:http/*:%oldPort%:%oldUrl% /physicalPath:"%virtualDir%"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;REM ************************************************ &lt;br /&gt;REM Add redirect setting to web.config &lt;br /&gt;REM ************************************************ &lt;br /&gt;%windir%\system32\inetsrv\AppCmd SET config %siteName% /section:httpRedirect /enabled:true /destination:http://%newUrl%:%newPort%$V$Q /exactDestination:true&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Courier New;" face="Courier New"&gt;REM ************************************************ &lt;br /&gt;REM Grant read access to Everyone recursively &lt;br /&gt;REM (Automatic when done via UI, but not via cmd) &lt;br /&gt;REM ************************************************ &lt;br /&gt;icacls "%virtualDir%" /t /q /grant:r everyone:(GR) &lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10295764" width="1" height="1"&gt;</content><author><name>Thomas Svensen</name><uri>http://blogs.msdn.com/Thomas-Svensen/ProfileUrlRedirect.ashx</uri></author><category term="sharepoint iis redirect 302" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/sharepoint+iis+redirect+302/" /></entry><entry><title>Connecting custom service application proxies using Powershell</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/12/14/connecting-custom-service-application-proxies-using-powershell.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/12/14/connecting-custom-service-application-proxies-using-powershell.aspx</id><published>2011-12-14T22:02:19Z</published><updated>2011-12-14T22:02:19Z</updated><content type="html">&lt;p&gt;In my current project we have scripted a NewsGator install in a multi-server farm. One of the challenges we faced is that we needed to connect a proxy for the NewsGator Social Platform Services service application. This is very straight forward for the out-of-the-box service applications in SharePoint, as each have specific Powershell cmdlets:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Consolas"&gt;New-SPSubscriptionSettingsServiceApplicationProxy        &lt;br /&gt;New-SPBusinessDataCatalogServiceApplicationProxy         &lt;br /&gt;New-SPMetadataServiceApplicationProxy         &lt;br /&gt;New-SPSecureStoreServiceApplicationProxy         &lt;br /&gt;New-SPStateServiceApplicationProxy         &lt;br /&gt;New-SPEnterpriseSearchServiceApplicationProxy         &lt;br /&gt;New-SPPerformancePointServiceApplicationProxy         &lt;br /&gt;New-SPProfileServiceApplicationProxy         &lt;br /&gt;New-SPVisioServiceApplicationProxy         &lt;br /&gt;New-SPWebAnalyticsServiceApplicationProxy&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;For custom service applications it’s a little bit more complicated. By the way, I most cases you need to &lt;a href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/02/05/how-to-publish-a-managed-metadata-service-for-cross-farm-consumption.aspx#step1"&gt;set up a trust relationship&lt;/a&gt; between the servers before trying to connect the proxy. This also applies to the out-of-the box proxies. The next step is to get the connection URI for the service application. You can use the topology web service for that:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Consolas"&gt;$connectionUri = (Receive-SPServiceApplicationConnectionInfo `        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; -FarmUrl &lt;/font&gt;&lt;a href="http://publisher:32844/Topology/topology.svc"&gt;&lt;font size="2" face="Consolas"&gt;http://publisher:32844/Topology/topology.svc&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Next, loop through all the service proxies to find the right proxy type. Notice that we need to look at each service proxy through the eyes of the IServiceProxyAdministration interface to get access to the GetProxyTypes method.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Consolas"&gt;foreach($sp in (Get-SPFarm).ServiceProxies)       &lt;br /&gt;{        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; $spa = $sp -as `        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font size="2" face="Consolas"&gt;[Microsoft.SharePoint.Administration.IServiceProxyAdministration]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; $types = $spa.GetProxyTypes()        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; $type = $types | ? { $_.FullName –eq $ProxyTypeName }        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if ($type –ne $null) { break }&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Finally, create and provision the proxy:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Consolas"&gt;[Microsoft.SharePoint.Administration.SPServiceProvisioningContext] `        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; $provisioningContext = $null         &lt;br /&gt;$serviceApplicationProxy = $serviceProxyAdministration.CreateProxy( `         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; $type, &amp;quot;NG Proxy&amp;quot;, $connectionUri, $provisioningContext)         &lt;br /&gt;$serviceApplicationProxy.Provision()&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;(Using null for the provisioning context parameter seems to work fine, so I didn’t spend more time trying to figure out what that value should be.)&lt;/p&gt;  &lt;p&gt;You can now verify that the service proxy is available in Central Administration | Manage service applications.&lt;/p&gt;  &lt;p&gt;NOTICE! To make this post more readable all error handling has been removed from the scripts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10247828" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>How to list checked out documents when exceeding the list view threshold</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/11/18/how-to-list-checked-out-documents-when-exceeding-the-list-view-threshold.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/11/18/how-to-list-checked-out-documents-when-exceeding-the-list-view-threshold.aspx</id><published>2011-11-18T14:45:38Z</published><updated>2011-11-18T14:45:38Z</updated><content type="html">&lt;p&gt;We recently had the challenge with showing users a list of the documents they had checked out. This was important to the users, since it is easy to forget which documents you have currently checked out. At first, it seemed trivial to get this via the “Relevant Documents” web part.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/8407.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_add_2D00_relevant_2D00_documents_2D00_web_2D00_part_5F00_1F3457D9.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - add relevant documents web part" border="0" alt="Blog - docs checked out to me - add relevant documents web part" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/4377.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_add_2D00_relevant_2D00_documents_2D00_web_2D00_part_5F00_thumb_5F00_723EF4FD.png" width="557" height="207" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And then configuring it to show checked out documents only.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/8507.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_web_2D00_part_2D00_config_5F00_7021F634.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - web part config" border="0" alt="Blog - docs checked out to me - web part config" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/5270.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_web_2D00_part_2D00_config_5F00_thumb_5F00_59EBDAE2.png" width="239" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In our test environment, this worked just fine. But, going to production, the number of documents passed the magic limit of 5000. Then, our web part started showing an error message, saying we had passed the list view threshold.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/2234.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_error_2D00_message_5F00_1804F594.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - error message" border="0" alt="Blog - docs checked out to me - error message" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/1050.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_error_2D00_message_5F00_thumb_5F00_24FED5A5.png" width="565" height="93" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hmm, not so good. After some thinking, we came up with the simple solution of creating a view filtered on the “Checked Out To” column.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/0160.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_configure_2D00_view_5F00_4A1C2011.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - configure view" border="0" alt="Blog - docs checked out to me - configure view" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/4774.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_configure_2D00_view_5F00_thumb_5F00_28504780.png" width="571" height="266" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then, we added a normal “list view” web part for our “Agreements” library.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/0552.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_add_2D00_list_2D00_view_2D00_web_2D00_part_5F00_06183BFA.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - add list view web part" border="0" alt="Blog - docs checked out to me - add list view web part" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/2727.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_add_2D00_list_2D00_view_2D00_web_2D00_part_5F00_thumb_5F00_644C6368.png" width="578" height="210" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And configured it to use our new view.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/3617.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_configure_2D00_list_2D00_view_2D00_web_2D00_part_5F00_4933945A.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - configure list view web part" border="0" alt="Blog - docs checked out to me - configure list view web part" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/8507.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_configure_2D00_list_2D00_view_2D00_web_2D00_part_5F00_thumb_5F00_20B4B246.png" width="259" height="375" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now everything seemed to work fine. But, beware, it does not! It now only scans the first 5000 entries and then skips the rest. If you check out document no. 5001 or above, it will &lt;strong&gt;not&lt;/strong&gt; be shown in this web part. The solution is to add an indexed column for “Checked Out To”. To allow the creation of that index, we need to temporarily lift the list view threshold. This is done via Central Administration, under “Manage Web Application” &amp;gt; “General Settings” &amp;gt; “Resource Throttling”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/2727.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_resource_2D00_throttling_5F00_1E97B37D.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - resource throttling" border="0" alt="Blog - docs checked out to me - resource throttling" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/7418.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_resource_2D00_throttling_5F00_thumb_5F00_4EDE8833.png" width="287" height="214" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then, open up a one hour slot at a convenient time, preferably when few users are accessing the solution. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;NOTE!&lt;/strong&gt; You should probably remove this windows after having done the rest of this configuration!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/6837.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_happy_2D00_hour_5F00_61B30BDD.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - happy hour" border="0" alt="Blog - docs checked out to me - happy hour" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/1651.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_happy_2D00_hour_5F00_thumb_5F00_19855001.png" width="578" height="187" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Next, go back to your document library, and then to “Library Settings”. We can see it’s giving us the warning.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/2627.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_list_2D00_threshold_2D00_exceeded_5F00_697AFE7F.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - list threshold exceeded" border="0" alt="Blog - docs checked out to me - list threshold exceeded" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/4278.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_list_2D00_threshold_2D00_exceeded_5F00_thumb_5F00_7C4F8229.png" width="575" height="187" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Scroll down to the last part of the “Columns” section and click the “Indexed columns” link.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/6428.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_indexed_2D00_columns_5F00_39FC69E6.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - indexed columns" border="0" alt="Blog - docs checked out to me - indexed columns" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/5751.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_indexed_2D00_columns_5F00_thumb_5F00_6B1BA486.png" width="368" height="115" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then, add an index for for “Checked Out To”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/8081.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_created_2D00_indexed_2D00_column_5F00_429CC272.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - created indexed column" border="0" alt="Blog - docs checked out to me - created indexed column" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/5861.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_created_2D00_indexed_2D00_column_5F00_thumb_5F00_20D0E9E1.png" width="576" height="230" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Adding the index shouldn’t take too long, and then we will get a complete list of our checked out documents.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/8562.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_working_2D00_sample_5F00_1EB3EB18.png"&gt;&lt;img style="display: inline; background-image: none;" title="Blog - docs checked out to me - working sample" border="0" alt="Blog - docs checked out to me - working sample" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/8585.Blog_2D002D002D00_docs_2D00_checked_2D00_out_2D00_to_2D00_me_2D002D002D00_working_2D00_sample_5F00_thumb_5F00_047381F4.png" width="244" height="74" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As long as you have fewer than 5000 documents checked out to yourself, that is &lt;img style="style" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-07-metablogapi/4762.wlEmoticon_2D00_winkingsmile_5F00_70E62252.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10238539" width="1" height="1"&gt;</content><author><name>Thomas Svensen</name><uri>http://blogs.msdn.com/Thomas-Svensen/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>How to wait for a timer job to complete in a multi-server farm?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/11/04/how-to-wait-for-a-timer-job-to-complete-in-a-multi-server-farm.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/11/04/how-to-wait-for-a-timer-job-to-complete-in-a-multi-server-farm.aspx</id><published>2011-11-04T16:12:00Z</published><updated>2011-11-04T16:12:00Z</updated><content type="html">&lt;p&gt;In our test environment several projects deploy solutions to a single farm. Lately we have had some synchronization issues in multi-server farms. We have created a feature for updating web.config files that are used by several projects. The problem is that in multi-server farms, the timer jobs created by the web.config update mechanism in SharePoint, keep stepping on each other&amp;rsquo;s toes. So we needed a way to ensure that each update job has completed on all servers before continuing. This issue has received some attention from other bloggers earlier, but we were not able to find an implementation that we fully trust. So we had to come up with a solution ourselves, for once ;-)&lt;/p&gt;
&lt;p&gt;So what are the steps to accomplish this?&lt;/p&gt;
&lt;p&gt;1. We need to know the name of all the front-end servers in the farm.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;&lt;span style="font-size: 9.8pt;"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt; List&amp;lt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;gt; GetFrontEndServerNames(SPFarm farm) &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; (&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; server &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; farm.Servers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; instance &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; server.ServiceInstances&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;where&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; (instance.TypeName.Equals(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #a31515;" color="#a31515"&gt;"Windows SharePoint Services Web Application"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|| (instance.TypeName.Equals(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #a31515;" color="#a31515"&gt;"Microsoft SharePoint Foundation Web Application"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt;))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;select&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; server.Name).ToList(); } &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2. We need to check whether the timer job is completed for a single server. This is the essential part. What we do is check if the job shows up in the history after a given point in time.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;&lt;span style="font-size: 9.8pt;"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;bool&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; IsJobCompleted(SPFarm farm, &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; serverName, &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; serviceTypeName,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; jobTitle, &lt;/span&gt;&lt;span&gt;&lt;span style="color: #2b91af;" color="#2b91af"&gt;DateTime&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; startTime) &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; result = &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPService service = farm.Services.Where(f =&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.TypeName.Equals(serviceTypeName)).FirstOrDefault();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; (service != &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; (service.JobHistoryEntries.Any(&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; job =&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;job.JobDefinitionTitle.Equals(jobTitle) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;job.ServerName.Equals(serverName) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;job.StartTime &amp;gt; startTime))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; result;&lt;br /&gt; } &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;3. We need to keep track of timer job status on all servers, and keep checking until all the jobs are done, or a timeout is reached.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;&lt;span style="font-size: 9.8pt;"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; WaitForOnetimeJobToComplete(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPFarm farm, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICollection&amp;lt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;gt; serverNames,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; serviceTypeName, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; jobTitle, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #2b91af;" color="#2b91af"&gt;TimeSpan&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; timeout, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; secondsBeforeRetry)&lt;br /&gt; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;try&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; startTime = &lt;/span&gt;&lt;span&gt;&lt;span style="color: #2b91af;" color="#2b91af"&gt;DateTime&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;.UtcNow;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; (serverNames.Count &amp;gt; 0 &amp;amp;&amp;amp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #2b91af;" color="#2b91af"&gt;DateTime&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;.UtcNow - startTime &amp;lt; timeout)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; tempServerNames = &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; List&amp;lt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempServerNames.AddRange(serverNames);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;foreach&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; (&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; serverName &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; tempServerNames)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; isJobCompleted = &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsJobCompleted(farm, serverName, serviceTypeName,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;jobTitle, startTime);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; (isJobCompleted)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; serverNames.Remove(serverName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; (serverNames.Count &amp;lt;= 0) &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;continue&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.Sleep(1000 * secondsBeforeRetry);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;catch&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; (&lt;/span&gt;&lt;span&gt;&lt;span style="color: #2b91af;" color="#2b91af"&gt;Exception&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt; ex) { &lt;/span&gt;&lt;span&gt;&lt;span style="color: #008000;" color="#008000"&gt;//Log error&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; }&lt;br /&gt; } &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;4. The above method was meant to be generalized (although not verified), so we need a more to-the-point wrapper method, like this:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;&lt;span style="font-size: 9.8pt;"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; WaitForWebConfigUpdateTimerJobToComplete(SPFarm farm) &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt; frontEndServerNames = GetFrontEndServerNames(farm);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;const&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; typeName = &lt;/span&gt;&lt;span&gt;&lt;span style="color: #a31515;" color="#a31515"&gt;"Microsoft SharePoint Foundation Web Application"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;const&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; jobTitle = &lt;/span&gt;&lt;span&gt;&lt;span style="color: #a31515;" color="#a31515"&gt;"Microsoft SharePoint Foundation Web.Config Update"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="color: #000000;" color="#000000"&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; timeout = &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #2b91af;" color="#2b91af"&gt;TimeSpan&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;" face="Consolas"&gt;&lt;span style="font-size: 9.8pt;"&gt;&lt;span style="color: #000000;" color="#000000"&gt;(0, 2, 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;const&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #0000ff;" color="#0000ff"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;" color="#000000"&gt; secondsBeforeRetry = 5;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WaitForOnetimeJobToComplete(farm, frontEndServerNames, typeName,&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;jobTitle, timeout, secondsBeforeRetry); &lt;br /&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it! Thanks to my colleague Roy Lofthus for providing valuable input from his experience in SharePoint deployment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10234071" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>How to enable search alerts across farms</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/10/14/how-to-enable-search-alerts-across-farms.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/10/14/how-to-enable-search-alerts-across-farms.aspx</id><published>2011-10-14T19:51:43Z</published><updated>2011-10-14T19:51:43Z</updated><content type="html">&lt;p&gt;Search alerts in SharePoint 2010 is a pretty powerful feature, and enabling it in Enterprise Search is easy; just click “Enable” next to the “Search alerts status” in the in the Search Administration page for a search service application, and you’re good to go.&lt;/p&gt;  &lt;p&gt;This is true for the local farm, but if you’re in an environment where you have a search service application that’s shared between farms, you need to configure which farms the search service application should allow search alerts for.&lt;/p&gt;  &lt;p&gt;The ULS log on a farm that is consuming a search service application from another farm gets the following error when the “Immediate Alerts” timer job tries to process a search alert:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#ff0000"&gt;SearchServiceApplicationProxy::Execute--Error occured: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Error while processing search alert at search service application 'Search Service Application'. Farm Id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' does not exist in the FarmIdsForAlerts property or is not the local farm id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.InvalidOperationException: Error while processing search alert at search service application 'Search Service Application'. Farm Id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' does not exist in the FarmIdsForAlerts property or is not the local farm id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is a really informative error message! The &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.administration.searchserviceapplication.aspx" target="_blank"&gt;SearchServiceApplication&lt;/a&gt; object has a property called &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.administration.searchserviceapplication.farmidsforalerts.aspx" target="_blank"&gt;FarmIdsForAlerts&lt;/a&gt;, which is a list of farm ids. All farms that should have search alerts must be listed here (not necessary to list the local farm). To add the first farm id to the list, you can use PowerShell:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;# Id of farm to allow search alerts for        &lt;br /&gt;$guid = new-object &amp;quot;System.Guid&amp;quot; -ArgumentList &amp;quot;{dc08d452-dea8-4091-848b-2bbbcab448d4}&amp;quot;&lt;/em&gt;&lt;/p&gt;   &lt;em&gt;&lt;/em&gt;    &lt;p&gt;&lt;em&gt;$app = Get-SPEnterpriseSearchServiceApplication -Identity &amp;quot;Search Service Application&amp;quot;&lt;/em&gt;&lt;/p&gt;   &lt;em&gt;&lt;/em&gt;    &lt;p&gt;&lt;em&gt;# Create list and add farm id        &lt;br /&gt; $type = (&amp;quot;System.Collections.Generic.List&amp;quot;+'`'+&amp;quot;1&amp;quot;) -as &amp;quot;Type&amp;quot;         &lt;br /&gt; $type = $type.MakeGenericType(&amp;quot;system.Guid&amp;quot; -as &amp;quot;Type&amp;quot;)         &lt;br /&gt; $list = [Activator]::CreateInstance($type)         &lt;br /&gt; $list.Add($guid)&amp;#160;&amp;#160; &lt;br /&gt; $app.FarmIdsForAlerts = $list         &lt;br /&gt; $app.Update()&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;For consecutive farm ids, you can create the &lt;em&gt;$list&lt;/em&gt; variable the same way as shown here, add the &lt;em&gt;$guid&lt;/em&gt; to the list, loop through the current &lt;em&gt;$app.FarmIdsForAlerts &lt;/em&gt;list and add its entries to the &lt;em&gt;$list&lt;/em&gt; variable, set the &lt;em&gt;$app.FarmIdsForAlerts = $lists&lt;/em&gt;, and then do &lt;em&gt;$app.Update()&lt;/em&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10225467" width="1" height="1"&gt;</content><author><name>&amp;#216;yvind Nordnes</name><uri>http://blogs.msdn.com/oyvindn/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Help! - the business requires me to install third party addons into SharePoint 2010</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/10/09/help-the-business-requires-me-to-install-third-party-addons-into-sharepoint-2010.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/10/09/help-the-business-requires-me-to-install-third-party-addons-into-sharepoint-2010.aspx</id><published>2011-10-09T19:19:00Z</published><updated>2011-10-09T19:19:00Z</updated><content type="html">&lt;p&gt;There are a ton of third party addons to SharePoint ranging from useful to just fun, from open source communities or commercial providers. The business value from the addon can be very good, but you need to make sure there are no hidden cost. What if the addon introduce:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Performance and/or stability issues?&lt;/li&gt;
&lt;li&gt;Increased operations cost?&lt;/li&gt;
&lt;li&gt;Elements that take your solution in an unsupported state?&lt;/li&gt;
&lt;li&gt;Increased upgrade cost?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;One of the key questions you need to ask yourself is "What do I need to do to be able to support this?"&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;How your company handle third party addons and code must be described in your governance plan. With the governance plan you have a tool for mitigating the risks. If you don't care about the possible issues, so just write that in the governance plan (not a good idea though). The governance plan is unique for each company. Keep it short and follow up on what you decides on. Most of the value is in the work itself to create the governance plan.&lt;/p&gt;
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;What to look after and require?&lt;/h3&gt;
&lt;p&gt;Here are some guidelines and recommendations to help set up a plan for handling 3rd party addons in SharePoint:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Go through the &lt;a href="http://technet.microsoft.com/en-us/library/cc707802(office.12).aspx#Section2"&gt;Code acceptance checklists&lt;/a&gt; (&lt;a href="http://technet.microsoft.com/en-us/library/cc707802(office.12).aspx#Section2"&gt;http://technet.microsoft.com/en-us/library/cc707802(office.12).aspx#Section2&lt;/a&gt;) for a good list of things to consider.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;In general do not customize existing SharePoint files in the 14 hive. Except for a few well-defined files such as the web.config or docicon.xml files, you should never modify the built-in files included with SharePoint Products and Technologies except through official supported software updates, service packs, or product upgrades.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Artifacts should be packaged in a SharePoint solution (WSP file)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;web.config configuration should be managed using SPWebConfigModification class to provide consistent deployment across Web Front Ends (where possible! There are configuration entries where it is not possible to use this class)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Demand reasons from developer for putting assemblies in the GAC (there might be good reasons such as event handler code, or other code that need to go in GAC or that code should be reached across WFE)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Depending on company policy you could require that code is decorated with CAS attributes to allow lowest possible CAS settings (dont accept code that demand Full trust, then it might as well be in the GAC!)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Make sure WSP files are documented -just a few lines to tell what the solution contains and what it does (makes it easier when you need to debug what caused your farm to become unstable)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Make sure dependencies between WSP files are documented&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Require that upgrade scenarios have been thought into the features you are about to install (often this will include callout code that handles feature deactivation)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Create a baseline performance indication of your farm that you update each time you deploy new solutions and features to monitor performance degradation&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Use batch files or PowerShell scripts to deploy your packages to make deployments consistent across environments (dev-test, integration-test, pre-prod, prod)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Demand your code as a bare minimum is unit tested (also consider functional testing, load testing..)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Developers should run SPDisposeCheck.exe as part of their release builds&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Don&amp;rsquo;t accept debug mode build assemblies!&lt;/li&gt;
&lt;li&gt;Suggest developers do code review before releasing code&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;Separate application farm?&lt;/h3&gt;
&lt;p&gt;In some cases the risk can be mitigated by running the third party addon in a separate farm (application farm). That way it will not negatively affect the other SharePoint solutions. An application farm has a cost, doesn't suite all 3rd party addons, and complicates worldwide/global installations.&lt;/p&gt;
&lt;p&gt;Information harvested from these resources and experiences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://sharepoint.stackexchange.com/questions/2538/what-is-best-practice-for-deploying-third-party-sharepoint-2007-solutions"&gt;http://sharepoint.stackexchange.com/questions/2538/what-is-best-practice-for-deploying-third-party-sharepoint-2007-solutions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb803457.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb803457.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc707802(office.12).aspx#Section2"&gt;http://technet.microsoft.com/en-us/library/cc707802(office.12).aspx#Section2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10222529" width="1" height="1"&gt;</content><author><name>Jon Løken</name><uri>http://blogs.msdn.com/jloken_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Governance" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/Governance/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+2010/" /></entry><entry><title>SharePoint publication webtemplates</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/09/20/sharepoint-publication-webtemplates.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/09/20/sharepoint-publication-webtemplates.aspx</id><published>2011-09-20T08:32:43Z</published><updated>2011-09-20T08:32:43Z</updated><content type="html">&lt;p&gt;I'm in a project which supports several, currently nine, languages.&lt;/p&gt;
&lt;p&gt;Following best practices, we use webtemplates, and bind our content type to the pages library using a content type binding element.&lt;/p&gt;
&lt;p&gt;This works fine in our development boxes, and usually fine also in our test and QA boxes. Usually. "Usually" s not a word we developers like&amp;hellip; (nor users, if truth be told)&lt;/p&gt;
&lt;p&gt;We managed to track it down to Spanish sites.&lt;/p&gt;
&lt;p&gt;Long story etc.; Spanish sites create a "paginas" library, but our content binder expected "pages".&lt;/p&gt;
&lt;p&gt;Changing&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="cplusplus"&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt; &amp;lt;!-- Bind our content type (AcmeContentType) to pages library --&amp;gt;&lt;br /&gt; &amp;lt;ContentTypeBinding ContentTypeId="0x010100C56..." ListUrl="$Resources:&lt;strong&gt;cmscore&lt;/strong&gt;,List_Pages_UrlName;" /&amp;gt; &lt;br /&gt;&amp;lt;/Elements&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre class="scroll"&gt;&lt;code class="html"&gt;&amp;lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;br /&gt; &amp;lt;!-- Bind our content type (AcmeContentType) to pages library --&amp;gt;&lt;br /&gt; &amp;lt;ContentTypeBinding ContentTypeId="0x010100C56..." ListUrl="$Resources:&lt;strong&gt;osrvcore&lt;/strong&gt;,List_Pages_UrlName;" /&amp;gt;&lt;br /&gt;&amp;lt;/Elements&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;solved the issue.&lt;/p&gt;
&lt;p&gt;TL;DR: Cmscore and osrvcore both have List_Pages_UrlName; for Spanish these do not match.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10213950" width="1" height="1"&gt;</content><author><name>Reidar</name><uri>http://blogs.msdn.com/Vaffeltyven/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint development localization webtemplates content type binding" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+development+localization+webtemplates+content+type+binding/" /></entry><entry><title>Assembly binding redirection bug fixed in June CU</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/07/18/assembly-binding-redirection-bug-fixed-in-june-cu.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/07/18/assembly-binding-redirection-bug-fixed-in-june-cu.aspx</id><published>2011-07-18T21:26:39Z</published><updated>2011-07-18T21:26:39Z</updated><content type="html">&lt;p&gt;In SharePoint 2007, upgrading a Web Part to a new version number was a bit complicated. But as Maurice Prather nicely explains in &lt;a href="http://www.bluedoglimited.com/SharePointThoughts/Lists/Posts/Post.aspx?ID=311"&gt;this article&lt;/a&gt;, this has become much simpler in SharePoint 2010. Although, due to a small bug, again described by Maurice in &lt;a href="http://www.bluedoglimited.com/SharePointThoughts/Lists/Posts/Post.aspx?ID=313"&gt;another great article&lt;/a&gt;, taking advantage of this in existing projects requires a bit of luck. If your public key token contains one or more byte pairs with a leading 0, you are not so lucky. As Maurice explains, the 0 will be stripped from the PublicKeyToken attribute of the BindingRedirect element in web.config. This will of course cause the binding redirect to fail, and the Web Part will render an error message.&lt;/p&gt;  &lt;p&gt;I was a bit surprised to see that this was not fixed in SP1, but luckily we didn’t have to wait that much longer. I have just tested this after installing the June CU and now it works as it should! I followed these steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create an empty SharePoint project.&lt;/li&gt;    &lt;li&gt;Add a strong name key file with a key like this: 0408d0be841e7310.&lt;/li&gt;    &lt;li&gt;Add a web part to the default feature.&lt;/li&gt;    &lt;li&gt;Deploy the project to a web application in a pre-June CU installation of SharePoint 2010. &lt;/li&gt;    &lt;li&gt;Add a web part to a page, and verify that it renders correctly.&lt;/li&gt;    &lt;li&gt;Update the assembly version of the project to 2.0.0.0, add a SafeControl entry for version 1.0.0.0, and a BindingRedirect element to the solution manifest.&lt;/li&gt;    &lt;li&gt;Deploy the project again, and confirm that the web part fails to render. Verify that the strong name key in web.config is incorrect, like this: 48d0be841e7310.&lt;/li&gt;    &lt;li&gt;Update SharePoint to the June CU, and deploy the solution package again. Verify that the web part now works as expected, and that a correct public key token has been added to web.config.&lt;/li&gt; &lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10187663" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Sending files to a record center using the SP2010 webservice Officialfile.asmx</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/06/06/sending-files-to-a-record-center-using-the-sp2010-webservice-officialfile-asmx.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/06/06/sending-files-to-a-record-center-using-the-sp2010-webservice-officialfile-asmx.aspx</id><published>2011-06-06T12:12:05Z</published><updated>2011-06-06T12:12:05Z</updated><content type="html">&lt;p&gt;When you send a document to the record center through&amp;#160; the web service officialfile.asmx there is a way to retain and even add more metadata to the file.&lt;/p&gt;  &lt;p&gt;In our case, we wanted to use the same content type on the team sites as inn the record center, but with some additional columns in the record center. Since all our content types are pushed out through a Managed Metadata service, they are easy to maintain and update. But we felt a bit uncomfortable if we had to expose metadata fields only meant for the record center in all our team sites. So how could we add them?&lt;/p&gt;  &lt;p&gt;It turned out we could use “RecordsRepositoryProperty” to accomplish this. In the code below, I generate a RecordsRepositoryProperty array of all the fields to the SPListItem we are about to send to the webservice and then I add another two “custom” properties. (You can of course add as many or few as you would like.)&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SPListItem item = workflowProperties.Item;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SPFile file = item.File;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; byte[] bytes = file.OpenBinary();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string fileType = file.Item.ContentType.Name;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SPFieldCollection fields = file.Item.Fields;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;//I’m adding two additional properties, hence the +2      &lt;br /&gt;OfficialFile.RecordsRepositoryProperty[] properties = new OfficialFile.RecordsRepositoryProperty[fields.Count + 2];&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font style="background-color: #ffff00"&gt;GenerateRecordsRepositoryArray&lt;/font&gt;(file, fields, properties);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Configuration.AppSettingsSection s = GetWebConfigSiteConfigurations();&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; OfficialFile.RecordsRepository sv = new OfficialFile.RecordsRepository();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string recordCenterUrl = s.Settings[&amp;quot;RecordCenterUrl&amp;quot;].Value;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sv.Url = recordCenterUrl + &amp;quot;/_vti_bin/officialfile.asmx&amp;quot;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string UserName = s.Settings[&amp;quot;RecordCenterLogInUserName&amp;quot;].Value;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string sDomain = s.Settings[&amp;quot;RecordCenterLogInDomain&amp;quot;].Value;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string PassWord = Password; //You should use some encryption here…&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CredentialCache credentialCache = new CredentialCache();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NetworkCredential credentials = new NetworkCredential(UserName, PassWord, sDomain);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; credentialCache.Add(new Uri(recordCenterUrl), &amp;quot;NTLM&amp;quot;, credentials);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //credentialCache.Add(new Uri(recordCenterUrl), &amp;quot;Negotiate&amp;quot;, credentials); //For some reason or another, this would not work?     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sv.Credentials = credentialCache;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string fullUrl = recordCenterUrl + string.Format(&amp;quot;{0}/{1}&amp;quot;, item.ParentList.ParentWebUrl, item.File.Url);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SubmitStatus = &amp;quot;Sending&amp;quot;;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SubmitStatus = sv.SubmitFile(bytes, properties, item.ContentType.ToString(), fullUrl, file.ModifiedBy.LoginName);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LogUtility.LogVerbose(string.Format(&amp;quot;Result code from submitting {0} to the record center is: {1}.&amp;quot;, file.Title, SubmitStatus), traceCategory);     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;private void &lt;font style="background-color: #ffff00"&gt;GenerateRecordsRepositoryArray&lt;/font&gt;(SPFile file, SPFieldCollection fields, OfficialFile.RecordsRepositoryProperty[] properties)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Create a RecordsRepositoryProperty for each metadata field.     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int i = 0;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; foreach (SPField field in fields)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; try     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string value = Convert.ToString(field.GetFieldValue(Convert.ToString(file.Item[field.Title])));     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LogUtility.LogVerbose(string.Format(&amp;quot;Name:{0}, Type:{1}, Value:{2}&amp;quot;, field.Title, field.TypeAsString, value), traceCategory);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; OfficialFile.RecordsRepositoryProperty property = new OfficialFile.RecordsRepositoryProperty     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = field.Title,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Type = field.TypeAsString,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Value = value     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; properties[i] = property;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; catch (Exception exception)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LogUtility.LogError(string.Format(&amp;quot;Error - Failed to process field {0}&amp;quot;, field.Title), exception, traceCategory);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; i++;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Add the two custom &amp;quot;field&amp;quot;, in order for the content organizer rules to pick them up.    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; OfficialFile.RecordsRepositoryProperty property1 = new OfficialFile.RecordsRepositoryProperty     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = FolderIDField,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Type = &amp;quot;Text&amp;quot;,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Value = FolderID     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; properties[i] = property1;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; OfficialFile.RecordsRepositoryProperty property2 = new OfficialFile.RecordsRepositoryProperty     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = SubFolderTitleField,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Type = &amp;quot;Text&amp;quot;,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Value = SubSiteTitle     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; i++;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; properties[i] = property2;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;These properties turn up in the record center’s drop off library in a column called “original properties”. So how can this be useful? It is really quite easy: If you have a column (on the record centers content type) whose name is the same as the RecordsRepositoryPropery’s name you are sending over, SharePoint will match them for you! &lt;/p&gt;  &lt;p&gt;So in our case, we have changed the content types in the record center only, by adding two more columns. We are sending RecordsRepositoryProperties over and matching the names. Then we can even use Content organizer rules to move the items along to the records library! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10171589" width="1" height="1"&gt;</content><author><name>Stian Kirkeberg</name><uri>http://blogs.msdn.com/stiank/ProfileUrlRedirect.ashx</uri></author><category term="workflow" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/workflow/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+2010/" /></entry><entry><title>Making sense of a multi-workload ECM SharePoint installation, Part 1, Concepts</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/01/27/making-sense-of-a-multi-workload-ecm-sharepoint-installation-part-1-concepts.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2011/01/27/making-sense-of-a-multi-workload-ecm-sharepoint-installation-part-1-concepts.aspx</id><published>2011-01-27T14:04:01Z</published><updated>2011-01-27T14:04:01Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/b/maximeb/about.aspx" target="_blank"&gt;Maxime&lt;/a&gt; has written a great article on ECM:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;h3&gt;&lt;em&gt;Introduction&lt;/em&gt;&lt;/h3&gt;    &lt;p&gt;&lt;em&gt;SharePoint made its name with collaboration tools that integrates very well with other Microsoft products and is the foremost tools for user adoption.&amp;#160; With SharePoint 2007, Web Content Management capabilities were integrated from CMS, and it was also the start of more Document Management and Record Management functionalities.&amp;#160; With SharePoint 2010, it now scales to the demand of large enterprises, and brings together the value of social computing for these enterprises.&amp;#160; After all, the most important asset …&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/b/maximeb/archive/2011/01/11/making-sense-of-a-multi-workload-ecm-sharepoint-installation-part-1-concepts.aspx" href="http://blogs.msdn.com/b/maximeb/archive/2011/01/11/making-sense-of-a-multi-workload-ecm-sharepoint-installation-part-1-concepts.aspx"&gt;http://blogs.msdn.com/b/maximeb/archive/2011/01/11/making-sense-of-a-multi-workload-ecm-sharepoint-installation-part-1-concepts.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I’m looking forward reading the next parts! &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/6215.wlEmoticon_2D00_smile_5F00_2EE9A54C.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10120988" width="1" height="1"&gt;</content><author><name>Stian Kirkeberg</name><uri>http://blogs.msdn.com/stiank/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Silverlight–HTML 5</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/11/24/silverlight-html-5.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2010/11/24/silverlight-html-5.aspx</id><published>2010-11-24T07:55:58Z</published><updated>2010-11-24T07:55:58Z</updated><content type="html">&lt;p&gt;A good article on the topic can be found at Mike Taulty’s Blog post &lt;em&gt;&lt;a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/11/01/silverlight-versus-html5-really.aspx"&gt;Silverlight *versus* HTML5? Really?&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;He gives a short overview, before he goes into a more lengthy detailed discussion on how they complement each other. There are also a lot of comments.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10095820" width="1" height="1"&gt;</content><author><name>Jon Løken</name><uri>http://blogs.msdn.com/jloken_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>"content type" is missing from "group by" settings when creating a new view</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/11/09/quot-content-type-quot-is-missing-from-quot-group-by-quot-settings-when-creating-a-new-view.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2010/11/09/quot-content-type-quot-is-missing-from-quot-group-by-quot-settings-when-creating-a-new-view.aspx</id><published>2010-11-09T13:55:25Z</published><updated>2010-11-09T13:55:25Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;When creating a new view the “Group by” function does not include “Content type” column. I’m sorry to say that this option will not be available in SP2010. (It is possible to do some work around with SPD, but they will disappear whenever the view is edited in SharePoint.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088149" width="1" height="1"&gt;</content><author><name>Stian Kirkeberg</name><uri>http://blogs.msdn.com/stiank/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>PowerGUI Visual Studio Extension is out of beta</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/07/06/powergui-visual-studio-extension-is-out-of-beta.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2010/07/06/powergui-visual-studio-extension-is-out-of-beta.aspx</id><published>2010-07-06T08:38:45Z</published><updated>2010-07-06T08:38:45Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.powergui.org"&gt;PowerGUI&lt;/a&gt; is a graphical user interface and script editor for PowerShell. So, PowerGUI is actually two products:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;PowerGUI, a graphical user interface for executing predefined PowerShell scripts. You can define scripts yourself, or download “PowerPacks” for different technologies like Windows, Exchange, etc. &lt;/li&gt;    &lt;li&gt;The PowerShell Script Editor, an editor for creating and debugging scripts, providing Intellisense and a variable watch pane. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;By now there is no PowerPack for SharePoint, so if you want to use PowerGUI you will need to create the scripts yourself (and maybe post them as a PowerPack!). The PowerGUI Script Editor on the other hand works great with SharePoint, and if you are willing to pay $199 you can get the Pro version, featuring version control integration and more. I have not tried the Pro version, so I don’t know how well it works.&lt;/p&gt;  &lt;p&gt;But as the title indicates the focus of this posting will be on the newly released &lt;a href="http://powerguivsx.codeplex.com/"&gt;PowerGUI Visual Studio Extension&lt;/a&gt;. PowerGUI Visual Studio Extension is an integration of the PowerGUI Script Editor into Visual Studio. In my opinion this is a very good idea because it brings PowerShell development into a familiar environment, as we can now maintain the scripts in Visual Studio projects. Additionally we get version control integration “for free.” &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/2625.Intellisense_5F00_2A2D6378.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" class="wlDisabledImage" title="Intellisense" border="0" alt="Intellisense" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/3125.Intellisense_5F00_thumb_5F00_2018C24D.png" width="544" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As a “SharePoint developer-configurator-deployer“, I have been doing some testing to see if it can be used for working with scripts related to SharePoint. The conclusion is that it’s unfortunately not a good idea...yet! The biggest disadvantage is that is doesn’t support debugging…yet! And secondly it doesn’t support the SharePoint PowerShell snap-in…yet! Debugging is planned, so we just have to be patient. The question is whether is will support the SharePoint snap-in in the future. This may not seem like a big deal, but remember, Visual Studio (even version 2010) is 32-bit, while SharePoint is 64-bit. Adam Driscoll, the creator, indicates that he may be able to work around this. Let’s hope for a couple of rainy days in his neighborhood &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/6355.wlEmoticonwinkingsmile_5F00_3CD23762.png" /&gt;, so he can stay inside and look into it soon. In the meantime we’ll have to stick with the PowerGUI Script Editor.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10034821" width="1" height="1"&gt;</content><author><name>Frank Jusnes</name><uri>http://blogs.msdn.com/mcsnoiwb/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Locking Down SharePoint Designer 2010</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/07/01/locking-down-sharepoint-designer-2010.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2010/07/01/locking-down-sharepoint-designer-2010.aspx</id><published>2010-07-01T10:29:00Z</published><updated>2010-07-01T10:29:00Z</updated><content type="html">&lt;p&gt;If you previously worked with Microsoft Office SharePoint Server 2007 you probably know a lot about SharePoint Designer already. Probably one big complaint, at least from the operational side for MOSS 2007 was that SharePoint Designer 2007 could be used so long down the road by the end user that It could break the site that it no longer worked. There was locking possibilities for SharePoint Designer 2007 but, for example, one option was to change the &lt;em&gt;ONET.XML&lt;/em&gt; file which you probably not wanted to. The SharePoint Designer Team blogged about these &lt;a href="http://blogs.msdn.com/b/sharepointdesigner/archive/2008/11/25/locking-down-sharepoint-designer.aspx"&gt;locking possibilities&lt;/a&gt; a while back. &lt;/p&gt;
&lt;p&gt;As for SharePoint Server 2010 a number of enhancements have helped this feature.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;All my SharePoint developer environments include SharePoint Designer. It was and is a quite powerful tool. When I started to work with the new version of SharePoint Designer it was really enjoying to see all the improvements that was done. A new tool in my eyes and a lot easier to use. And just to be clear, the 2007 edition is not compatible with SharePoint Server 2010, you have to use the new SharePoint Designer 2010. But as the 2007 edition, SharePoint Designer 2010 is downloadable for free; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=d88a1505-849b-4587-b854-a7054ee28d66"&gt;SharePoint Designer 2010 (32-bit)&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=566d3f55-77a5-4298-bb9c-f55f096b125d"&gt;SharePoint Designer 2010 (64-bit)&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One of the several improvements in SharePoint 2010 is the possibility to lock down SharePoint Designer usage. You can now prevent or set restriction on what users can do with the tool either at Site Collection level or at Web Application level. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setting restrictions at Site Collection level&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the Site Settings page you will find the SharePoint Designer Settings menu. (Available for Site Collection administrators). &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/1256.image_5F00_4.png"&gt;&lt;img height="148" width="244" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/8816.image_5F00_thumb_5F00_1.png" alt="image" border="0" title="image" class="wlDisabledImage" style="border-right-width: 0px; margin: 10px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Selecting this will give you the following possibilities at the Site Collection level: &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/6378.image_5F00_6.png"&gt;&lt;img height="328" width="753" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/3225.image_5F00_thumb_5F00_2.png" alt="image" border="0" title="image" class="wlDisabledImage" style="border-right-width: 0px; margin: 10px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As shown in the image above, SharePoint Designer is enabled by default but has additional settings available. &lt;/p&gt;
&lt;p&gt;Looking at the different settings the first one is quite ok, unselecting this will disable all usage of SharePoint Designer without the Site Collection administrators. This setting is enabled by default. The second setting is quite interesting, you can now control wherever your users should be allowed to detach pages from the Site Definition also known as unghosting. This is good, users are now prevented from creating unghosted pages which in the long run can be a pain. The third setting is about enabling users to customize master pages and page layouts which controls the default look and feel and the fourth and last setting is about if the users should see the hidden URL structure or not, such as the &lt;em&gt;_catalogs &lt;/em&gt;folder.&lt;/p&gt;
&lt;p&gt;Some quick testing; &lt;/p&gt;
&lt;p&gt;If we enable management of the hidden URL structure this will be available from SharePoint Designer 2010 as shown below&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/1007.image_5F00_13.png"&gt;&lt;img height="320" width="637" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/7532.image_5F00_thumb_5F00_3.png" alt="image" border="0" title="image" class="wlDisabledImage" style="border-right-width: 0px; margin: 10px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Allowing customization of Master Pages and Page Layouts, makes the page objects visible&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/6371.image_5F00_15.png"&gt;&lt;img height="329" width="643" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/0820.image_5F00_thumb_5F00_6.png" alt="image" border="0" title="image" class="wlDisabledImage" style="border-right-width: 0px; margin: 10px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: This setting only allow light changes to the pages. if you need to do advanced customizations you have to enable the setting &amp;lsquo;Enable detaching pages from the Site Definition&amp;rsquo; as well.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Last, if we completely disallow all usage of SharePoint Designer and then try to open a site in the collection using SharePoint Designer 2010, users are presented the following message; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/0842.image_5F00_2.png"&gt;&lt;img height="138" width="533" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/3582.image_5F00_thumb.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: Site Collection administrators will still be able to use SharePoint Designer 2010. They are not affected by the settings at this level. &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setting restrictions at Web Application level&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you open SharePoint 2010 Central Administration you will find a SharePoint Designer section in the General Application Settings menu.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/0116.image9.png"&gt;&lt;img height="63" width="285" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/4657.image9_5F00_thumb.png" alt="image" border="0" title="image" class="wlDisabledImage" style="border-right-width: 0px; margin: 10px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Opening this you are presented the following settings; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/8877.image_5F00_10.png"&gt;&lt;img height="350" width="751" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/1524.image_5F00_thumb_5F00_4.png" alt="image" border="0" title="image" class="wlDisabledImage" style="border-right-width: 0px; margin: 10px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see from the image above, SharePoint Designer settings are enabled by default at Web Application level. Adjusting these settings will set the restrictions of SharePoint Designer 2010 on what you choose at a specified Web Application. Even the Site Collection administrators are affected by these settings. &lt;/p&gt;
&lt;p&gt;Testing this, disabling all possible settings in SharePoint Central Administration and then turning back to our site, the available settings at site collection level are disabled as shown below. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/7713.image_5F00_12.png"&gt;&lt;img height="319" width="752" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/5756.image_5F00_thumb_5F00_5.png" alt="image" border="0" title="image" class="wlDisabledImage" style="border-right-width: 0px; margin: 10px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10033352" width="1" height="1"&gt;</content><author><name>karlmk</name><uri>http://blogs.msdn.com/karlmk/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+2010/" /><category term="SharePoint Designer 2010" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+Designer+2010/" /></entry><entry><title>Installing SharePoint 2010 prerequisites offline</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/06/07/installing-sharepoint-2010-prerequisites-offline.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2010/06/07/installing-sharepoint-2010-prerequisites-offline.aspx</id><published>2010-06-07T13:28:11Z</published><updated>2010-06-07T13:28:11Z</updated><content type="html">&lt;p&gt;I use my private server for different types of testing, it’s a really a try &amp;amp; fail environment. Some days back I created some new VM’s (I am running a Windows Server 2008 R2 host with Hyper-V enabled) and created an isolated private network that will run SharePoint Server 2010. As i had no problems setting up a new Domain and SQL server (by the way there is an excellent &lt;a href="http://technet.microsoft.com/en-us/library/ee256063(WS.10).aspx"&gt;TechNet article&lt;/a&gt; which describes how to set up a virtual ADDC), I experienced issues with the SharePoint Server 2010 Prerequisites Installer. As usual I started the installer, this fantastic little app doing the necessary boring stuff on your server making it ready for SharePoint 2010 :). It started off normally but stopped mid-way with a message that it failed on downloading the MS SQL 2008&amp;#160; Analysis Services ADOMD.NET component. Well, no wonder why, running VM’s in a private network makes them &lt;u&gt;Private&lt;/u&gt;, no access to the physical network off course. I had to install the prerequisite offline. &lt;/p&gt;  &lt;p&gt;The easiest will of course always be to install SharePoint 2010 on a internet connected server where the Prerequisites Installer downloads the necessary stuff. But what if you had a private network as mentioned or just that you wanted to have more control over the software that’s being installed, which version and so on. With a little more manual effort you can install the prerequisites offline. &lt;/p&gt;  &lt;p&gt;There is an explanation in &lt;a href="http://technet.microsoft.com/en-us/library/ff686793.aspx"&gt;this TechNet article&lt;/a&gt;, but I have also made a few points you can follow:&lt;/p&gt;  &lt;p&gt;1) If you don’t have the local copies of the prerequisites already, go get them. From a internet connected computer you can download them from &lt;a href="http://technet.microsoft.com/en-us/library/cc262485.aspx#section5"&gt;this TechNet article&lt;/a&gt;. Then they &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; have to be taken to a server that is reachable from your private network. (Lazy me just packed the files as an ISO image that i easily can mount any VM).&lt;/p&gt;  &lt;p&gt;2) Now, from the command line, find the PrerequisitesInstaller.exe on the root of your SharePoint 2010 media disk. &lt;/p&gt;  &lt;p&gt;3) Run the command &lt;strong&gt;&lt;strong&gt;PrerequisitesInstaller&lt;/strong&gt;.exe /?&amp;#160; &lt;/strong&gt;(which gives you the following message)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/3465.image4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/0675.image4_5F00_thumb.png" width="600" height="555" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can see it lists the different command options and most important the different s&lt;em&gt;witch's. &lt;/em&gt;A s&lt;em&gt;witch &lt;/em&gt;is a specific prerequisite identifier which represent an configuration/update for your server. &lt;/p&gt;  &lt;p&gt;For example, as described in the screenshot above, the SQLNCli &lt;em&gt;switch&lt;/em&gt; represents &lt;em&gt;Microsoft SQL Server 2008 Native Client while &lt;/em&gt;the ChartControl &lt;em&gt;switch &lt;/em&gt;represents the Microsoft Chart Controls for Microsoft .NET Framework 3.5. &lt;/p&gt;  &lt;p&gt;Giving the desired switch you have to enter the path to the software stored locally or on a network share in the following way, i.e: &lt;strong&gt;PrerequisitesInstaller.exe /SQLNCli:\\&amp;lt;&lt;em&gt;path to file&lt;/em&gt;&amp;gt; &lt;/strong&gt;which in this case sets the installation path for the MS SQL Server 2008 native client. &lt;/p&gt;  &lt;p&gt;If you need to install all prerequisites this way, you can enter several switch’s and their network path in pair and separate them by a space, like this: &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Prerequisitesinstaller.exe /SQLNCli:\\&amp;lt;path to file&amp;gt; /ChartControl:\\&amp;lt;path to file&amp;gt; /PowerShell:\\&amp;lt;path to file&amp;gt;&lt;/strong&gt;….and so on.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Note that the prerequisites installer will only install the prerequisites your OS needs. If the prerequisite is not applicable to your OS it will ignore it. It will of course also check if you have the necessary prerequisite already and if so skip the installation of the specified prerequisite. At last, if there is a prerequisite you need but you don’t specify it the installer will try to download from internet and install which in our scenario will fail because of no internet connection (It will generate an error similar as shown below).&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/2350.image_5F00_7.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/0118.image_5F00_thumb_5F00_2.png" width="605" height="455" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;4) In my environment and as shown above, the MS SQL 2008 AS ADOMD.NET installation failed so in this case I entered the following command giving the correct &lt;em&gt;switch&lt;/em&gt; and file path:&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;PrerequisitesInstaller.exe /ADOMD:\\adds\sp2010prerequisites\SQLSERVER2008_ASADOMD10.msi&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;5) This time the Prerequisites Installer went trough just fine and I got this successful message&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/6428.image_5F00_5.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/4212.image_5F00_thumb.png" width="601" height="452" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Note: It is also possible to install prerequisites using an arguments file. Please see &lt;a href="http://technet.microsoft.com/en-us/library/ff686793.aspx#install"&gt;this TechNet Article section&lt;/a&gt; for details.&amp;#160; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10020883" width="1" height="1"&gt;</content><author><name>karlmk</name><uri>http://blogs.msdn.com/karlmk/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+2010/" /></entry><entry><title>Script a Metadata Service Application using PowerShell</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/05/26/script-a-metadata-service-application-using-powershell.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2010/05/26/script-a-metadata-service-application-using-powershell.aspx</id><published>2010-05-26T21:25:49Z</published><updated>2010-05-26T21:25:49Z</updated><content type="html">&lt;p&gt;Scripting the deployment of service applications is a good idea; it is predictable, repeatable and gets you control over database names. I found a good script for the Metadata Service Application at &lt;a href="http://sharepoint.microsoft.com/blogs/zach/"&gt;Zach Rosenfield&lt;/a&gt;’s blog post &lt;a href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=50"&gt;SP+PS 2010: PowerShell to Create a Service Application&lt;/a&gt;.&amp;#160; Read Zach’s blog post for a detailed description of the script. &lt;/p&gt;  &lt;p&gt;Here is the script, adjusted with RTM changes:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="border-bottom: black 1px solid; border-left: black 1px solid; padding-bottom: 5px; padding-left: 5px; width: 750px; padding-right: 5px; font-family: consolas,lucida console; font-size: 10pt; overflow: auto; border-top: black 1px solid; border-right: black 1px solid; padding-top: 5px"&gt;   &lt;table border="0" cellspacing="0" cellpadding="5"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top"&gt;           &lt;div style="padding-bottom: 5px; padding-left: 5px; padding-right: 5px; font-family: consolas,lucida console; background: #cecece; font-size: 10pt; padding-top: 5px"&gt;001             &lt;br /&gt;002              &lt;br /&gt;003              &lt;br /&gt;004              &lt;br /&gt;005              &lt;br /&gt;006              &lt;br /&gt;007              &lt;br /&gt;008              &lt;br /&gt;009              &lt;br /&gt;010              &lt;br /&gt;011              &lt;br /&gt;012              &lt;br /&gt;013              &lt;br /&gt;014              &lt;br /&gt;015              &lt;br /&gt;016              &lt;br /&gt;017              &lt;br /&gt;018              &lt;br /&gt;019              &lt;br /&gt;020              &lt;br /&gt;021              &lt;br /&gt;022              &lt;br /&gt;023              &lt;br /&gt;024              &lt;br /&gt;025              &lt;br /&gt;026              &lt;br /&gt;027              &lt;br /&gt;028              &lt;br /&gt;029              &lt;br /&gt;030              &lt;br /&gt;031              &lt;br /&gt;032              &lt;br /&gt;033              &lt;br /&gt;034              &lt;br /&gt;035              &lt;br /&gt;036              &lt;br /&gt;037              &lt;br /&gt;038              &lt;br /&gt;039              &lt;br /&gt;040              &lt;br /&gt;041              &lt;br /&gt;042              &lt;br /&gt;043              &lt;br /&gt;044              &lt;br /&gt;045              &lt;br /&gt;046              &lt;br /&gt;047              &lt;br /&gt;048              &lt;br /&gt;049              &lt;br /&gt;050              &lt;br /&gt;051              &lt;br /&gt;052              &lt;br /&gt;053              &lt;br /&gt;054              &lt;br /&gt;055              &lt;br /&gt;056              &lt;br /&gt;057              &lt;br /&gt;058              &lt;br /&gt;059              &lt;br /&gt;060              &lt;br /&gt;061              &lt;br /&gt;062              &lt;br /&gt;063              &lt;br /&gt;064              &lt;br /&gt;065              &lt;br /&gt;066              &lt;br /&gt;067              &lt;br /&gt;068              &lt;br /&gt;069              &lt;br /&gt;070              &lt;br /&gt;071              &lt;br /&gt;072              &lt;br /&gt;073              &lt;br /&gt;074              &lt;br /&gt;075              &lt;br /&gt;076              &lt;br /&gt;077              &lt;br /&gt;078              &lt;br /&gt;079              &lt;br /&gt;080              &lt;br /&gt;081              &lt;br /&gt;082              &lt;br /&gt;083              &lt;br /&gt;084              &lt;br /&gt;085              &lt;br /&gt;086              &lt;br /&gt;087              &lt;br /&gt;088              &lt;br /&gt;089              &lt;br /&gt;090              &lt;br /&gt;091              &lt;br /&gt;092              &lt;br /&gt;093              &lt;br /&gt;094              &lt;br /&gt;095              &lt;br /&gt;096              &lt;br /&gt;097              &lt;br /&gt;098              &lt;br /&gt;099              &lt;br /&gt;100              &lt;br /&gt;101              &lt;br /&gt;102              &lt;br /&gt;103              &lt;br /&gt;104              &lt;br /&gt;105              &lt;br /&gt;106              &lt;br /&gt;107              &lt;br /&gt;108              &lt;br /&gt;109              &lt;br /&gt;110              &lt;br /&gt;111              &lt;br /&gt;112              &lt;br /&gt;113              &lt;br /&gt;&lt;/div&gt;         &lt;/td&gt;          &lt;td valign="top" nowrap="nowrap"&gt;           &lt;div style="padding-bottom: 5px; padding-left: 5px; padding-right: 5px; font-family: consolas,lucida console; background: #fcfcfc; font-size: 10pt; padding-top: 5px"&gt;&lt;span style="color: #0000ff"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;unrestricted&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #006400"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #006400"&gt;# Script for setup managed metadata service&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #006400"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Green&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;setup managed metadata service...&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$FarmName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Lab&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$DatabaseServer&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;LabDB&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$DatabaseUser&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;lab\spfarmservice&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$DatabaseUserPassword&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;ConvertTo-SecureString&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;pass@word1&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-AsPlainText&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-force&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$DatabaseCredentials&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-TypeName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;System.Management.Automation.PSCredential&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-argumentlist&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$DatabaseUser&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$DatabaseUserPassword&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationUser&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;lab\SpServiceApp&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationUserPassword&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;ConvertTo-SecureString&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;pass@word1&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-AsPlainText&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-force&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationCredentials&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-TypeName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;System.Management.Automation.PSCredential&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-argumentlist&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationUser&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationUserPassword&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;SecurityTokenServiceApplicationPool&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$MetadataDatabaseName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;{0}_Metadata&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-f&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$FarmName&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #ff4500"&gt;$MetadataServiceName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Managed Metadata Service&amp;quot;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #00008b"&gt;try&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#Managed Account&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Green&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Managed account...&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ManagedAccount&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Get-SPManagedAccount&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationUser&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ManagedAccount&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$NULL&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Green&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Create new managed account&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ManagedAccount&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;New-SPManagedAccount&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-Credential&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ServiceApplicationCredentials&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#App Pool&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Green&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;App pool...&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Get-SPServiceApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;SharePoint Hosted Services&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ea&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;SilentlyContinue&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$null&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Green&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Create new app pool&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;New-SPServiceApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;SharePoint Hosted Services&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-account&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ManagedAccount&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-not&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$?&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #00008b"&gt;throw&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Failed to create an application pool&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#Create a Taxonomy Service Application&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Green&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Create a Taxonomy Service Application...&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Get-SPServiceApplication&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;&lt;span style="color: #0000ff"&gt;?&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;TypeName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Managed Metadata Service&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$null&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;Write-Progress&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Creating Taxonomy Service Application&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-Status&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Please Wait...&amp;quot;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#get the service instance&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetadataServiceInstance&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Get-SPServiceInstance&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;&lt;span style="color: #0000ff"&gt;?&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;TypeName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Managed Metadata Web Service&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-not&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$?&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #00008b"&gt;throw&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Failed to find Metadata service instance&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#Start Service instance&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;Write-Progress&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Start Service instance&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-Status&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Please Wait...&amp;quot;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetadataserviceInstance&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Status&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Disabled&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetadataserviceInstance&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Start-SPServiceInstance&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-not&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$?&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #00008b"&gt;throw&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Failed to start Metadata service instance&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#Wait&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Yellow&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Waiting for Metadata service to provision&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;while&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-not&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetadataServiceInstance&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Status&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Online&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #006400"&gt;#wait for provisioning&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;# write status&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Yellow&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-NoNewline&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetadataServiceInstance&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Status&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;sleep&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #800080"&gt;5&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;write-host&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #000080"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8a2be2"&gt;Yellow&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-NoNewline&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;sleep&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #800080"&gt;5&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;# Update the object&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetadataServiceInstance&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Get-SPServiceInstance&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;&lt;span style="color: #0000ff"&gt;?&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;TypeName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Managed Metadata Web Service&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#Create Service App&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetaDataServiceApp&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;New-SPMetadataServiceApplication&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-Name&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Metadata Service Application&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$ApplicationPool&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #000080"&gt;-DatabaseServer&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$DatabaseServer&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-DatabaseName&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetadataDatabaseName&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-not&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$?&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #00008b"&gt;throw&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Failed to create Metadata Service Application&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;#create proxy&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetaDataServiceAppProxy&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;New-SPMetadataServiceApplicationProxy&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-Name&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Metadata Service Application Proxy&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-ServiceApplication&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MetaDataServiceApp&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000080"&gt;-DefaultProxyGroup&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #00008b"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;-not&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$?&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #00008b"&gt;throw&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Failed to create Metadata Service Application Proxy&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;              &lt;br /&gt;&lt;span style="color: #00008b"&gt;catch&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;{&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;Write-Output&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;#160;&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;              &lt;br /&gt;&lt;/div&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10015923" width="1" height="1"&gt;</content><author><name>Jon Løken</name><uri>http://blogs.msdn.com/jloken_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="PowerShell" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/PowerShell/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+2010/" /><category term="Service Applications" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/Service+Applications/" /></entry><entry><title>Debugging SharePoint – Web application could not be found Issue</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2010/05/25/debugging-sharepoint-web-application-could-not-be-found-issue.aspx" /><id>http://blogs.msdn.com/b/mcsnoiwb/archive/2010/05/25/debugging-sharepoint-web-application-could-not-be-found-issue.aspx</id><published>2010-05-25T09:47:49Z</published><updated>2010-05-25T09:47:49Z</updated><content type="html">&lt;p&gt;Sometimes when I debug my SharePoint code from Visual Studio, I get the exception: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Courier New"&gt;System.IO.FileNotFoundException was unhandled        &lt;br /&gt;&amp;#160; Message=The Web application at &lt;/font&gt;&lt;a href="http://jl-sp2010/"&gt;&lt;font size="2" face="Courier New"&gt;http://jl-sp2010/&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Courier New"&gt; could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.        &lt;br /&gt;&amp;#160; Source=Microsoft.SharePoint         &lt;br /&gt;&amp;#160; StackTrace:         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at Microsoft.SharePoint.SPSite..ctor(String requestUrl)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at SPConsoleApplication_SPRouterRule.Program.Main(String[] args) in C:\Install\SPConsoleApplication_SPInstall.Solution\SPConsoleApplication_SPRouterRule\Program.cs:line 33         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at System.Threading.ThreadHelper.ThreadStart()         &lt;br /&gt;&amp;#160; InnerException: &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;   &lt;br /&gt;Most often this is due to one of three things:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Must run as administrator &lt;/li&gt;    &lt;li&gt;Wrong target framework &lt;/li&gt;    &lt;li&gt;Wrong target application &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Run as administrator&lt;/h3&gt;  &lt;p&gt;The Visual Studio instance must be started as “Run as administrator”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/3125.image_5F00_16218309.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/6740.image_5F00_thumb_5F00_73E97782.png" width="244" height="132" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;Target framework: .NET Framework 3.5&lt;/h3&gt;  &lt;p&gt;Visual studio creates a new console application with the setting&amp;#160; .NET 4.0 . For SharePoint you need to set it to .NET Framework 3.5&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/3644.image_5F00_3D984F73.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/7851.image_5F00_thumb_5F00_7AD9043A.png" width="349" height="235" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h3&gt;Platform target: Any CPU&lt;/h3&gt;  &lt;p&gt;Visual studio creates a new console application with the setting&amp;#160; x.86 . For SharePoint you need to set it to Any CPU&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/8358.image_5F00_751DEA94.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-85-07-metablogapi/1184.image_5F00_thumb_5F00_1C94B6FF.png" width="347" height="168" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10014530" width="1" height="1"&gt;</content><author><name>Jon Løken</name><uri>http://blogs.msdn.com/jloken_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="developer" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/developer/" /><category term="SharePoint development" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+development/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/mcsnoiwb/archive/tags/SharePoint+2010/" /></entry></feed>