<?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>SharePoint From Scratch</title>
	<atom:link href="http://vspug.com/spfromscratch/feed/" rel="self" type="application/rss+xml" />
	<link>http://vspug.com/spfromscratch</link>
	<description>Was 12Hive.com - Now it&#039;s also 14Hive.net</description>
	<lastBuildDate>Wed, 17 Mar 2010 18:36:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>More Help with SharePoint Management Shell</title>
		<link>http://vspug.com/spfromscratch/2010/03/17/more-help-with-sharepoint-management-shell/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/17/more-help-with-sharepoint-management-shell/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 18:36:30 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=290</guid>
		<description><![CDATA[Our new best friend, Dan, has posted this that helps with anyone that trying to get to their SharePoint farm from the SharePoint Management Shell (SMS.)
We have to remember that when we&#8217;re running PowerShell, we&#8217;re given permissions according to the account that we logged into Windows with. This is a little different than in the SharePoint [...]]]></description>
			<content:encoded><![CDATA[<p>Our new best friend, <a href="http://community.sharepointproconnections.com/blogs/danholme/archive/2010/03/15/t-is-a-privilege-to-powershell.aspx">Dan, has posted this </a>that helps with anyone that trying to get to their SharePoint farm from the SharePoint Management Shell (SMS.)</p>
<p>We have to remember that when we&#8217;re running PowerShell, we&#8217;re given permissions according to the account that we logged into Windows with. This is a little different than in the SharePoint GUI where what we see depends on who we are but the actions we take are often executed using the application pool account. What that means is that when we&#8217;re running PowerShell and .ps1 scripts, we have to be sure we&#8217;ve got the necessary permissions to complete our tasks. Dan&#8217;s post covers most of that.</p>
<p>hth</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/17/more-help-with-sharepoint-management-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Still Working Through the Codeplex Autointaller Script</title>
		<link>http://vspug.com/spfromscratch/2010/03/10/still-working-through-the-codeplex-autointaller-script/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/10/still-working-through-the-codeplex-autointaller-script/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 17:09:45 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=280</guid>
		<description><![CDATA[We&#8217;re still trying to decode the SharePoint 2010 Autoinstaller Script from CodePlex.
We got the Throw thing figured out thanks to TechNet which offers this little demo:
function Get-XMLFiles
   {
   param ($path = $(throw "The Path parameter is required."))
   dir -path $path\* -include *.xml -recurse &#124; sort lastwritetime
   &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re still trying to decode <a href="http://autospinstaller.codeplex.com/">the SharePoint 2010 Autoinstaller Script from CodePlex</a>.</p>
<p>We got the <strong>Throw</strong> thing figured out thanks to TechNet which offers <a href="http://technet.microsoft.com/en-us/library/dd819510.aspx">this little demo</a>:</p>
<pre>function Get-XMLFiles
   {
   param ($path = $(throw "The Path parameter is required."))
   dir -path $path\* -include *.xml -recurse | sort lastwritetime
   |  ft lastwritetime, attributes, name  -auto
   }</pre>
<p>Which is all good except trying to figure out what to do with it. I found <a href="http://powershell.com/cs/blogs/ebook/archive/2008/10/19/chapter-1-the-powershell-console.aspx">this</a> from our new best friend <a href="http://powershell.com/cs/">Dr. Tobias</a>. Of course, we know saving this into a .ps1 script will make it run but, in the console, you have to learn to do multi-line entry and Dr. Tobias covers that straight away.</p>
<p>So looking that the function we&#8217;ll create, we see we enclose the code in {curley braces} and we have a <strong>param</strong> section. Here we drop our variable <strong>$path</strong> and we set it&#8217;s initial value to $(Throw &#8220;blah blah blah&#8221;) What this does is poke the <strong>Throw</strong> to the processor unless it&#8217;s replaced by an alternative at runtime.</p>
<p>Hence, <strong>get-XMLFiles</strong> <strong>(&#8216;C:\&#8217;)</strong> will return all the .xml files on your C: drive.</p>
<p>You&#8217;ll also see that the <strong>-include</strong> option filters the return to .xml files, the <strong>-recurse</strong> option makes it dig down into folders and sub-folders, the  <strong>sort</strong> sorts the output and the <strong>ft</strong> formats the output into a nice table with the designated headers. Note also that the parameter is passed inside parenthesis and single quotes. I presume you&#8217;d separate multiple paramerters with a comma.</p>
<p>Essentially, in the <strong>Get-XMLFiles</strong> function, it&#8217;s give me a path or I&#8217;ll barf. I&#8217;ve been there.</p>
<p>In the AutoInstaller script, the script itself has a parameter block, so when the script is called, it better get passed a configuration file or it&#8217;s barf city. I&#8217;ve been there too.</p>
<p>The one thing I don&#8217;t know is how to list the function code after it&#8217;s built. I presume I can just rebuild it with new code but I don&#8217;t know how to get what I&#8217;ve got in there to make minor edits. So I turned to our new best friend Lee who talks about environment variables here. From what he says, I figured out that a <strong>get-content function:&lt;function name&gt;</strong> will display the code supporting a given function.</p>
<p>Progress. That&#8217;s good.</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/10/still-working-through-the-codeplex-autointaller-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How&#8217;s it Work?: Codeplex AutoInstaller Script</title>
		<link>http://vspug.com/spfromscratch/2010/03/09/hows-it-work-codeplex-autoinstaller-script/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/09/hows-it-work-codeplex-autoinstaller-script/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 21:40:17 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=271</guid>
		<description><![CDATA[So since we&#8217;re expert at beginner PowerShell Scripts, maybe we should take a look at the AutoInstaller on CodePlex. Download it and you&#8217;ll find it&#8217;s got an AutoSPInstaller.ps1 script inside.
It takes about two seconds to see we got work to do. First, there&#8217;s this issue of the:
param
(
    [string]$InputFile = $(throw 'need parameter input file
  [...]]]></description>
			<content:encoded><![CDATA[<p>So since we&#8217;re expert at beginner PowerShell Scripts, maybe we should take a look at <a href="http://autospinstaller.codeplex.com/">the AutoInstaller on CodePlex</a>. Download it and you&#8217;ll find it&#8217;s got an <strong>AutoSPInstaller.ps1</strong> script inside.</p>
<p>It takes about two seconds to see we got work to do. First, there&#8217;s this issue of the:</p>
<pre style="padding-left: 30px">param
(
    [string]$InputFile = $(throw 'need parameter input file
    (e.g. "c:\SP2010\Scripted\SetInputs.xml")')
)</pre>
<p>So I can&#8217;t quite crack this but when you look at get-help throw, you see it looks like they&#8217;re <a href="http://technet.microsoft.com/en-us/library/dd819510.aspx">making the path a required parameter </a>or bailing on the script.</p>
<p>The second issue is that of iterating through an XML file. Now I imagine we&#8217;re going to put all our configurations in an XML file and the script will read it and call the SharePoint Management Shell commands that use them to build your whole farm with one click. Groovy.</p>
<p>So how do we iterate through an XML file? Well, our new best friend, Dan, <a href="http://www.pluralsight-training.net/community/blogs/dan/archive/2006/11/25/42506.aspx">covers it pretty good here</a>. He&#8217;s got the best line of the day:</p>
<p style="padding-left: 30px"><span style="color: #008000">With some practice you actually can drive nails with a screwdriver and then you only need to learn how to use one tool to build a house.</span></p>
<p>I gotta tell you guys and gals, I see alot of myself in that one-tool group. So maybe Dan will help. The problem is that his example is a grocery list and it&#8217;s almost supper time so, I&#8217;m heading out to:</p>
<ol>
<li>Buy Groceries</li>
<li>Make Dinner</li>
<li>Iterate&#8230;</li>
</ol>
<p>Sound like an exciting evening for a robot.</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/09/hows-it-work-codeplex-autoinstaller-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Got PowerShell Figured Out Yet?</title>
		<link>http://vspug.com/spfromscratch/2010/03/09/got-powershell-figured-out-yet/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/09/got-powershell-figured-out-yet/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:22:21 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[SMS Scripting]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=264</guid>
		<description><![CDATA[Here&#8217;s the answer from our new best friend Gary.
His post covers:

-loops
-variables
-arrays
-math
-string concatenation
-output

In this post, he shows us how adding:
&#62; .\filename.txt
to a command writes the output to a file in the current directory and also how adding:
 &#124; format-list 
to a command converts our output from a nice table with headers and everything to a list with space to be more [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://stsadm.blogspot.com/search/label/PowerShell">Here&#8217;s the answer</a> from our new best friend Gary.</p>
<p>His post covers:</p>
<ul>
<li>-loops</li>
<li>-variables</li>
<li>-arrays</li>
<li>-math</li>
<li>-string concatenation</li>
<li>-output</li>
</ul>
<p>In <a href="http://stsadm.blogspot.com/2009/10/sharepoint-2010-stsadm-and-powershell.html">this post</a>, he shows us how adding:</p>
<pre style="padding-left: 30px">&gt; .\filename.txt</pre>
<p>to a command writes the output to a file in the current directory and also how adding:</p>
<pre> | format-list </pre>
<p>to a command converts our output from a nice table with headers and everything to a list with space to be more verbose. For example, try these two:</p>
<pre style="padding-left: 30px">get-process winlogon</pre>
<p>and this:</p>
<pre style="padding-left: 30px">get-process winlogon | format-list</pre>
<p>This is the most I&#8217;ve learned in the shortest amount of time in a long time. Especially if you count the fact that I now know there&#8217;s only four perfect numbers less than 200,000.</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/09/got-powershell-figured-out-yet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuing with SharePoint Management Shell</title>
		<link>http://vspug.com/spfromscratch/2010/03/08/continuing-with-sharepoint-management-shell/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/08/continuing-with-sharepoint-management-shell/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 23:18:47 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[SMS Scripting]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=257</guid>
		<description><![CDATA[First of all, to echo a point we made a few days ago, our new best friends at Acme Solutions talk about SMS here. They agree that it will be the tool of choice for the SharePoint 2010 administrator.
Then, since we&#8217;re still trying to get our feet under us in this environment, we found this [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, to echo a point we made a few days ago, our new best friends at Acme Solutions talk about SMS <a href="http://www.beyondweblogs.com/post/PowerShell-and-SharePoint-2010.aspx">here</a>. They agree that it will be the tool of choice for the SharePoint 2010 administrator.</p>
<p>Then, since we&#8217;re still trying to get our feet under us in this environment, we found <a href="http://stsadm.blogspot.com/2009/10/sharepoint-2010-stsadm-and-powershell.html">this from our new best friend, Gary</a>. He confirms we we had said earlier that SMS is just MS PowerShell with SharePoint 2010 library added in and he proves it by looking at the shortcut properties when you right click on Start | Programs |SharePoint 2010 | SharePoint Management Shell.</p>
<p>Here we see the target is just:</p>
<pre style="padding-left: 30px">C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe 
-NoExit  " &amp; ' C:\Program Files\Common Files\Microsoft Shared\
Web Server Extensions\14\CONFIG\POWERSHELL\Registration\
\sharepoint.ps1 ' "</pre>
<p>Here we see that the shortcut is just a PowerShell Script of it&#8217;s own:</p>
<pre style="padding-left: 30px">$ver = $host | select version
if ($ver.Version.Major -gt 1)  {$Host.Runspace.ThreadOptions = "ReuseThread"}
Add-PsSnapin Microsoft.SharePoint.PowerShell
Set-location $home</pre>
<p>We looked at the Add-PSSnapIn command previously and turns our PowerShell environment into a SharePoint Management Shell environment by adding the microsoft.sharepoint.powershell library. But this also shows us that we can set variables using the $VariableName = Value format.</p>
<p>Prove that to yourself by opening PowerShell and enter:</p>
<pre style="padding-left: 30px">$robot = "I Love Robots"</pre>
<p>and then do:</p>
<pre style="padding-left: 30px">$robot </pre>
<p>So we&#8217;re checked out on setting PowerShell variables.</p>
<p>Finally, the SharePoint.ps1 script includes a largish #sig block of apparently random characters. I presume this has something to do with signing scripts. Recall in <a href="http://vspug.com/spfromscratch/2010/03/05/create-and-delete-web-app-site-and-web-using-powershell/">our create and delete script </a>that we did last week, we included a   line that said:</p>
<p style="padding-left: 30px">Set-ExecutionPolicy RemoteSigned</p>
<p>Now, obviously, I plagerized this from somewhere becasue you all know as much about this or more than I do. And I apologize to my source, whoever you are, because I also try to credit you guys when we benefit from your genius. But, since it&#8217;s escaped me, I can only say that I recall reading that this command will allow local scripts to run unsigned but still require remote scripts to have a signature. I&#8217;m guessing this big block of characters has something to do with that kind of signature.</p>
<p>hth</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/08/continuing-with-sharepoint-management-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create and Delete Web App, Site, and Web using PowerShell</title>
		<link>http://vspug.com/spfromscratch/2010/03/05/create-and-delete-web-app-site-and-web-using-powershell/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/05/create-and-delete-web-app-site-and-web-using-powershell/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 20:37:36 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=246</guid>
		<description><![CDATA[SharePoint 2010 retains the ambiguous naming of the various containers so that anyone new to the technology will end up getting confused. As a result, I feel compelled to explain, as best I can, everytime the subject comes up, the relationships using the appropriate terms: Web Apps, Sites and Webs. At the same time, we [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left">SharePoint 2010 retains the ambiguous naming of the various containers so that anyone new to the technology will end up getting confused. As a result, I feel compelled to explain, as best I can, everytime the subject comes up, the relationships using the appropriate terms: Web Apps, Sites and Webs. At the same time, we can hook them in our head to the SMS commands that we use to work with them.</p>
<p style="text-align: left">Web Apps are an IIS entity. Consequently, while web apps can share ApplicationPools, everything in a single web app shares a single Application Pool. Also, while a single web app can support any number of site collections, it can only have one host header. This means that one site collection can own the host header url : http://&lt;host header&gt; while all the other will have a url: http://&lt;host header&gt;/SiteCollectionTopLevelSiteName.</p>
<p style="text-align: left">In SMS we use new-SPWebApplication and remove-SPWebApplication to create and destroy web apps.</p>
<p style="text-align: left">From the SharePoint administrators&#8217; point of view, a &#8220;Site&#8221; is really a &#8220;Site Collection&#8221; which is a single top-level site and zero or more sub-sites. Interactively, Site Collections are created in Central Admin and are assigned to a specfic web app and have their own content database. If there&#8217;s already a Site Collection using the web app&#8217;s host header, Central Admin will make you give it a URL under that host header.</p>
<p style="text-align: left">In SMS we use new-SPSite and remove-SPSite to create and delete a site collection.</p>
<p style="text-align: left">Finally, a Web, aka Team Site, is a single SharePoint site. It uses a site template and can support any number of sites below it. Webs are either a top level site or a sub-site.</p>
<p style="text-align: left">In SMS, we use new-SPWeb and remove-SPweb to create and delete webs.  </p>
<p style="text-align: left">So, after you install SharePoint, if you can open Central Admin and if you can open the SharePoint Management Shell, you can create and delete Web Apps, Sites and Web at will. While it&#8217;s easy enough using Central Admin, I was thinking the script that does all of this might be interesting.</p>
<p style="text-align: left">I came up with this:</p>
<pre style="text-align: left;padding-left: 30px">function Pause ($Message="Press any key to continue...")
{
Write-Host -NoNewLine $Message
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host ""
}

Set-ExecutionPolicy RemoteSigned

New-SPWebApplication -Name MyHostHeader -Port 80
   -HostHeader MyHostHeader -URL <a href="http://myhostheader/">http://MyHostHeader</a>
   -AllowAnonymousAccess -ApplicationPool MyHostHeaderAppPool
   -ApplicationPoolAccount (Get-SPManagedAccount MyServer\SVC_SPAppPool03)
ECHO "Web Application Created"
ECHO ""
PAUSE

New-SPSite -Url <a href="http://myhostheader/">http://MyHostHeader</a> -OwnerAlias MyServer\Administrator
   -Name MyHostHeader -Template "STS#0"
ECHO "Site Collection Created"
ECHO ""
PAUSE

New-SPWeb -Url <a href="http://myhostheader/TeamSite">http://MyHostHeader/TeamSite</a> -Template "STS#0"
ECHO "Team Sub-Site Created"
ECHO ""
PAUSE

Remove-SPWeb <a href="http://myhostheader/TeamSite">http://MyHostHeader/TeamSite</a>
ECHO "Team Sub-Site Deleted"
ECHO ""
PAUSE

Remove-SPSite -Identity <a href="http://myhostheader/">http://MyHostHeader</a>
Echo "Site Collection Deleted"
ECHO ""
PAUSE

Remove-SPWebApplication -Identity <a href="http://myhostheader/">http://MyHostHeader</a>
   -DeleteIISSite -RemoveContentDatabase
Echo "Web Application Deleted"
ECHO ""
PAUSE</pre>
<p style="text-align: left">To see it work, copy it to Notepad and delete the line breaks I added to help with formatting here on the page.  Save it as MyScript.ps1. Open your SharePoint Management Shell and run it by using the full path and filename. If you navigate to the folder where you saved it, you have to call it with:</p>
<pre style="text-align: left;padding-left: 30px"> .\MyScript.ps1</pre>
<p style="text-align: left">This will create a web app, site and web and then delete the web, the site and the web app, each time, pausing so you can browse out an see it. I got the PAUSE function from <a href="http://blogs.msdn.com/powershell/archive/2007/02/25/pause.aspx">the PowerShell Team blog here</a>.</p>
<p style="text-align: left">hth</p>
<p style="text-align: left">-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/05/create-and-delete-web-app-site-and-web-using-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows PowerShell 2.0</title>
		<link>http://vspug.com/spfromscratch/2010/03/04/windows-powershell-2-0/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/04/windows-powershell-2-0/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 18:42:30 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[SMS Scripting]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=239</guid>
		<description><![CDATA[So, we&#8217;re looking at this SharePoint Management Shell and learning a bit about it. One thing for sure, if you&#8217;re a SharePoint admin you&#8217;re going to want to run Windows PowerShell locally.
Here&#8217;s the download page from TechNet
This is what Microsoft calls its &#8220;Core Management Framework&#8221; which includes the Remote Manager and the Background Intelligent Transfer [...]]]></description>
			<content:encoded><![CDATA[<p>So, we&#8217;re looking at this SharePoint Management Shell and learning a bit about it. One thing for sure, if you&#8217;re a SharePoint admin you&#8217;re going to want to run Windows PowerShell locally.</p>
<p><a href="http://support.microsoft.com/kb/968929">Here&#8217;s the download page from TechNet</a></p>
<p>This is what Microsoft calls its &#8220;Core Management Framework&#8221; which includes the Remote Manager and the Background Intelligent Transfer Service (BITS.) The download I chose for my XP laptop did not include the BITS component. When it&#8217;s installed, you get the command line interface and the &#8220;Integrated Scripting Environment.&#8221; They appear under Start | Programs | Accessories | Windows PowerShell.  </p>
<p>Also, there&#8217;s <a href="http://technet.microsoft.com/en-us/sharepoint/ee518673.aspx">a decent intro to PowerShell scripting from our new best friend Todd on TechNet here</a>.</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/04/windows-powershell-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows PowerShell and the SharePoint Management Shell</title>
		<link>http://vspug.com/spfromscratch/2010/03/03/createdelete-web-appsite-collection-using-sharepoint-management-shell/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/03/createdelete-web-appsite-collection-using-sharepoint-management-shell/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 14:52:46 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[Install]]></category>
		<category><![CDATA[SMS Scripting]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/2010/03/03/createdelete-web-appsite-collection-using-sharepoint-management-shell/</guid>
		<description><![CDATA[If you&#8217;re an expert at this then you&#8217;re ahead of me here. My new install of Server 2008 R2 includes a Windows PowerShell (WPS) and my SharePoint install includes a SharePoint Management Shell (SMS).
I found this on MSDN where they explain that SMS is just WPS with the SharePoint PowerShell snap-in added. Also, this is part [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re an expert at this then you&#8217;re ahead of me here. My new install of Server 2008 R2 includes a Windows PowerShell (WPS) and my SharePoint install includes a SharePoint Management Shell (SMS).</p>
<p>I found <a href="http://msdn.microsoft.com/en-us/library/ee537913(office.14).aspx">this on MSDN </a>where they explain that SMS is just WPS with the SharePoint PowerShell snap-in added. Also, this is part of the move away from the Shared Service Provider to a more generic Service Application Framework that will support all of Office 14. <a href="http://msdn.microsoft.com/en-us/library/ee537258(office.14).aspx">Here</a>, we can see that Microsoft claims this approach will improve development, integration, load balancing, authentication and back-up\restore.</p>
<p>There&#8217;s also a discussion of the PowerShell and SharePoint Foundation <a href="http://msdn.microsoft.com/en-us/library/ee537258(office.14).aspx">here</a> where you&#8217;ll find links to the beginner guides for WPS.</p>
<p>I also found <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=133a99c7-98e7-40a0-9a3b-aa3717f1c5b2&amp;displaylang=en">the help file for the SMS Cmdlets here</a>. This page is labeled for the Search Server 2010 Express but the SharePoint 2010 Beta commands are included in the third of the three help files listed.</p>
<p>Finally, our new best friend <a href="http://www.cumps.be">David</a> explains <a href="http://www.cumps.be/using-powershell-writing-and-debugging-cmdlets/">here</a> that cmdlets can be written into a .psl file and run from the PS&gt; prompt as well as where to find your $profile so you can add the SharePoint cmdlets into your generic PowerShell environment.</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/03/createdelete-web-appsite-collection-using-sharepoint-management-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://vspug.com/spfromscratch/2010/03/02/225/</link>
		<comments>http://vspug.com/spfromscratch/2010/03/02/225/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 22:06:33 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=225</guid>
		<description><![CDATA[Okay, we know not to try to browse to web applications with non-standard host headers from the server because the loop back restrictions Windows places on us. Here, they explain that we can hack the registry to eliminate the problem but that&#8217;s not really necessary for our purposes now.
So let&#8217;s look at the SMS command [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, we know not to try to browse to web applications with non-standard host headers from the server because the loop back restrictions Windows places on us. <a href="http://support.microsoft.com/default.aspx/kb/896861">Here</a>, they explain that we can hack the registry to eliminate the problem but that&#8217;s not really necessary for our purposes now.</p>
<p>So let&#8217;s look at the SMS command for our new web application:</p>
<pre style="padding-left: 30px">New-SPWebApplication
-Name "Contoso Internet Site"
-Port 80
-HostHeader sharepoint.contoso.com
-URL https://www.contoso.com
-ApplicationPool ContosoAppPool
-ApplicationPoolAccount (Get-SPManagedAccount MyServer\Administrator)</pre>
<p>Now, I&#8217;ve added line breaks for readability so we&#8217;ll have to delete them to make it work. I&#8217;ve also created the managed account on Central Admin&#8217;s Security | Configure Managed Accounts.</p>
<p>It runs for a minute and I get a return of:</p>
<pre>DisplayName               Url
-----------               ---
sharepoint.contoso.com    http://www.contoso.com</pre>
<p>Now, I can&#8217;t browse to it locally, but I can from another computer. Of course, there will be an issue with DNS, but I added www.contoso.com to my hosts file and pointed it to the SharePoint server.</p>
<p>So I browse to the site and I get prompted to login, but then I get<strong> The webpage cannot be found.</strong> This makes sense because there&#8217;s no site collection installed there yet. When we did this interactively in CA, it gave us a popup window that told us to go create a site collection.</p>
<p>Let&#8217;s go back to CA and look at Application Management | Manage Web Applications and you&#8217;ll see the new web application listed. What we need to do is go back to the Application Management pages and click <strong>Create Site Collections</strong>. Here, our new web application will appear in the web app pull down; if not, pull it down and select the new web app. We give it a name, select a template, specify an owner and click OK. After it processes, we can get a link to our new site collection&#8217;s home page. Click it and it will prompt us to login and there it is.</p>
<p>We can back out by moving to the Application Management page and, in the <strong>Delete a Site Collection</strong>. Pull down the Site Collection pick list and click on <strong>Change Site Collection</strong>. Here, we get another pull down to select the site collection we just created. Now, we also get an option to select any additional site collection we may have created in the selected web application. When we can click <strong>OK</strong>, we go back to the delete page and we click <strong>Delete</strong>. We get a dialog box to confirm and click <strong>OK</strong>.</p>
<p>We go back to the Application Management page and we can click on <strong>Manage Web Applications</strong>, select our web application and click <strong>Delete</strong>. This time we get a DHTML popup where we dot the options to delete the content database and the IIS web site and click <strong>Delete</strong> and then <strong>OK </strong>on the confirmation popup.</p>
<p>So, next, what we want to do is add to our new web app command to allow anonymous access and then we&#8217;ll add the command to create the site collection creating our first SMS script to do both at once. Then we&#8217;ll do another script to work the delete.</p>
<p> hth!</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/03/02/225/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010 Creating Web Applications pt. 2</title>
		<link>http://vspug.com/spfromscratch/2010/02/26/sharepoint-2010-creating-web-applications-pt-2/</link>
		<comments>http://vspug.com/spfromscratch/2010/02/26/sharepoint-2010-creating-web-applications-pt-2/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 15:53:02 +0000</pubDate>
		<dc:creator>sprobot</dc:creator>
				<category><![CDATA[Install]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://vspug.com/spfromscratch/?p=211</guid>
		<description><![CDATA[SharePoint 2010 provides a number of ways to create a new web application. We looked at the instructions on TechNet here.
Yesterday, we created a new web app using the pages in Central Admin and a non-standard port number. The TechNet page tells us we can use the new SharePoint Management Shell (SMS) application that is intended [...]]]></description>
			<content:encoded><![CDATA[<p>SharePoint 2010 provides a number of ways to create a new web application. We looked at the <a href="http://technet.microsoft.com/en-us/library/cc261875(office.14).aspx">instructions on TechNet here</a>.</p>
<p>Yesterday, we created a new web app using the pages in Central Admin and a non-standard port number. The TechNet page tells us we can use the new SharePoint Management Shell (SMS) application that is intended to replace stsadmin.exe. It&#8217;s available on the server under Start | Programs | SharePoint 2010 Products | SharePoint Management Shell.</p>
<p>TechNet also tells us the SMS command to create a new web app is:</p>
<pre style="padding-left: 30px">New-SPWebApplication -ApplicationPool &lt;Name of the application pool&gt;
-Name &lt;Name of the new Web application&gt;
[-Port&lt;Port on which the Web application can be accessed&gt;]
[-HostHeader&lt;Valid URL assigned to the Web application that must correlate
to the alternate access mapping configuration&gt;]
[-URL&lt;Load-balanced URL for the Web application&gt;]
[-ApplicationPoolAccount&lt;User account that this application pool will run as&gt;]</pre>
<p>So I composed mine like this:</p>
<pre style="padding-left: 30px">New-SPWebApplication
-Name "Contoso Internet Site"
-Port 80
-HostHeader <a href="http://sharepoint.contoso.com">http://sharepoint.contoso.com</a>
-URL <a href="https://www.contoso.com">https://www.contoso.com</a>
-ApplicationPool ContosoAppPool
-ApplicationPoolAccount (Get-SPManagedAccount MyServer\Administrator)</pre>
<p>And, obviously, we need to look into managed accounts in a little more detail because the error is:</p>
<pre style="padding-left: 30px">Get-SPManagedAccount : No matching accounts were found.</pre>
<p>In fact, I&#8217;m not sure I know what a managed account is.</p>
<p>For my money, no one explains it better than our new best friend <a href="http://furuknap.blogspot.com/2009/09/sharepoint-2010-new-feature-managed.html">Furuknap here</a>. Furuknap tells us that SharePoint 2010 can take over the management of the password of accounts used as application pool IDs. This is convenient because every IIS web site will refer to an app pool and every app pool refers to an ID. When these scale out, managing the passwords can be difficult, particularly when they expire. This new SharePoint 2010 feature eliminates this headache.</p>
<p>So we need a managed account for our SMS create web app script to work.</p>
<p>So we go into Central Admin and visit the Security page. Here, there&#8217;s a linkgroup for <strong>General Security</strong>. I click <strong>Configure Managed Accounts</strong>.</p>
<p>There&#8217;s a <strong>Register Managed Account </strong>link at the top. I click it and enter an account I made earlier for this purpose MyServer\ManagedAccount. Furuknap explains the benefits of letting SharePoint now support your password requirement but I leave them blank all the same.</p>
<p>Now, I return to my SMS session and change my command to reflect the new managed account. I press <strong>Enter</strong> and it runs and runs and returns some output indicating my Site name and URL. I enter the URL in my browser and press <strong>Enter</strong>. It runs for a second and prompts me for a user name and password.</p>
<p>I try the only accounts on the machine: The Administrator account and the managed account. Neither works.</p>
<p>So I tracked down some<a href="http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/8f25d91b-ab61-4bb5-9650-240f751d04f7"> input on Technet </a>here. They pointed me to <a href="http://support.microsoft.com/default.aspx/kb/896861">the KB article here </a>talking about the trackback loops when trying to hit web sites on the local server with non-standard host headers.</p>
<p>-robot</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/spfromscratch/2010/02/26/sharepoint-2010-creating-web-applications-pt-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
