<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My SharePoint of View &#187; Mattias Karlsson</title>
	<atom:link href="http://mysharepointofview.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://mysharepointofview.com</link>
	<description>Thoughs from the field in SharePoint land</description>
	<lastBuildDate>Tue, 07 Dec 2010 17:04:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>A word about moving site collections</title>
		<link>http://mysharepointofview.com/2010/12/a-word-about-moving-site-collections/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-word-about-moving-site-collections</link>
		<comments>http://mysharepointofview.com/2010/12/a-word-about-moving-site-collections/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 17:04:27 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Operation]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Restore]]></category>
		<category><![CDATA[Site Collection]]></category>
		<category><![CDATA[STSADM]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=935</guid>
		<description><![CDATA[When the size of your site collections is increasing you sometimes have to move site collections around to put them in new content databases. There are a couple of different ways to perform a site collection move and I will try to cover some of them and end with a quite simple script that can [...]]]></description>
			<content:encoded><![CDATA[<p>When the size of your site collections is increasing you sometimes have to move site collections around to put them in new content databases. There are a couple of different ways to perform a site collection move and I will try to cover some of them and end with a quite simple script that can make the work even easier.</p>
<p>So the first one out is the simple <a title="Backup" href="http://technet.microsoft.com/en-us/library/cc263441(office.12).aspx">backup</a>/<a title="Restore" href="http://technet.microsoft.com/en-us/library/cc262087(office.12).aspx">restore </a>stsadm operations. The problem with this is that when doing the restore it&#8217;s not possible to specify what database to restore it to. So to be able to do this you need to lock the other content databases except the one you want to add it to. This might not be possible and the you could use a maintenance farm.</p>
<p>A much better option is the <a href="http://technet.microsoft.com/en-us/library/cc262923(office.12).aspx">mergecontentdbs </a>stsadm operation that was introduced in SP1 of Microsoft Office SharePoint Server 2007 and allows 3 different options. The first option only analyse the situation and calculate the amount of site collections in the content database and their size. The second option is to move all sites in the specified source content database and move them to the specified destination content database. Our last option is to use an xml file containing the sites that we want to move as an input file to the command and the operation will only move the sites specified in that xml-file</p>
<p>The best thing with the last option is that we can use the <a href="http://technet.microsoft.com/en-us/library/cc262492(office.12).aspx">enumsites</a> operation to get an xml file of all sites for our a specific web application.</p>
<pre>Example: stsadm -o enumsites -url [webAppUrl] -showlocks &gt; "D:tempsites.xml"</pre>
<p>The only problem with the above is that if you have a large amount of site collection and a number of content databases you will need to modify the list and remove the site collections that should not be moved to another content database. Later in this post I will show you how this problem can easily be addressed using PowerShell</p>
<p>Before using the mergecontentdbs operation you should consider two things. The first one is that since the mergecontentdbs operation is using the Content Deployment API it&#8217;s not suitable for sites larger then 10 GB. The other is that if content is changed during the operation you will not only risk losing the content but it could also cause database corruption as described in this KB: <a href="http://support.microsoft.com/kb/969242">http://support.microsoft.com/kb/969242</a>. So before moving the sites it&#8217;s a good recommendation to lock the site collections before the move.</p>
<p>To solve this I created a PowerShell script that does the following:</p>
<ol>
<li>Exports all the site collection for specific web application to an xml-file</li>
<li>Remove all sites in the file that is not located in the database I have specified</li>
<li>Sets the site collections to no access to prevent data loss</li>
<li>Move the sites from the source database to the destination database using the xml file</li>
<li>Offers you to make an IISreset on all WFEs in the farm (Recommended after the stsadm operation)</li>
<li>Set the site collection lock back to it&#8217;s original</li>
</ol>
<pre>$env:PATH = $env:PATH +
";C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12BIN" 

$webAppUrl = "http://myWebAppUrl"
$sourceContentDB = "SourceContentDB"
$destinationContentDB = "DestinationContentDB"
$xmlfile = "d:tempsites.xml" 

# enumerate through all site collections and save them to the XML-file
Write-Host "Retreives all site collections located at"
$webAppUrl "and save it to " $xmlfile
stsadm -o enumsites -url $webAppUrl -showlocks &gt; $xmlfile | out-null 

# Import the XML file content $sites = [xml](Get-Content $xmlfile)
# Remove only the site collections located in the source database
Write-Host "Cleaning up the" $xmlfile "file and remove sites that should not be affected"
$sites.Sites.Site | Where-Object {$_.ContentDatabase -ne $sourceContentdb} |
ForEach-Object { $_.ParentNode.RemoveChild($_) | out-null } 

# Enumerate through all the sites in the xml file and make necessary preparations 

foreach($site in $sites.sites.site) {
# Lock the sites to prevent errors when migration and data loss
Write-Host "Locking the site" $site.url "to prevent data loss"
stsadm -o setsitelock -url $site.URL -lock Noaccess
} 

# Moving sites
stsadm -o mergecontentdbs -url $webAppUrl -sourcedatabasename $sourceContentDB
  -destinationdatabasename $destinationContentDB -operation 3 -filename $xmlfile 

# Get the farm object to find get all the WFEs in the farm
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
Write-Host "To complete the move you need to make an IISreset on all WFEs in the farm"
Write-Host "You will now get the option to make an IISreset on all your WFEs"
Write-Host "" 

# Enumerate through all servers in the farm 

foreach ($svr in $farm.Servers) {
  foreach ($svc in $svr.ServiceInstances) {
    # If the server has the Windows SharePoint Services Web Application service it
    # is most likely it's a WFE.
    if($svc.TypeName -eq "Windows SharePoint Services Web Application"){
      # Ask if we should make an IISReset on the server
      $IISReset = Read-Host "Do you want to make an IIS-reset on"
      $svr.DisplayName "server (yes/No)?"
      if($IISReset.ToLower() -eq "yes") {
        iisreset $svr.DisplayName
      }
    }
  }
}
# Enumerate through all the sites in the xml file and finalize the move
foreach($site in $sites.sites.site) {
  # Set the original lockstate for the site collection
  Write-Host "Setting the original lock state for site" $site.url "to prevent data loss"
  stsadm -o setsitelock -url $site.URL -lock $site.Lock
}</pre>
<p>You can download the script [Download not found]. Just make sure you run it with an account that has sufficient permissions as described in the <a href="http://technet.microsoft.com/en-us/library/cc262923(office.12).aspx">enumcontentdbs</a> TechNet article and to modify the first 4 paramaters.</p>
<p>Another option to move site collections is to use the <a href="http://technet.microsoft.com/en-us/library/cc508852(office.12).aspx">Batch Site Manager</a> that is included in the <a href="http://technet.microsoft.com/en-us/library/cc508851(office.12).aspx">SharePoint Administration Toolkit</a>. This tool is packaged as a solution that you deploy to your farm. When deployed (and activated), it will then have a new option in Central Administration under Application Management.</p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/BatchSiteManager.jpg"><img class="alignnone size-full wp-image-948" title="BatchSiteManager" src="http://mysharepointofview.com/wp-content/uploads/2010/12/BatchSiteManager.jpg" alt="" width="420" height="57" /></a></p>
<p>The tool allows you to very nicely see all site collection for each content database, select the ones you want to move and create a timer job for the move. The Batch Site Manager is using the stsadm operations backup and restore in the background. It usually takes a bit longer then the mergecontentdbs but you get the option to specify when the timer job should be run, where to store the temporary file and you can get a email notification telling you the status of the move. As you can see in the screenshot above the tool also offers you to batch locking and deletion of sites.</p>
<p>The Batch Site Manager is recommended to use with sites up to 15 GB. The mentioned recommendations for the both tools should be seen as recommendation and it&#8217;s possible to test your way forward and what works in your environment.</p>
<p>So what about really large site collections?<br />
When moving really large sites none of the mentioned tools might work and you will then have to take on a different approach. In short this is what you need to do.</p>
<ol>
<li>Set the site collection that needs to be moved (farm 1) to read only and make a SQL backup of the content database (ContentDB A).</li>
<li>Restore the content database with a new name (ContentDB B) and attach it to your Maintanence farm (Farm B) or if you don&#8217;t have one to a different web application. Make sure you use the –assignnewdatabaseid since we will later on restore the database back to it&#8217;s original location</li>
<li>When it&#8217;s attached to farm B, use the <a href="http://technet.microsoft.com/en-us/library/cc261873(office.12).aspx">stsadm -deletesite</a> operation using the -gradualdelete parameter (introduced in the April CU) to remove the sites from ContentDB B that should not be moved.</li>
<li>Backup the ContentDB B and restore it (but don&#8217;t attach it yet) to your Farm A</li>
<li>Delete the large site from ContentDB A using stsadm and -gradualdelete.</li>
<li>When the site is deleted you can attach ContentDB A to Farm A</li>
<li>Unlock the site collection when done.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/12/a-word-about-moving-site-collections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save as site template changes in SharePoint 2010</title>
		<link>http://mysharepointofview.com/2010/12/save-as-site-template-changes-in-sharepoint-2010/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=save-as-site-template-changes-in-sharepoint-2010</link>
		<comments>http://mysharepointofview.com/2010/12/save-as-site-template-changes-in-sharepoint-2010/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 17:21:37 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=922</guid>
		<description><![CDATA[In SharePoint 2010 there is a new way to handle site templates, which I personally think is a very good improvement, and I will try to cover the changes here. When saving a site as a site template (found in Site settings and Site Actions) it will in SharePoint 2010 be saved as a .wsp [...]]]></description>
			<content:encoded><![CDATA[<p>In SharePoint 2010 there is a new way to handle site templates, which I personally think is a very good improvement, and I will try to cover the changes here.</p>
<p>When saving a site as a site template (found in Site settings and Site Actions) it will in SharePoint 2010 be saved as a .wsp file and stored in the Site collections solution gallery. This makes it very easy to reuse and redeploy the site template to other site collections or to other farms. It also means that the Site template gallery we had in the previous version is no longer needed or available in SharePoint 2010.</p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/SolutionGallery.jpg"></a><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/SolutionGallery.jpg"><img class="size-full wp-image-923 alignnone" title="SolutionGallery" src="http://mysharepointofview.com/wp-content/uploads/2010/12/SolutionGallery.jpg" alt="" width="500" height="404" /></a><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/SolutionGallery.jpg"></a></p>
<p>When the solution is saved it will automatically get activated so that if you want to create a new sub site within your site collection the Site template will be available directly after it is saved. So when choosing Site actions and New site it will be available there as seen below.</p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewSite.jpg"><img class="size-full wp-image-927 alignnone" title="CreateNewSite" src="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewSite.jpg" alt="" width="489" height="306" /></a></p>
<p>So what about saving a Site collection as a site template? Well since end users are not able to create Site collections from the UI you need to find a way to apply your new site template without having it to be deployed globally. Microsoft has thought of this so when creating a Site collection from Central administration you have the option to select &#8220;select template later&#8221;.</p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewSiteCollection.jpg"><img class="size-full wp-image-928 alignnone" title="CreateNewSiteCollection" src="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewSiteCollection.jpg" alt="" width="514" height="409" /></a></p>
<p>This option does not only mean that when browsing to the site the first time you are able to select any of the available templates but you are able to upload a new Site template and by doing that the wsp will be saved in the new Site collection solution gallery. Quite neat isn&#8217;t it?</p>
<p>As you can see below, we are browsing to the new site and from there we have the link to our Site collection solution gallery. There we can upload the .wsp-file containing our site template. Next time we browse to the site collection root our new site template will be available under the custom tab.</p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewSiteCollectionUI1.jpg"><img class="alignnone size-full wp-image-931" title="CreateNewSiteCollectionUI" src="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewSiteCollectionUI1.jpg" alt="" width="493" height="316" /></a><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewSiteCollectionUI.jpg"></a></p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewCustomSiteTemplate.jpg"><img class="alignnone size-full wp-image-930" title="CreateNewCustomSiteTemplate" src="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewCustomSiteTemplate.jpg" alt="" width="493" height="316" /></a><a href="http://mysharepointofview.com/wp-content/uploads/2010/12/CreateNewCustomSiteTemplate.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/12/save-as-site-template-changes-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Swedish SharePoint Usergroup meeting in Gotheburg</title>
		<link>http://mysharepointofview.com/2010/11/swedish-sharepoint-usergroup-meeting-in-gotheburg/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=swedish-sharepoint-usergroup-meeting-in-gotheburg</link>
		<comments>http://mysharepointofview.com/2010/11/swedish-sharepoint-usergroup-meeting-in-gotheburg/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 16:43:04 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Usergroup]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=919</guid>
		<description><![CDATA[It&#8217;s been a while since we had a usergroup in Gotheburg but now it&#8217;s time another one. This time it will be held at Altran the 8th of December and we will have two interesting sessions. The first one will be about Office365, held by Andre Henriksson from Microsoft. We will then listen to the [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since we had a usergroup in Gotheburg but now it&#8217;s time another one. This time it will be held at Altran the 8th of December and we will have two interesting sessions. The first one will be about Office365, held by Andre Henriksson from Microsoft. We will then listen to the interesting SharePoint 2010 projects that is going on at the Chalmers here in Gothenburg.</p>
<p>The exact location and registration can be found at <a href="http://www.ssug.se">www.ssug.se</a></p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/11/swedish-sharepoint-usergroup-meeting-in-gotheburg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable or enable a health rule in SharePoint 2010 using PowerShell</title>
		<link>http://mysharepointofview.com/2010/11/disable-or-enable-a-health-rule-in-sharepoint-2010/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=disable-or-enable-a-health-rule-in-sharepoint-2010</link>
		<comments>http://mysharepointofview.com/2010/11/disable-or-enable-a-health-rule-in-sharepoint-2010/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 15:28:53 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[Health analyzer]]></category>
		<category><![CDATA[Health rule]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=911</guid>
		<description><![CDATA[One really good new feature in SharePoint 2010 for us admins are the Health Analyzer. From a set of health rules the Health analyzer checks on  regular basis for problems or potential issues in your farm. SharePoint is shipped with a bunch of rules checking for instance things like disk space, if application pool accounts [...]]]></description>
			<content:encoded><![CDATA[<p>One really good new feature in SharePoint 2010 for us admins are the Health Analyzer. From a set of health rules the Health analyzer checks on  regular basis for problems or potential issues in your farm. SharePoint is shipped with a bunch of rules checking for instance things like disk space, if application pool accounts are in the local admin group, web.config settings etc. Some of these rules even offer the possibility to fix the problem automatically and it&#8217;s possible to build custom health rules.</p>
<p>In some scenarios these rules are not applicable for you. For instance you might know that you have a content database over the recommendation then you don&#8217;t want to get an alert every hour it is run. This can easily be changed from central administration but if you want to script it using PowerShell to build it into e.g. your installation script this is how you do.</p>
<p>Open up the SharePoint management shell.</p>
<p>First we need to connect to the list containing all the health rules. This is done from through the SPHealthReportsList class.</p>
<pre>$haList = [Microsoft.SharePoint.Administration.Health.SPHealthRulesList]::Local.Items</pre>
<p>Next thing we need to do is to get the ID of the specific rule. This can be done from Central Administration by clicking on an item. Right click on the page and take properties. In the Querystring in the Address field you will find the ID.</p>
<p>You can of course get the ID through PowerShell as well. The below line shows all the name of all items and their ID.</p>
<pre>$haList | Select-Object title, id | Format-List</pre>
<p>When you know the ID of the rule to disable (or enable) you simply get the item and set the HealthRuleCheckEnabled to True or False. When that is done we just update the item with the Update() method.</p>
<pre>$healthRule = $haList.GetItemById(1)
$healthRule["HealthRuleCheckEnabled"] = $false
$healthRule.Update()</pre>
<p>That&#8217;s all for today, hope you found it useful and now it&#8217;s time for weekend!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/11/disable-or-enable-a-health-rule-in-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quotas and locks for sandbox solutions</title>
		<link>http://mysharepointofview.com/2010/10/quotas-and-locks-for-sandbox-solutions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quotas-and-locks-for-sandbox-solutions</link>
		<comments>http://mysharepointofview.com/2010/10/quotas-and-locks-for-sandbox-solutions/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 17:18:32 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Quota templates]]></category>
		<category><![CDATA[ResourceMeasures]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=893</guid>
		<description><![CDATA[When configuring Quota templates in SharePoint 2010 you will notice that a new section is added to the page. It&#8217;s called Sandbox solutions with Code Limits and is used to put a quota on sandbox solutions so that solutions that does not work properly will be shut down and not work when it reaches the maximum [...]]]></description>
			<content:encoded><![CDATA[<p>When configuring Quota templates in SharePoint 2010 you will notice that a new section is added to the page. It&#8217;s called <em>Sandbox solutions with Code Limits</em> and is used to put a quota on sandbox solutions so that solutions that does not work properly will be shut down and not work when it reaches the maximum daily quota. In this way we can limit sandbox solutions and protect our farm from poorly written code. As you can see on the screenshot below the values that should be specified (300 and 100 as default) are measured in points. So what is a point in this case? </p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/10/SandboxSolutionsQuotas.jpg"><img class="size-full wp-image-894 alignnone" title="SandboxSolutionsQuotas" src="http://mysharepointofview.com/wp-content/uploads/2010/10/SandboxSolutionsQuotas.jpg" alt="" width="527" height="91" /></a><a href="http://mysharepointofview.com/wp-content/uploads/2010/10/SandboxSolutionsQuotas.jpg"></a> </p>
<p>Microsoft has developed a way to calculate &#8220;problems&#8221;  within a solution based on a number of different metrics. To see what matrics are used you can use PowerShell and type the two following line of code in the <em>SharePoint 2010 Management Shell:</em> </p>
<pre>PS &gt; $spCodeService = [Microsoft.SharePoint.Administration.SPUserCodeService]::Local
PS &gt; $spCodeService.ResourceMeasures | select name</pre>
<pre>Name
----
AbnormalProcessTerminationCount
CPUExecutionTime
CriticalExceptionCount
IdlePercentProcessorTime
InvocationCount
PercentProcessorTime
ProcessCPUCycles
ProcessHandleCount
ProcessIOBytes
ProcessThreadCount
ProcessVirtualBytes
SharePointDatabaseQueryCount
SharePointDatabaseQueryTime
UnhandledExceptionCount
UnresponsiveprocessCount</pre>
<p>This will generate a list of all the Resource Measures. Each item has a number of properties that defines how the points should be calculated. If we take a closer look to the first item by typing: </p>
<pre>PS &gt; $spCodeService.ResourceMeasures["AbnormalProcessTerminationCount"]</pre>
<pre>MinimumThreshold                : 0
ResourcesPerPoint               : 1
AbsoluteLimit                   : 2
DiskSizeRequired                : 0
CanSelectForBackup              : False
CanRenameOnRestore              : False
CanSelectForRestore             : True
CanBackupRestoreAsConfiguration : True
Name                            : AbnormalProcessTerminationCount
TypeName                        : Microsoft.SharePoint.Administration.SPResourc
                                  eMeasure
DisplayName                     : AbnormalProcessTerminationCount
Id                              : 9056369d-768e-42bd-bd9c-67d810ad7936
Status                          : Online
Parent                          : SPUserCodeService Name=SPUserCodeV4
Version                         : 2410
Properties                      : {}
Farm                            : SPFarm Name=SharePoint_SP2010TestFarm_ConfigD
                                  B
UpgradedPersistedProperties     : {} </pre>
<p>In the above case the RecourcesPerPoint value is set to one. This means that whenever an Abnormal Process Termination occurs it will generate one &#8220;point&#8221;. You can also see that there is a AbsoluteLimit value. If any specific ResourceMeasure hits its AboluteLimit it will shut down the solution even if the daily quota of points is not reached. By typing the following you can see each ResourceMeasure&#8217;s ResourcesPerPoint and AbsoluteLimit values:</p>
<pre>PS &gt; $spCodeService.ResourceMeasures | select name, resourcesperpoint, absolutelimit</pre>
<pre>Name                                ResourcesPerPoint             AbsoluteLimit
----                                -----------------             -------------
AbnormalProcessTerminat...                          1                         2
CPUExecutionTime                                  200                        60
CriticalExceptionCount                             10                         3
IdlePercentProcessorTime                          100                        10
InvocationCount                                   100                       100
PercentProcessorTime                               85                       100
ProcessCPUCycles                         100000000000              100000000000
ProcessHandleCount                              10000                      5000
ProcessIOBytes                               10000000                 100000000
ProcessThreadCount                              10000                       200
ProcessVirtualBytes                        1000000000                4000000000
SharePointDatabaseQuery...                        400                       100
SharePointDatabaseQuery...                         20                        60
UnhandledExceptionCount                            50                         3
UnresponsiveprocessCount                            2                         1</pre>
<pre> </pre>
<p>It is possible to change the these values if you want to tweek how the points are calculated. To change the AbsoluteLimit on the AbnormalProcessTerminationCount you simply type: </p>
<pre>PS &gt; $spCodeService.ResourceMeasures["AbnormalProcessTerminationCount"] `
.AbsoluteLimit = 2</pre>
<p>If you want to change the Max Point quota for a specific site collection you can do that by typing: </p>
<pre>PS &gt; (get-spsite http://SPsiteURL).Quota.UserCodeMaximumLevel = 200</pre>
<p>Or of you want to change the quota on all site collections this is how you do. Get all site collections using the Get-SPSite cmdlet and then you pipe it to a foreach-object and then set the new value. </p>
<pre>PS &gt; Get-SPSite | foreach-object {$_.Quota.UserCodeMaximumLevel = 200}</pre>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/10/quotas-and-locks-for-sandbox-solutions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The book is now published!</title>
		<link>http://mysharepointofview.com/2010/10/the-book-is-now-published/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-book-is-now-published</link>
		<comments>http://mysharepointofview.com/2010/10/the-book-is-now-published/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 09:06:38 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[The book]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=885</guid>
		<description><![CDATA[It’s an honor for us to be able to announce that our book PowerShell for Microsoft SharePoint 2010 Administrators is now published! This Friday it was published in the US and at www.amazon.com. Within the next couple of weeks it will also be available in the rest of the world; at book stores and at [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/10/SharePointPowerShell.jpg"><img class="alignright size-full wp-image-886" style="margin: 10px;" title="SharePointPowerShell" src="http://mysharepointofview.com/wp-content/uploads/2010/10/SharePointPowerShell.jpg" alt="" width="158" height="235" /></a>It’s an honor for us to be able to announce that our book PowerShell for Microsoft SharePoint 2010 Administrators is now published! This Friday it was published in the US and at <a title="www.amazon.com" href="http://amzn.com/0071747974" target="_blank">www.amazon.com</a>. Within the next couple of weeks it will also be available in the rest of the world; at book stores and at different internet stores shipping to local addresses.</p>
<p>The final book ended in 368 pages that stretches over 21 chapters. The book is divided in three parts. The first part gives an introduction to the changes in SharePoint 2010 and sets the terminology for the coming chapters. In the second part we go through the basics of PowerShell, before we move on to the third part which is the majority of the book. Here we use real life scenarios and hands-on guides with a lot of code examples to explain how to automate and take full control over your SharePoint 2010 environment using PowerShell.</p>
<p>PowerShell will have a huge impact on how SharePoint administrators work. This is, so far, the only book covering everything you need to know about managing SharePoint 2010 with PowerShell and we hope you will enjoy it.</p>
<p>We feel very pleased with the final result and we have received nothing but great feedback from the group of people that got the chance to see the book before it got released. We hope that this book will be useful for you and every IT-Pro working with SharePoint 2010. So find the nearest reseller and let us know what you think.</p>
<p><strong><span style="text-decoration: underline;">Said about the book:</span></strong></p>
<p><strong><em>-“If you want to automate your SharePoint 2010<br />
environment this book is for you”</em></strong><em><br />
-Dr Tobias Weltner, MVP PowerShell</em></p>
<p><strong><em>-“This book is a must for all SharePoint administrators!”</em></strong><em><br />
-Göran Husman, SharePoint MVP and author</em></p>
<p><strong><em>-“PowerShell should be at the top of every SharePoint IT pro<br />
and developer toolbox”</em></strong><em><br />
-Jeremy Thake, SharePoint Server MVP</em></p>
<p><strong><em>-“A must-read, task-based guide to using PowerShell for<br />
SharePoint administrators”</em></strong><em><br />
-Ravikanth Chaganti, MVP PowerShell</em></p>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/10/the-book-is-now-published/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moving scripts to Codeplex</title>
		<link>http://mysharepointofview.com/2010/09/moving-scripts-to-codeplex/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=moving-scripts-to-codeplex</link>
		<comments>http://mysharepointofview.com/2010/09/moving-scripts-to-codeplex/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 17:02:59 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=879</guid>
		<description><![CDATA[Since I while back I have made my scripts available from the download section here at my blog. I have now decided to move some of my PowerShell scripts to the CodePlex project: http://sharepointpsscripts.codeplex.com/ and hope that in this way, more people will find it useful. The first script that is now available only on CodePlex [...]]]></description>
			<content:encoded><![CDATA[<p>Since I while back I have made my scripts available from the download section here at my blog. I have now decided to move some of my PowerShell scripts to the CodePlex project: <a href="http://sharepointpsscripts.codeplex.com/">http://sharepointpsscripts.codeplex.com/</a> and hope that in this way, more people will find it useful.</p>
<p>The first script that is now available only on CodePlex is the Enum-SPContentDatabases script that is made for SharePoint 2007 and helps administrators to get a list of all content databases for all Web applications within a farm. The output format is either xml or csv. The script can now be found here: <a href="http://sharepointpsscripts.codeplex.com/releases/view/53114">http://sharepointpsscripts.codeplex.com/releases/view/53114</a></p>
<p>My original blog post about this is found here: <a href="http://mysharepointofview.com/2010/01/enumerate-all-content-databases-using-powershell/">http://mysharepointofview.com/2010/01/enumerate-all-content-databases-using-powershell/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/09/moving-scripts-to-codeplex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How many sites are using a specific template?</title>
		<link>http://mysharepointofview.com/2010/09/how-many-sites-are-using-a-specific-template/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-many-sites-are-using-a-specific-template</link>
		<comments>http://mysharepointofview.com/2010/09/how-many-sites-are-using-a-specific-template/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 17:31:35 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Template]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=871</guid>
		<description><![CDATA[I got a question the other day, if it was possible to in an easy way find out how many sites within a site collection were using the Blog template. There is a quite easy way using PowerShell to accomplish this and in this case we talk about SharePoint 2007/WSS 3.0 Open up PowerShell with [...]]]></description>
			<content:encoded><![CDATA[<p>I got a question the other day, if it was possible to in an easy way find out how many sites within a site collection were using the Blog template. There is a quite easy way using PowerShell to accomplish this and in this case we talk about SharePoint 2007/WSS 3.0</p>
<p>Open up PowerShell with an account that has access to the sites and type:</p>
<pre>[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$spsite = New-Object Microsoft.SharePoint.SPSite("http://yoursite")
($spsite.AllWebs | where {$_.WebTemplate -eq "BLOG#0"}).count</pre>
<p>I tested this on a quite small site collection ~500 webs. If it&#8217;s a large site collection (number of sites) you should be a bit careful since it might take up a lot of resources. If you use PowerShell V2 then you should first set the ThreadOption to ReuseThread like below.<br />
$host.Runspace.ThreadOptions = &#8220;ReuseThread&#8221;</p>
<p>If you want to search for another type of built-in or custom template you can do so by just changing the value &#8220;BLOG#0&#8243;. If you want to see all available templates and their internal name you type (where 1033 is your LCID):</p>
<pre>$spsite.GetWebTemplates(1033) | select Name</pre>
<p>That&#8217;s all for now!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/09/how-many-sites-are-using-a-specific-template/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Application Server Administration job failed event id 6482</title>
		<link>http://mysharepointofview.com/2010/08/application-server-administration-job-failed-event-id-6482/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=application-server-administration-job-failed-event-id-6482</link>
		<comments>http://mysharepointofview.com/2010/08/application-server-administration-job-failed-event-id-6482/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 18:23:23 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Event ID 6482]]></category>
		<category><![CDATA[MachineKeys]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=864</guid>
		<description><![CDATA[ I ran across an interesting problem today at a customer that I thought I&#8217;ll share with you. The background to the problem is that a SharePoint server 2007 farm needed to be moved to another AD (don&#8217;t ask why it was there in the first place&#8230;) and since we needed new service accounts the farm was taken [...]]]></description>
			<content:encoded><![CDATA[<p> I ran across an interesting problem today at a customer that I thought I&#8217;ll share with you. The background to the problem is that a SharePoint server 2007 farm needed to be moved to another AD (don&#8217;t ask why it was there in the first place&#8230;) and since we needed new service accounts the farm was taken down, servers where moved and then  the farm was installed again on the same servers. So far no problem at all and the installation ran successfully. But when I looked in the event viewer I saw that every minute on all servers in the farm I got the following Event ID 6482 every minute.</p>
<p>Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchAdminSharedWebServiceInstance (6b98c51f-116c-49f0-9aa6-4207555ed2f8).</p>
<p>Reason: The handle is invalid.</p>
<p>Techinal Support Details:</p>
<p>System.Security.Cryptography.CryptographicException: The handle is invalid.<br />
at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean<br />
andomKeyContainer)<br />
at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle&amp; safeProvHandle, SafeKeyHandle&amp; safeKeyHandle)<br />
at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()<br />
at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)<br />
at Microsoft.SharePoint.Utilities.CertificateManager.CreateSelfSignedSslCertificate(CspParameters parameters, X500DistinguishedName name, DateTime expiresAfter)<br />
at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ProvisionIisWebSite(String serverComment, String[] serverBindings, String[] secureBindings, AuthenticationMethods authenticationMethods, String[] authenticationProviders, String path, AccessFlags accessFlags, String applicationName, String applicationPoolId, String[] scriptMaps, String sslCertificateSubjectName)<br />
at Microsoft.SharePoint.Administration.SPMetabaseManager.ProvisionIisWebSite(String serverComment, String[] serverBindings, String[] secureBindings, Int32 authenticationMethods, String[] authenticationProviders, String path, Int32 accessFlags, String applicationName, String applicationPoolId, String[] scriptMaps, String sslCertificateSubjectName)<br />
at Microsoft.Office.Server.Administration.SharedWebServiceInstance.Synchronize()<br />
at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)<br />
After some troubleshooting, googling and talking to the windows team I found that the folder:<br />
<em>C:Documents and SettingsAll UsersApplication DataMicrosoftCryptoRSAMachineKeys </em>most likely had the wrong permissions. One of the files located in the folder didn&#8217;t seemed to like the move and when trying to look at the permissions I got this:</p>
<p><a href="http://mysharepointofview.com/wp-content/uploads/2010/08/RSAPermissions.jpg"><img title="RSAPermissions" src="http://mysharepointofview.com/wp-content/uploads/2010/08/RSAPermissions.jpg" alt="" width="466" height="88" /></a></p>
<p>So, what I did was that I gave the ownership of this folder to the local administrators group which is done in the following way:</p>
<p>Click Ok on the warning that is shown above.</p>
<p>Click on Advanced and then on the Owner tab.</p>
<p>Select administrators, and click Ok until all windows are closed</p>
<p>Open up the security dialogue again and add the local administrators group and click ok. Note that if you have moved the server from one AD to another you will most likely see the old AD account in the security list which should be deleted.</p>
<p>You should add the local Administrator group to the MachineKeys folder above an make sure that it inherits the permissions.</p>
<p>This should solve the problem for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/08/application-server-administration-job-failed-event-id-6482/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Secrets of SharePoint &#8211; A new community site</title>
		<link>http://mysharepointofview.com/2010/08/secrets-of-sharepoint-a-new-community-site/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=secrets-of-sharepoint-a-new-community-site</link>
		<comments>http://mysharepointofview.com/2010/08/secrets-of-sharepoint-a-new-community-site/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 13:56:33 +0000</pubDate>
		<dc:creator>Mattias Karlsson</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Secretsofsharepoint]]></category>

		<guid isPermaLink="false">http://mysharepointofview.com/?p=862</guid>
		<description><![CDATA[Today a new community site for us SharePoint folks are launched, and I have to say that I&#8217;m quite exited about it. First, because it will be a one-stop location for Microsoft SharePoint best practice information and educational materials for SharePoint administrators, developers and users. Secondly, I have been asked to be one of the [...]]]></description>
			<content:encoded><![CDATA[<p>Today a new community site for us SharePoint folks are launched, and I have to say that I&#8217;m quite exited about it. First, because it will be a one-stop location for Microsoft SharePoint best practice information and educational materials for SharePoint administrators, developers and users. Secondly, I have been asked to be one of the moderators for the forum and an &#8220;Expert in Residence&#8221; for the Installation, Configuration and Administration section (<a href="http://www.idera.com/News/?NewsCategory=0&amp;ID=256">http://www.idera.com/News/?NewsCategory=0&amp;ID=256</a>).</p>
<p>Now in the beginning there are a some prices that can be won if you just sign up. And why wouldn&#8217;t you, it&#8217;s free and you can win an iPad and other nice things!! If you have any questions on any of the topics, don&#8217;t hesitate to post them in the forum. The link to the site is <a href="http://www.secretsofsharepoint.com">www.secretsofsharepoint.com</a> and to read the press release you can do that on Idera who is one of the main sponsors of the site. <a href="http://www.idera.com/News/?NewsCategory=0&amp;ID=263">http://www.idera.com/News/?NewsCategory=0&amp;ID=263</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mysharepointofview.com/2010/08/secrets-of-sharepoint-a-new-community-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

