<?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>PowerShell.nu &#187; SharePoint 2010</title>
	<atom:link href="http://www.powershell.nu/category/sharepoint-2010/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershell.nu</link>
	<description></description>
	<lastBuildDate>Wed, 14 Jul 2010 22:17:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Australian &amp; New Zealand SharePoint Conference</title>
		<link>http://www.powershell.nu/2010/06/17/australian-new-zealand-sharepoint-conference/</link>
		<comments>http://www.powershell.nu/2010/06/17/australian-new-zealand-sharepoint-conference/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 05:47:17 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sessions]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=1012</guid>
		<description><![CDATA[I just finished my Australian/New Zealand SharePoint &#38; PowerShell tour with Mattias Karlsson where we had the honor to speak at both the New Zealand and the Australian SharePoint conference. In our session SharePoint 2010 and PowerShell – In real life we showed a couple of demos and promised to share them on this site. [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished my Australian/New Zealand SharePoint &amp; PowerShell tour with Mattias Karlsson where we had the honor to speak at both the New Zealand and the Australian SharePoint conference. In our session SharePoint 2010 and PowerShell – In real life we showed a couple of demos and promised to share them on this site. So here they are.</p>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2010/06/DemoCode.zip">Click here to download the scripts</a></p>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2010/06/PowerShell-Presentation.ppt">Click here to download the PowerPoint presentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2010/06/17/australian-new-zealand-sharepoint-conference/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding Announcements to SharePoint 2010 through PowerShell</title>
		<link>http://www.powershell.nu/2010/01/27/adding-announcements-to-sharepoint-2010-through-powershell/</link>
		<comments>http://www.powershell.nu/2010/01/27/adding-announcements-to-sharepoint-2010-through-powershell/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 21:59:07 +0000</pubDate>
		<dc:creator>Niklas Goude</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.powershell.nu/?p=969</guid>
		<description><![CDATA[SharePoint 2010 is on it&#8217;s way and it&#8217;s way cool. Lots of great CmdLets that simplify the SharePoint administrators life. In this post we are going to check out how to add Announcements to an Announcements list in SharePoint through PowerShell. First we&#8217;ll do it step-by-step in the &#8220;SharePoint 2010 Management Shell&#8221; (PowerShell shell that [...]]]></description>
			<content:encoded><![CDATA[<p>SharePoint 2010 is on it&#8217;s way and it&#8217;s way cool. Lots of great CmdLets that simplify the SharePoint administrators life. In this post we are going to check out how to add Announcements to an Announcements list in SharePoint through PowerShell. First we&#8217;ll do it step-by-step in the &#8220;SharePoint 2010 Management Shell&#8221; (PowerShell shell that registers SharePoint CmdLets) and then we&#8217;ll look at a script that automates the task.</p>
<p />
First, start the SharePoint 2010 Management Shell.</p>
<p />
Now we can get fancy with SharePoint administration. Adding a new announcement is done basically in the same way as in MOSS, though it&#8217;s alot simpler since Microsoft added tons of new great SharePoint CmdLets. Below is an example on adding a new announcement to a SharePoint list.</p>
<p />
<pre>
<strong>
PS > $siteScope = Start-SPAssignment
PS > $Announcement = ($siteScope | Get-SPWeb -identity http://sharepoint).Lists["Announcements"]
PS > $NewItem = $Announcement.Items.Add()
PS > $NewItem["Title"] = "My First Announcement"
PS > $NewItem["Body"] = "&lt;h2&gt;PowerShell Magic&lt;/h2&gt;"
PS > $NewItem["Expires"] = "1/28/2010"
PS > $NewItem.Update()
PS > Stop-SPAssignment $siteScope
</strong>
</pre>
<p />
The Start-SPAssignment and Stop-SPAssignment should be used with certain objects such as SPSite, SPWeb and SPSiteAdministration, since they need to be disposed. You can read more about the CmdLets at the <a href="http://cglessner.blogspot.com/2009/11/sharepoint-2010-powershell-and.html">I Love SharePoint blog.</a></p>
<p />
The rest of the code is pretty straightforward, Get the Web through Get-SPWeb, create an object holding the List, use the Add() method, add the information and finally update the new item using the Update() method.</p>
<p />
Here&#8217;s what it looks like in the Shell.</p>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2010/01/Announcement.jpg"><img src="http://www.powershell.nu/wp-content/uploads/2010/01/Announcement-500x140.jpg" alt="Announcement" title="Announcement" width="500" height="140" class="alignnone size-large wp-image-971" /></a></p>
<p />
And here&#8217;s our new Item in SharePoint.</p>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2010/01/Announcement2.jpg"><img src="http://www.powershell.nu/wp-content/uploads/2010/01/Announcement2-499x311.jpg" alt="Announcement2" title="Announcement2" width="499" height="311" class="alignnone size-large wp-image-972" /></a></p>
<p />
When put in a script, we can simply add a new announcement on a single line.</p>
<p />
<pre>
<strong>
PS > Add-SharePointAnnouncement.ps1 -identity http://sharepoint -List Announcements -Title "Added From Script" `
>> -Body "&lt;h2&gt;PowerShell Scripts Rock&lt;/h2&gt;" -Expires 1/28/2010
</strong>
</pre>
<p />
<a href="http://www.powershell.nu/wp-content/uploads/2010/01/Add-SharePointAnnouncement.ps1">Click here to download the script.</a></p>
<p />
]]></content:encoded>
			<wfw:commentRss>http://www.powershell.nu/2010/01/27/adding-announcements-to-sharepoint-2010-through-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
