<?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>mylifeinaminute.com &#187; PowerShell</title>
	<atom:link href="http://www.mylifeinaminute.com/category/microsoft/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mylifeinaminute.com</link>
	<description>You can learn a lot in a minute</description>
	<lastBuildDate>Wed, 18 Jan 2012 02:33:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SharePoint 2010 Information Worker FAST Search Certificate</title>
		<link>http://www.mylifeinaminute.com/2011/07/24/sharepoint-2010-information-worker-fast-search-certificate/</link>
		<comments>http://www.mylifeinaminute.com/2011/07/24/sharepoint-2010-information-worker-fast-search-certificate/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 15:32:18 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[FAST Search]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=1079</guid>
		<description><![CDATA[In the SharePoint 2010 Information Worker, the FASTSearchCert deployed in the image expired in April 2011 and needs to be updated. The following script (credit to Bryan Hart) will update the certicate in a single elevated PowerShell prompt. Reference Remember to give your SharePoint 2010 Information Worker Virtual Machine a fresh certificate]]></description>
			<content:encoded><![CDATA[<p>In the <a href="/tag/sharepoint-2010/" title="SharePoint 2010">SharePoint 2010</a> Information Worker, the FASTSearchCert deployed in the image expired in April 2011 and needs to be updated. </p>
<p>The following script (credit to <a href="http://www.solanite.com/" title="Solanite Consulting">Bryan Hart</a>) will update the certicate in a single elevated <a href="/tag/powershell" title="PowerShell">PowerShell</a> prompt.</p>
<pre class="brush: powershell; title: ; notranslate">
###################################
# Apply Certificate to FAST
###################################
write-host &quot;Applying Certificate to FAST&quot; -ForegroundColor Yellow

Add-PSSnapin AdminSnapIn
Add-PSSnapin Microsoft.FASTSearch.PowerShell
Add-PSSnapin Microsoft.SharePoint.PowerShell

stop-service FAST*

$installerdir = $env:FASTSEARCH + &quot;installer\scripts&quot;

cd $installerdir

$pw = ConvertTo-SecureString -AsPlainText -force pass@word1

.\ReplaceDefaultCertificate.ps1 -generateNewCertificate $true -certificatePassword $pw

$cert = @(dir cert:\LocalMachine\My -recurse | ? { $_.Subject -eq 'CN=FASTSearchCert' })[0]

$thumb = $cert.Thumbprint

Start-service FAST*

.\SecureFASTSearchConnector.ps1 -certThumbprint $thumb -ssaName &quot;FASTContent&quot; -username &quot;contoso\administrator&quot;
</pre>
<h4>Reference</h4>
<ul>
<li><a href="http://techmikael.blogspot.com/2011/04/remember-to-give-your-sharepoint-2010.html" title="Remember to give your SharePoint 2010 Information Worker Virtual Machine a fresh certificate">Remember to give your SharePoint 2010 Information Worker Virtual Machine a fresh certificate</a></li>
</ul>
<p><map name='google_ad_map_1079_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1079?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1079_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1079&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F07%2F24%2Fsharepoint-2010-information-worker-fast-search-certificate%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/07/24/sharepoint-2010-information-worker-fast-search-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Setting Document Library Versioning with PowerShell</title>
		<link>http://www.mylifeinaminute.com/2011/07/21/sharepoint-2010-setting-document-library-versioning-with-powershell/</link>
		<comments>http://www.mylifeinaminute.com/2011/07/21/sharepoint-2010-setting-document-library-versioning-with-powershell/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 13:59:15 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=1066</guid>
		<description><![CDATA[I recently had an interesting situation come up where a Governance committee (you have one right?) decided to alter their document versioning guidelines. The current policy dictated that all documents had both major/minor versioning. The new policy stated that the organization would be moving to a major versioning only scheme. With thousands of document libraries [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had an interesting situation come up where a Governance committee (<a href="https://www.nothingbutsharepoint.com/sites/eusp/Pages/SharePoint-Governance-Why.aspx" title="SharePoint Governance - Why?">you have one right?</a>) decided to alter their document versioning guidelines. The current policy dictated that all documents had both major/minor versioning. The new policy stated that the organization would be moving to a major versioning only scheme. </p>
<p>With thousands of document libraries in an established farm, the prospect of visiting thousands of List Settings pages was not at all appealing. <a href="/tag/powershell/" title="PowerShell">PowerShell</a> to the rescue. </p>
<h4>The Script</h4>
<p>The following script accepts a parent web and enumerates all of its children (optional), altering the libaries that match the criteria &#8220;Not a System/Style/Hidden library&#8221; and &#8220;has minor versioning currently enabled&#8221;. The matching libraries are updated to force document checkouts and accept an unlimited numer of major versions (Governance decision, no listening to reason there).</p>
<pre class="brush: powershell; title: ; notranslate">
function Reset-SPDocumentLibaries {
	param (
		[string] $WebUrl = $(Read-Host -prompt &quot;Enter a Url&quot;),
        [switch] $ProcessChildren
	) 

	$web = Get-SPWeb $WebUrl;

	ProcessWeb $web $ProcessChildren;
}

function ProcessWeb($web, $processChildren) {

	Write-Host &quot;Processing Web&quot;,$web.Title,&quot;(&quot;,$web.Url,&quot;)&quot; -foregroundcolor &quot;Green&quot;;

	$lists = @($web.Lists | Where-Object { ($_.BaseType -eq &quot;DocumentLibrary&quot;) -and ($_.BaseTemplate -eq &quot;DocumentLibrary&quot;) -and ($_.IsSiteAssetsLibrary -eq $false) -and ($_.EnableMinorVersions -eq $true) -and ($_.Hidden -eq $false) -and ($_.Description -notlike &quot;*system*&quot;) -and ($_.Description -notlike &quot;*style*&quot;) })

    if ($lists.Count -gt 0) {
    	foreach ($list in $lists) {
    		if ($list.Title.Length -gt 0) {
    			Write-Host &quot;   Processing List&quot;,$list.Title -foregroundcolor &quot;Green&quot;;

    			$list.EnableVersioning = $true;
    			$list.EnableMinorVersions = $false;
    			$list.MajorVersionLimit = 0;
    			$list.ForceCheckout = $true;

    			$list.Update();
    		}
    		else {
    			Write-Host &quot;   Invalid List Encountered&quot; -foregroundcolor &quot;Red&quot;
    		}
    	}
    } else {
        Write-Host &quot;   No lists matching filter were found&quot; -foregroundcolor &quot;Red&quot;
    }

    if ($processChildren) {
    	foreach ($subWeb in $web.Webs) {
    		ProcessWeb $subWeb $processChildren
    	}
    }
}
</pre>
<p><map name='google_ad_map_1066_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1066?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1066_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1066&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F07%2F21%2Fsharepoint-2010-setting-document-library-versioning-with-powershell%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/07/21/sharepoint-2010-setting-document-library-versioning-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Setting The UIVersion with PowerShell for a Content Database</title>
		<link>http://www.mylifeinaminute.com/2011/06/21/setting-the-uiversion-with-powershell-for-a-content-database/</link>
		<comments>http://www.mylifeinaminute.com/2011/06/21/setting-the-uiversion-with-powershell-for-a-content-database/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 17:30:14 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=927</guid>
		<description><![CDATA[A recent client engagement had us flipping back and forth between the v3 and v4 UI (Visual Upgrade) for a number of site collections in a given content database. The PowerShell function outlined below allows for setting the UIVersion on all of the site collections and sites in a given content database in one shot.]]></description>
			<content:encoded><![CDATA[<p>A recent client engagement had us flipping back and forth between the v3 and v4 UI (<a href="http://msdn.microsoft.com/en-us/library/gg454789.aspx" title="Understanding Visual Upgrade in SharePoint 2010">Visual Upgrade</a>) for a number of site collections in a given content database.</p>
<p>The <a href="/tag/powershell/" title="PowerShell">PowerShell</a> function outlined below allows for setting the UIVersion on all of the site collections and sites in a given content database in one shot.</p>
<pre class="brush: powershell; title: ; notranslate">
function Set-SPUIVersion(
    [string]$dbName = $(Read-Host -prompt &quot;Content Database Name&quot;),
    [int32]$uiVersion = $(Read-Host -prompt &quot;UI Version&quot;))
    {
	$db = Get-SPContentDatabase $dbName

	foreach ($s in $db.Sites) {
		foreach ($w in $s.AllWebs) {
			$w.UIversion = $uiVersion;
			switch ($uiVersion) {
				3 { $w.UIVersionConfigurationEnabled = $true; }
				4 { $w.UIVersionConfigurationEnabled = $false; }
			}
			$w.Update();
		}
	}
}
</pre>
<p><map name='google_ad_map_927_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/927?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_927_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=927&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F06%2F21%2Fsetting-the-uiversion-with-powershell-for-a-content-database%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/06/21/setting-the-uiversion-with-powershell-for-a-content-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Retrieving SharePoint 2010 Farm Solutions with PowerShell</title>
		<link>http://www.mylifeinaminute.com/2011/04/11/retrieving-sharepoint-2010-farm-solutions-with-powershell/</link>
		<comments>http://www.mylifeinaminute.com/2011/04/11/retrieving-sharepoint-2010-farm-solutions-with-powershell/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 17:50:13 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint Solution Packages]]></category>
		<category><![CDATA[wsp]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=813</guid>
		<description><![CDATA[The following PowerShell script allows for saving all of the farm level solutions in a SharePoint 2010 farm. The Script or the one liner:]]></description>
			<content:encoded><![CDATA[<p>The following <a title="PowerShell" href="/tag/powershell/">PowerShell</a> script allows for saving all of the farm level <a title="SharePoint Solutions Packages" href="/tag/sharepoint-solution-packages/">solutions</a> in a <a title="SharePoint" href="/tag/sharepoint/">SharePoint</a> <a title="SharePoint 2010" href="/tag/sharepoint-2010/">2010</a> farm.</p>
<h4>The Script</h4>
<pre class="brush: powershell; title: ; notranslate">
function SPGetFarmSolutions {
	param (
		[string] $directory = $(Read-Host -prompt &quot;Enter a directory (use &quot;&quot;.&quot;&quot; for current dir)&quot;)
	)

	if ($directory.Length -lt 2) {
		$directory = [string]$pwd + &quot;\\&quot;;
	}

	$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local;
	$solutions = $farm.Solutions;
	$solutions | ForEach-Object {
		Write-Host &quot;Found solution $_.name&quot;;
		$_.SolutionFile.SaveAs($directory + $_.name);
	}
}
</pre>
<p>or the one liner:</p>
<pre class="brush: powershell; title: ; notranslate">
(Get-SPFarm).Solutions | ForEach-Object{$var = (Get-Location).Path + &quot;\&quot; + $_.Name; $_.SolutionFile.SaveAs($var)}
</pre>
<p><map name='google_ad_map_813_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/813?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_813_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=813&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F04%2F11%2Fretrieving-sharepoint-2010-farm-solutions-with-powershell%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/04/11/retrieving-sharepoint-2010-farm-solutions-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Creating a Folder Hierarchy Based on a Term Set with PowerShell</title>
		<link>http://www.mylifeinaminute.com/2011/04/08/sharepoint-2010-creating-a-folder-hierarchy-based-on-a-term-set-with-powershell/</link>
		<comments>http://www.mylifeinaminute.com/2011/04/08/sharepoint-2010-creating-a-folder-hierarchy-based-on-a-term-set-with-powershell/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 13:36:34 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[Managed Metadata]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=791</guid>
		<description><![CDATA[Long winded title, but it says it all. I recently had a need to create a nested folder hierarchy in a document library based on a managed metadata term set with almost 1,000 terms. The following PowerShell script will create a nested folder structure within a target document library based on the supplied term set. [...]]]></description>
			<content:encoded><![CDATA[<p>Long winded title, but it says it all. I recently had a need to create a nested folder hierarchy in a document library based on a <a title="Managed Metadata" href="/tag/managed-metadata/">managed metadata</a> term set with almost 1,000 terms. The following <a title="PowerShell" href="/tag/powershell/">PowerShell</a> script will create a nested folder structure within a target document library based on the supplied term set.</p>
<h4>The Script</h4>
<pre class="brush: powershell; title: ; notranslate">
# Outputs CSV of the specified termset from the specificed termstore/group
# Example calls:
# Create-SPFoldersFromTermSet &quot;http://sp2010/PublicDocuments&quot; &quot;Documents&quot; &quot;Managed Metadata Service&quot; &quot;Enterprise Metadata&quot; &quot;Business Terms&quot;

[Reflection.Assembly]::LoadWithPartialName(&quot;Microsoft.SharePoint.Taxonomy&quot;)

function Create-SPFoldersFromTermSet(
	[string]$webUrl = $(Read-Host -prompt &quot;Web Site URL&quot;),
	[string]$listName = $(Read-Host -prompt &quot;List Name&quot;),
	[string]$termStoreName = $(Read-Host -prompt &quot;Term Store Name&quot;),
	[string]$termGroupName = $(Read-Host -prompt &quot;Term Group Name&quot;),
	[string]$termSetName = $(Read-Host -prompt &quot;Term Set Name&quot;))
	{

	$isValid = $true;
	$message = &quot;&quot;;

	if ($webUrl.Length -eq 0) { $message += &quot;`nPlease provide a web site URL&quot;; $isValid = $false; }
	if ($listName.Length -eq 0) { $message += &quot;`nPlease provide a list name&quot;; $isValid = $false; }
	if ($termStoreName.Length -eq 0) { $message += &quot;`nPlease provide a Term Store Name&quot;; $isValid = $false; }
	if ($termGroupName.Length -eq 0) { $message += &quot;`nPlease provide a Term Store Group Name&quot;; $isValid = $false; }
	if ($termSetName.Length -eq 0) { $message += &quot;`nPlease provide a Term Set Name&quot;; $isValid = $false; }

	if ($isValid -eq $false)
	{
		write-host &quot;`n`nERROR OCCURRED`n`t$message`n`n&quot;
		write-host &quot;NAME`n`tCreate-SPFoldersFromTermSet`n&quot;
		write-host &quot;SYNOPSIS`n`tCreates a set of folders in a destination library based on the supplied term set.`n&quot;
		write-host &quot;SYNTAX`n`tCreate-SPFoldersFromTermSet webUrl listName termStoreName termGroupName termSetName`n&quot;
		write-host &quot;EXAMPLES`n`n Create-SPFoldersFromTermSet &quot;&quot;http://sp2010/PublicDocuments&quot;&quot; &quot;&quot;Documents&quot;&quot; &quot;&quot;Managed Metadata Service&quot;&quot; &quot;&quot;Enterprise MetaData&quot;&quot; &quot;&quot;Business Terms&quot;&quot;`n&quot;
		return;
	}

	try
	{
		$ErrorActionPreference = &quot;Stop&quot;;

		$web = $null;
		$list = $null;

		try
		{
			$web = Get-SPWeb $webUrl;
			$list = $web.Lists[$listName];

			if ($list -eq $null)
			{
				return &quot;Unable to find a list with the name $listName&quot;
			}
		}
		catch { &quot;Error acquiring web/list&quot; }

		try
		{
			$taxSession = Get-SPTaxonomySession -Site $web.Site.Url;

			try
			{
				$termStore = $taxSession.TermStores[$termStoreName];

				if ($termStore -ne $null)
				{
					try
					{
						$termGroup = $termStore.Groups[$termGroupName];

						if ($termGroup -ne $null)
						{
							try
							{
								$termSet = $termGroup.TermSets[$termSetName];

								if ($termSet -ne $null)
								{
									$rootFolder = $list.RootFolder;

									foreach ($term in $termSet.Terms)
									{
										Create-SPFolderFromTerm $rootFolder $term
									}
								}
								else
								{
									return &quot;Termset $termSetName does not exist in the term store group $termGroupName&quot;;
								}
							}
							catch
							{
								&quot;Unable to acquire the termset $termSetName from the term group $termGroupName&quot;
							}
						}
						else
						{
							return &quot;Term store group $termGroupName does not exist in the term store $termStoreName&quot;;
						}
					}
					catch
					{
						&quot;Unable to acquire term store group $termGroupName from $termStoreName&quot;
					}
				}
				else
				{
					return &quot;Term store $termStoreName does not exist&quot;;
				}
			}
			catch
			{
				&quot;Unable to acquire term store for $termStoreName&quot;
			}
		}
		catch
		{
			&quot;Unable to acquire session for the site $webUrl&quot;
		}
	}
	catch
	{

	}
	finally
	{
		$ErrorActionPreference = &quot;Continue&quot;;
	}
}

function Create-SPFolderFromTerm(
	[Microsoft.SharePoint.SPFolder]$parentFolder,
	[Microsoft.SharePoint.Taxonomy.Term]$term)
{
	$childFolder = $parentFolder.SubFolders[$term.Name];
	if ($childFolder -eq $null)
	{
		$parentFolder.SubFolders.Add($term.Name);
		$childFolder = $parentFolder.SubFolders[$term.Name];
	}

	if ($term.Terms.Count -gt 0)
	{
		foreach ($childTerm in $term.Terms)
		{
			Create-SPFolderFromTerm $childFolder $childTerm
		}
	}
}
</pre>
<p><map name='google_ad_map_791_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/791?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_791_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=791&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F04%2F08%2Fsharepoint-2010-creating-a-folder-hierarchy-based-on-a-term-set-with-powershell%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/04/08/sharepoint-2010-creating-a-folder-hierarchy-based-on-a-term-set-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing Terms from CSV in PowerShell</title>
		<link>http://www.mylifeinaminute.com/2011/04/01/importing-terms-from-csv-in-powershell/</link>
		<comments>http://www.mylifeinaminute.com/2011/04/01/importing-terms-from-csv-in-powershell/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 15:16:43 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=710</guid>
		<description><![CDATA[As the Term Store Management Tool in SharePoint 2010 does not allow for delta imports, the following PowerShell script will consume a .csv file and import the terms into the term store for the supplied term set if they do not yet exist. File Format Term Sample Term 1 Sample Term 2 Sample Term 3 [...]]]></description>
			<content:encoded><![CDATA[<p>As the <a title="Managed metadata input file format (SharePoint Server 2010)" href="http://technet.microsoft.com/en-us/library/ee424396.aspx#section3">Term Store Management Tool </a>in <a title="SharePoint" href="/tag/sharepoint/">SharePoint</a> <a title="SharePoint 2010" href="/tag/sharepoint-2010/">2010</a> does not allow for delta imports, the following <a title="PowerShell" href="/tag/powershell/">PowerShell</a> script will consume a <em>.csv</em> file and import the terms into the term store for the supplied term set if they do not yet exist.</p>
<h4>File Format</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Term</strong></td>
</tr>
<tr>
<td>Sample Term 1</td>
</tr>
<tr>
<td>Sample Term 2</td>
</tr>
<tr>
<td>Sample Term 3</td>
</tr>
</tbody>
</table>
<h4>The Script</h4>
<pre class="brush: powershell; title: ; notranslate">
# Inputs CSV of the specified termset into the specificed termstore/group
# Example calls:
# Import-SPTermStoreGroupTerms &quot;http://sp2010&quot; &quot;Managed Metadata Service&quot; &quot;Enterprise Metadata&quot; &quot;Business Units&quot; &quot;C:\Users\Me\Desktop\input.csv&quot;

[Reflection.Assembly]::LoadWithPartialName(&quot;Microsoft.SharePoint.Taxonomy&quot;)

function Import-SPTermStoreGroupTerms(
	[string]$siteUrl = $(Read-Host -prompt &quot;Site Collection URL&quot;),
	[string]$termStoreName = $(Read-Host -prompt &quot;Term Store Name&quot;),
	[string]$termGroupName = $(Read-Host -prompt &quot;Term Group Name&quot;),
	[string]$termSetName = $(Read-Host -prompt &quot;Term Set Name&quot;),
	[string]$inputFile = $(Read-Host -prompt &quot;Input File (including full path)&quot;)) {

	$isValid = $true;
	$message = &quot;&quot;;

	if ($siteUrl.Length -eq 0) { $message = &quot;`nPlease provide a site URL&quot;; $isValid = $false; }
	if ($termStoreName.Length -eq 0) { $message += &quot;`nPlease provide a Term Store Name&quot;; $isValid = $false; }
	if ($termGroupName.Length -eq 0) { $message += &quot;`nPlease provide a Term Store Group Name&quot;; $isValid = $false; }
	if ($termSetName.Length -eq 0) { $message += &quot;`nPlease provide a Term Set Name&quot;; $isValid = $false; }
	if ($inputFile.Length -eq 0) { $message += &quot;`nPlease provide an input file&quot;; $isValid = $false; }

	if ($isValid -eq $false) {
		write-host &quot;`n`nERROR OCCURRED`n`t$message`n`n&quot;
		write-host &quot;NAME`n`tImport-SPTermStoreGroupTerms`n&quot;
		write-host &quot;SYNOPSIS`n`tConsumes a CSV file containing a listing of term names and creates them if needed in the specified term set.`n&quot;
		write-host &quot;SYNTAX`n`tImport-SPTermStoreGroupTerms siteUrl termStoreName termGroupName termSetName inputFile`n&quot;
		write-host &quot;EXAMPLES`n`n Import-SPTermStoreGroupTerms &quot;&quot;http://sp2010&quot;&quot; &quot;&quot;Managed Metadata Service&quot;&quot; &quot;&quot;Enterprise Metadata&quot;&quot; &quot;&quot;Business Units&quot;&quot; &quot;&quot;C:\Users\Me\Desktop\input.csv&quot;&quot;`n&quot;
		write-host &quot;SAMPLE INPUT FILE`n`tTerm`n`tSample Term 1`n`tSample Term 2`n`tSample Term 3`n&quot;
		return;
	}

	try {
		$ErrorActionPreference = &quot;Stop&quot;;

		try {
			$taxSession = Get-SPTaxonomySession -Site $siteUrl;

			try {
				$termStore = $taxSession.TermStores[$termStoreName];

				if ($termStore -ne $null) {
					try {
						$termGroup = $termStore.Groups[$termGroupName];

						if ($termGroup -ne $null) {
							try {
								$termSet = $termGroup.TermSets[$termSetName];

								if ($termSet -ne $null) {
									$csv = Import-csv -path $inputFile

									if ($csv -ne $null) {
										foreach($line in $csv)
										{
											[string]$termName = $line.Term;

											if (![string]::IsNullOrEmpty($termName)) {
												$term = $null;

												try {
													[string]$normalizedTermName = [Microsoft.SharePoint.Taxonomy.TermSet]::NormalizeName($termName);
													$term = $termSet.Terms[$normalizedTermName];
													write-host &quot;Term $termName already exists&quot;
												}
												catch { }

												if ($term -eq $null) {
													$t = $termSet.CreateTerm($termName, 1033);
													$termSet.TermStore.CommitAll();
													write-host &quot;Term $termName has been created&quot;
												}
											}
										}
									}
									else {
										return &quot;Argument supplied for input file was invalid.&quot;;
									}
								}
								else {
									return &quot;Termset $termSetName does not exist in the term store group $termGroupName&quot;;
								}
							}
							catch {
								&quot;Unable to acquire the termset $termSetName from the term group $termGroupName&quot;
							}
						}
						else {
							return &quot;Term store group $termGroupName does not exist in the term store $termStoreName&quot;;
						}
					}
					catch {
						&quot;Unable to acquire term store group $termGroupName from $termStoreName&quot;
					}
				}
				else {
					return &quot;Term store $termStoreName does not exist&quot;;
				}
			}
			catch {
				&quot;Unable to acquire term store for $termStoreName&quot;
			}
		}
		catch {
			&quot;Unable to acquire session for the site $siteUrl&quot;
		}
	}
	catch { }
	finally {
		$ErrorActionPreference = &quot;Continue&quot;;
	}
}
</pre>
<p><map name='google_ad_map_710_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/710?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_710_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=710&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F04%2F01%2Fimporting-terms-from-csv-in-powershell%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/04/01/importing-terms-from-csv-in-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Export a Term Set to CSV with Identifiers in PowerShell</title>
		<link>http://www.mylifeinaminute.com/2011/03/31/export-a-term-set-to-csv-with-identifiers-in-powershell/</link>
		<comments>http://www.mylifeinaminute.com/2011/03/31/export-a-term-set-to-csv-with-identifiers-in-powershell/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 22:00:19 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[Managed Metadata]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=699</guid>
		<description><![CDATA[I recently had a need to export all of the terms from a given term set in a SharePoint 2010 Managed Metadata Service application to CSV for consumption in another process. The following PowerShell script will create a .csv file with all of the term names and identifiers for the supplied Term Store/Term Store Group/Term [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a need to export all of the terms from a given term set in a <a title="SharePoint" href="/tag/sharepoint/">SharePoint</a> <a title="SharePoint 2010" href="/tag/sharepoint-2010/">2010</a> <a title="Managed Metadata" href="/tag/managed-metadata/">Managed Metadata</a> Service application to CSV for consumption in another process. The following <a title="PowerShell" href="/tag/powershell/">PowerShell</a> script will create a <em>.csv</em> file with all of the term names and identifiers for the supplied Term Store/Term Store Group/Term Set.</p>
<p><strong>Updated:</strong> There was an error in the previous version of this script. It did not account for the fact that the ampersand character (&#8220;&amp;&#8221;) is stored as a <a title="Fullwidth ampersand" href="http://www.fileformat.info/info/unicode/char/ff06/index.htm">fullwidth ampersand</a> (&#8220;<strong>\uFF06</strong>&#8220;) when a <a title="TermSetItem.CreateTerm Method (String, Int32)" href="http://msdn.microsoft.com/en-us/library/ee577519.aspx">term is created</a>. The script has been adjusted to replace any fullwidth ampersands with a basic Latin <a title="Ampersand" href="http://www.fileformat.info/info/unicode/char/0026/index.htm">ampersand</a> in the output.</p>
<h4>The Script</h4>
<pre class="brush: powershell; title: ; notranslate">
# Outputs CSV of the specified termset from the specificed termstore/group
# Example call:
# Export-SPTermStoreGroupTerms &quot;http://sp2010&quot; &quot;Managed Metadata Service&quot; &quot;Enterprise Metadata&quot; &quot;Business Units&quot;

function Export-SPTermStoreGroupTerms {
	param (
		[string]$siteUrl = $(Read-Host -prompt &quot;Site Collection URL&quot;),
		[string]$termStoreName = $(Read-Host -prompt &quot;Term Store Name&quot;),
		[string]$termGroupName = $(Read-Host -prompt &quot;Term Group Name&quot;),
		[string]$termSetName = $(Read-Host -prompt &quot;Term Set Name&quot;),
		[string]$outPutDir = &quot;&quot;
	)

	$isValid = $true;
	$message = &quot;&quot;;

	if ($siteUrl.Length -eq 0) { $message = &quot;`nPlease provide a site URL&quot;; $isValid = $false; }
	if ($termStoreName.Length -eq 0) { $message += &quot;`nPlease provide a Term Store Name&quot;; $isValid = $false; }
	if ($termGroupName.Length -eq 0) { $message += &quot;`nPlease provide a Term Store Group Name&quot;; $isValid = $false; }
	if ($termSetName.Length -eq 0) { $message += &quot;`nPlease provide a Term Set Name&quot;; $isValid = $false; }

	if ($isValid -eq $false)
	{
		write-host &quot;`n`nERROR OCCURRED`n`t$message`n`n&quot;
		write-host &quot;NAME`n`tExport-SPTermStoreGroupTerms`n&quot;
		write-host &quot;SYNOPSIS`n`tReturns a CSV file containing a listing of term names and identifiers from the supplied term set.`n&quot;
		write-host &quot;SYNTAX`n`tExport-SPTermStoreGroupTerms siteUrl termStoreName termGroupName termSetName outPutDir`n&quot;
		write-host &quot;EXAMPLES`n`n Export-SPTermStoreGroupTerms &quot;&quot;http://sp2010&quot;&quot; &quot;&quot;Managed Metadata Service&quot;&quot; &quot;&quot;Enterprise Metadata&quot;&quot; &quot;&quot;Business Units&quot;&quot;`n&quot;
		return;
	}

	try
	{
		$ErrorActionPreference = &quot;Stop&quot;;

		try
		{
			$site = Get-SPSite $siteUrl;
			$taxSession = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession($site, $true);

			try
			{
				$termStore = $taxSession.TermStores[$termStoreName];

				if ($termStore -ne $null)
				{
					try
					{
						$termGroup = $termStore.Groups[$termGroupName];

						if ($termGroup -ne $null)
						{
							try
							{
								$termSet = $termGroup.TermSets[$termSetName];

								if ($termSet -ne $null)
								{
									[string]$csvDir = &quot;&quot;;

									if ($outPutDir.Length -gt 0)
									{
										$csvDir = $outPutDir;
									}
									else
									{
										$csvDir = $pwd;
									}

									$outPutFile = $csvDir + &quot;\output.csv&quot;;

									$sw = new-object system.IO.StreamWriter($outPutFile);

									$sw.writeline(&quot;Name,Id&quot;);

									foreach ($term in $termSet.GetAllTerms())
									{
										[Byte[]] $ampersand = 0xEF,0xBC,0x86;

										$sw.writeline(&quot;&quot;&quot;&quot; + $term.Name.Replace([System.Text.Encoding]::UTF8.GetString($ampersand), &quot;&amp;&quot;) + &quot;&quot;&quot;&quot; + &quot;,&quot; + $term.Id);
									}

									$sw.close();

									write-host &quot;Your CSV has been created at $outPutFile&quot;;
								}
								else
								{
									return &quot;Termset $termSetName does not exist in the term store group $termGroupName&quot;;
								}
							}
							catch
							{
								&quot;Unable to acquire the termset $termSetName from the term group $termGroupName&quot;
							}
						}
						else
						{
							return &quot;Term store group $termGroupName does not exist in the term store $termStoreName&quot;;
						}
					}
					catch
					{
						&quot;Unable to acquire term store group $termGroupName from $termStoreName&quot;
					}
				}
				else
				{
					return &quot;Term store $termStoreName does not exist&quot;;
				}
			}
			catch
			{
				&quot;Unable to acquire term store for $termStoreName&quot;
			}
		}
		catch
		{
			&quot;Unable to acquire session for the site $siteUrl&quot;
		}
	}
	catch
	{

	}
	finally
	{
		$ErrorActionPreference = &quot;Continue&quot;;
	}
}
</pre>
<p><map name='google_ad_map_699_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/699?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_699_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=699&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F03%2F31%2Fexport-a-term-set-to-csv-with-identifiers-in-powershell%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/03/31/export-a-term-set-to-csv-with-identifiers-in-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint 2007 PowerShell Profile</title>
		<link>http://www.mylifeinaminute.com/2011/02/16/sharepoint-2007-powershell-profile/</link>
		<comments>http://www.mylifeinaminute.com/2011/02/16/sharepoint-2007-powershell-profile/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 18:32:09 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[sharepoint administration]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=677</guid>
		<description><![CDATA[The following is the Powershell profile that I have been using on the SharePoint 2007 farms I administer. Reference Getting started with PowerShell and SharePoint]]></description>
			<content:encoded><![CDATA[<p>The following is the <a title="PowerShell" href="/category/microsoft/powershell/">Powershell</a> <a title="Windows PowerShell Profiles" href="http://msdn.microsoft.com/en-us/library/bb613488(v=vs.85).aspx">profile</a> that I have been using on the SharePoint 2007 farms I administer.</p>
<pre class="brush: powershell; title: ; notranslate">
############################################################################
# Assumptions:
# - Running on machine with WSS/MOSS
# - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN in path
# - For development servers only, does not dispose of objects
############################################################################
# Example usage:
# $list = get-splist -webUrl &quot;http://site&quot; -listName &quot;Announcements&quot;
############################################################################

$12HiveDir = &quot;${env:CommonProgramFiles}\Microsoft Shared\web server extensions\12\&quot;

[void][reflection.assembly]::Loadwithpartialname(&quot;Microsoft.SharePoint&quot;) | out-null
[void][reflection.assembly]::Loadwithpartialname(&quot;Microsoft.Office.Server.Search&quot;) | out-null
[void][reflection.assembly]::Loadwithpartialname(&quot;Microsoft.Office.Server&quot;) | out-null

# Returns the SPWebApplication at the specified URL
function get-spwebapplication ([String]$webUrl=$(throw 'Parameter -webUrl is missing!'))
{
    return [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup(&quot;$webUrl&quot;)
}

# Returns the SPSite at the specified URL
function get-spsite ([String]$webUrl=$(throw 'Parameter -webUrl is missing!'))
{
    return New-Object -TypeName &quot;Microsoft.SharePoint.SPSite&quot; -ArgumentList &quot;$webUrl&quot;
}

# Returns the SPSite object from the specified URL
function get-spweb ([String]$webUrl=$(throw 'Parameter -webUrl is missing!'))
{
    $site = New-Object -TypeName &quot;Microsoft.SharePoint.SPSite&quot; -ArgumentList &quot;$webUrl&quot;
    return $site.OpenWeb()
}

# Returns the SPList object from the specified URL and list name
function get-splist ([String]$webUrl=$(throw 'Parameter -webUrl is missing!'),
[String]$listName=$(throw 'Parameter -listName is missing!'))
{
    $site = New-Object -TypeName &quot;Microsoft.SharePoint.SPSite&quot; -ArgumentList &quot;$webUrl&quot;
    $web = $site.OpenWeb()
    return $web.Lists[$listName]
}
</pre>
<h4>Reference</h4>
<ul>
<li><a title="Getting started with PowerShell and SharePoint" href="http://www.sharepointdevwiki.com/display/public/Getting+started+with+PowerShell+and+SharePoint">Getting started with PowerShell and SharePoint</a></li>
</ul>
<p><map name='google_ad_map_677_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/677?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_677_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=677&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2011%2F02%2F16%2Fsharepoint-2007-powershell-profile%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2011/02/16/sharepoint-2007-powershell-profile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010 Products scripted deployment</title>
		<link>http://www.mylifeinaminute.com/2010/07/06/sharepoint-2010-products-scripted-deployment/</link>
		<comments>http://www.mylifeinaminute.com/2010/07/06/sharepoint-2010-products-scripted-deployment/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 18:36:27 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[TechNet]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint Installation]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=491</guid>
		<description><![CDATA[It seems I missed it when Microsoft published the SPModule PowerShell module to aid in a scripted installation of a SharePoint 2010 farm. If anything, it can serve as a handy guide for how to script out individual actions pertaining to installation and farm maintenance. Reference SharePoint 2010 Products scripted deployment SPModule .zip file Install [...]]]></description>
			<content:encoded><![CDATA[<p>It seems I missed it when <a title="Microsoft" href="/tag/microsoft/">Microsoft </a>published the <a title="SPModule" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=c57556ff-8df0-44fd-aba6-3df01b9f80ce">SPModule </a><a title="PowerShell" href="/category/microsoft/powershell/">PowerShell </a>module to aid in a scripted installation of a SharePoint 2010 farm.</p>
<p>If anything, it can serve as a handy guide for how to script out individual actions pertaining to installation and farm maintenance.</p>
<h4>Reference</h4>
<ul>
<li><a title="SharePoint 2010 Products scripted deployment SPModule .zip file" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=c57556ff-8df0-44fd-aba6-3df01b9f80ce">SharePoint 2010 Products scripted deployment SPModule .zip file</a></li>
<li><a title="Install SharePoint Server 2010 by using Windows PowerShell" href="http://technet.microsoft.com/en-us/library/cc262839.aspx">Install SharePoint Server 2010 by using Windows PowerShell</a></li>
<li><a title="Install SharePoint Foundation 2010 by using Windows PowerShell" href="http://technet.microsoft.com/en-us/library/cc752946.aspx">Install SharePoint Foundation 2010 by using Windows PowerShell</a></li>
</ul>
<p><map name='google_ad_map_491_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/491?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_491_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=491&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2010%2F07%2F06%2Fsharepoint-2010-products-scripted-deployment%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2010/07/06/sharepoint-2010-products-scripted-deployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Provisioning a new Farm with Powershell</title>
		<link>http://www.mylifeinaminute.com/2010/05/17/sharepoint-2010-provisioning-a-new-farm-with-powershell/</link>
		<comments>http://www.mylifeinaminute.com/2010/05/17/sharepoint-2010-provisioning-a-new-farm-with-powershell/#comments</comments>
		<pubDate>Mon, 17 May 2010 13:45:25 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Sharepoint Server]]></category>
		<category><![CDATA[SharePoint Server 2010]]></category>
		<category><![CDATA[TechNet]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint Installation]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=452</guid>
		<description><![CDATA[SharePoint 2007 always required some level of scripting in it&#8217;s installation to allow for greater control of the installation process (i.e. creating database names without GUIDs). SharePoint 2010 is not any different in that scripting is still required to gain the finer control over installation. What has changed is that now PowerShell can be used [...]]]></description>
			<content:encoded><![CDATA[<p>SharePoint 2007 always required some level of scripting in it&#8217;s installation to allow for greater control of the installation process (i.e. creating database names without GUIDs). SharePoint 2010 is not any different in that scripting is still required to gain the finer control over installation. What has changed is that now PowerShell can be used in place of <strong>psconfig</strong>/<strong>stsadm</strong>. With that in mind, let&#8217;s begin.</p>
<ol>
<li>Install the SharePoint binaries on each server in your farm. Select &#8220;Complete&#8221; as the installation type. This will allow you to create a farm as opposed to a single server installation.After the install has completed, you will asked if you would like to complete the &#8220;SharePoint Products Configuration Wizard&#8221;. Do not run the wizard at this time.</li>
<li>On the server which you wish to provision Central Administration:
<ol>
<li>Open the  &#8221;SharePoint 2010 Management Shell&#8221; (right-click and select &#8220;Run as administrator&#8221;). The shell will load with a message that the local farm is not accessible. This is expected as we have only installed the binaries.</li>
<li>Run the following command to create the initial configuration/content database for the farm.
<pre class="brush: powershell; light: true; title: ; notranslate">
New-SPConfigurationDatabase –DatabaseName “SharePoint2010_Config” –DatabaseServer “SharePoint2010SQL” –AdministrationContentDatabaseName “SharePoint2010_Content_Admin” –Passphrase (ConvertTo-SecureString “Pass@word1” –AsPlaintext –Force) –FarmCredentials (Get-Credential)
</pre>
</li>
<li>After the initial creation of the farm, close and reload the &#8220;SharePoint 2010 Management Shell&#8221;. You should no longer receive any error messages.</li>
<li>Install the help files.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPHelpCollection -All
</pre>
</li>
<li>Secure the resources used by the server (files and registry).
<pre class="brush: powershell; light: true; title: ; notranslate">
Initialize-SPResourceSecurity
</pre>
</li>
<li>Install and provision the farm services.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPService
</pre>
</li>
<li>Install the features on the server.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPFeature –AllExistingFeatures
</pre>
</li>
<li>Provision Central Administration.
<pre class="brush: powershell; light: true; title: ; notranslate">
New-SPCentralAdministration -Port 1234  -WindowsAuthProvider &quot;NTLM&quot;
</pre>
</li>
<li>Install the application content.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPApplicationContent
</pre>
</li>
<li>Optional: Disable the loopback check. If this is a development install, outright disabling the check should be fine. For production environments, the loopback check should be left in place and BackConnectionHostNames should be used in its place. See <a title="KB896861" href="http://support.microsoft.com/kb/896861">KB 896861</a>.
<pre class="brush: powershell; light: true; title: ; notranslate">
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name &quot;DisableLoopbackCheck&quot;  -value &quot;1&quot; -PropertyType dword
</pre>
</li>
</ol>
</li>
<li>On each additional server that you wish to converge in the farm:
<ol>
<li>Open the  &#8221;SharePoint 2010 Management Shell&#8221; (right-click and select &#8220;Run as administrator&#8221;). The shell will load with a message that the local farm is not accessible. This is expected as we have only installed the binaries.</li>
<li>Connect the server to the farm with the following command:
<pre class="brush: powershell; light: true; title: ; notranslate">
Connect-SPConfigurationDatabase -DatabaseName &quot;SharePoint2010_Config&quot; -DatabaseServer &quot;SharePoint2010SQL&quot; -Passphrase (ConvertTo-SecureString &quot;Pass@word1&quot; -AsPlaintext -Force)
</pre>
</li>
<li>Install the help files.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPHelpCollection -All
</pre>
</li>
<li>Secure the resources used by the server (files and registry).
<pre class="brush: powershell; light: true; title: ; notranslate">
Initialize-SPResourceSecurity
</pre>
</li>
<li>Install and provision the farm services.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPService
</pre>
</li>
<li>Install the features on the server.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPFeature –AllExistingFeatures
</pre>
</li>
<li>Install the application content.
<pre class="brush: powershell; light: true; title: ; notranslate">
Install-SPApplicationContent
</pre>
</li>
<li>Optional: Disable the loopback check. If this is a development install, outright disabling the check should be fine. For production environments, the loopback check should be left in place and BackConnectionHostNames should be used in its place. See <a title="KB896861" href="http://support.microsoft.com/kb/896861">KB 896861</a>.
<pre class="brush: powershell; light: true; title: ; notranslate">
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name &quot;DisableLoopbackCheck&quot;  -value &quot;1&quot; -PropertyType dword
</pre>
</li>
</ol>
</li>
</ol>
<h4>Reference</h4>
<ul>
<li><a title="SharePoint 2010 Provisioning A New Farm with PowerShell" href="http://blogs.msdn.com/ekraus/archive/2009/11/06/sharepoint-2010-provisioning-a-new-farm-with-powershell.aspx">Eric Kraus&#8217; SharePoint/.NET Blog &#8211; SharePoint 2010 Provisioning A New Farm with Powershell</a></li>
<li><a title="KB896861" href="http://support.microsoft.com/kb/896861">You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version</a></li>
<li><a title="SharePoint 2010: PSConfig and Powershell" href="http://stsadm.blogspot.com/2009/10/sharepoint-2010-psconfig-and-powershell.html">SharePoint Automation: SharePoint 2010 PSConfig and Powershell</a></li>
</ul>
<p><map name='google_ad_map_452_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/452?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_452_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=452&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2010%2F05%2F17%2Fsharepoint-2010-provisioning-a-new-farm-with-powershell%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2010/05/17/sharepoint-2010-provisioning-a-new-farm-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.mylifeinaminute.com @ 2012-02-07 16:10:34 by W3 Total Cache -->
