<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>netnerds.net</title>
	
	<link>http://blog.netnerds.net</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Mon, 30 Jan 2012 18:16:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/netnerdsnet" /><feedburner:info uri="netnerdsnet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>SharePoint 2010: Stop Mixed Content Prompts on RSS Feeds Viewed on SSL-enabled Sites</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/wzjxqFsZqYw/</link>
		<comments>http://blog.netnerds.net/2012/01/sharepoint-2010-stop-mixed-content-prompts-on-rss-feeds-viewed-on-ssl-enabled-sites/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 17:37:48 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1296</guid>
		<description><![CDATA[I started on a new client site last week and my first task was immediately clear: I had to remove the Mixed Content Security prompt on the encrypted SharePoint intranet's front page. Firebug showed that my browser was making calls to feeds.feedburner.com even though the RSS feed was an entirely different address at cio.com. My [...]]]></description>
			<content:encoded><![CDATA[<p>I started on a new client site last week and my first task was immediately clear: I had to remove the Mixed Content Security prompt on the encrypted SharePoint intranet's front page. <a href=http://getfirebug.com>Firebug</a> showed that my browser was making calls to <i>feeds.feedburner.com</i> even though the RSS feed was an entirely different address at <a href=http://cio.com>cio.com</a>.</p>
<p>My first instinct was to try to see if I could find the feed on HTTPS but https://feeds.cio.com did not respond to my request. Then I thought -- the only reason my browser would be making calls to feedburner would be for tracking. Although it's not a critical security threat or waste of bandwidth (the images were 1x1 gifs), I really didn't want feedburner to collect information about our intranet so I decided it was probably best to just remove all embedded HTML code in the description. After some research, it looked like XSL was likely the best way to do this. </p>
<p>I'm not an XSL pro, but I can get around. My initial search for sample code led me to a promising XSL function (which I can't find again to link <img src='http://blog.netnerds.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ), but functions are only supported in XML namespace 2.0 and SharePoint uses 1.0 in the RSS Web Part. After reviewing the XSL provided in the SharePoint RSS Web Part, I decided to embed the <a href=http://p2p.wrox.com/xslt/54014-strip-html-tags-xslt.html>strip-tags</a> template within the GetSafeHTML template that is called for all the different types of feeds. </p>
<p>The following code removes all content within HTML tags (img, a, b, etc) so you're left with plain-text for the description. Clicking the title of the article to read more, still works, of course. To use this in your own RSS feed, edit the RSS Web Part, click on <b>XSL Editor ...</b> at the bottom of the web part panel, and replace the GetSafeHtml template with the following code:</p>
<div class="dirtycodenoclick"><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:template name=&quot;GetSafeHtml&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:param name=&quot;Html&quot;/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:choose&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:when test=&quot;$rss_IsDesignMode = &#039;True&#039;&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:call-template name=&quot;strip-tags&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:with-param name=&quot;text&quot; select=&quot;$Html&quot;/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:call-template&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:when&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:otherwise&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:call-template name=&quot;strip-tags&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:with-param name=&quot;text&quot; select=&quot;rssaggwrt:MakeSafe($Html)&quot;/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:call-template&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:otherwise&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:choose&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:template&gt;<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:template name=&quot;strip-tags&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:param name=&quot;text&quot;/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:choose&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:when test=&quot;contains($text, &#039;&amp;lt;&#039;)&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of select=&quot;substring-before($text, &#039;&amp;lt;&#039;)&quot;/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:call-template name=&quot;strip-tags&quot;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:with-param name=&quot;text&quot; select=&quot;substring-after($text, &#039;&amp;gt;&#039;)&quot;/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:call-template&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:when&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:otherwise&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of select=&quot;$text&quot;/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:otherwise&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:choose&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:template&gt;<br />
</code></div>
<p>This code basically runs <b>strip-tags</b> on the final output of the <b>description</b> node, and aside from the strip-tags code itself, only adds 4 extra lines to your original XSL <img src='http://blog.netnerds.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/wzjxqFsZqYw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2012/01/sharepoint-2010-stop-mixed-content-prompts-on-rss-feeds-viewed-on-ssl-enabled-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2012/01/sharepoint-2010-stop-mixed-content-prompts-on-rss-feeds-viewed-on-ssl-enabled-sites/</feedburner:origLink></item>
		<item>
		<title>SharePoint: Simple Sample Approach to Autonumber</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/dOhajfisWlE/</link>
		<comments>http://blog.netnerds.net/2012/01/sharepoint-simple-sample-approach-to-autonumber/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 15:07:06 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1278</guid>
		<description><![CDATA[Below is a formula for a quick and dirty autonumber for lists in SharePoint. There are a variety of ways to generate this field. Some solutions use workflow or external lists, but I prefer this method because of its simplicity. Note: Because this solution depends on the record's ID column, it generates the autonumber *after* [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a formula for a quick and dirty autonumber for lists in SharePoint. There are a variety of ways to generate this field. Some solutions use <a href=http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/867bcacd-d378-411a-849a-fc040de9e5da/>workflow or external lists</a>, but I prefer this method because of its simplicity. </p>
<p>Note: Because this solution depends on the record's ID column, it generates the autonumber *after* a record has been added, so if you need the autonumber to appear in the "New.." form, this solution is not for you. My project, which required the Request Number to be in "WR-0000" format, was fine with having it generated after the fact.</p>
<p>To create my Request Number, I created a new calculated column, named it Request Number and entered the following formula: </p>
<p><b>=CONCATENATE("WR-",REPT(0,4-LEN(ID+1)),ID+1)</b></p>
<p>This formula combines WR- with leading 0's and the ID number that's built into SharePoint lists. The output looks like so:</p>
<p><center><img src="http://blog.netnerds.net/wp-content/uploads/2012/01/Screen-Shot-2012-01-18-at-10.02.53-AM.png"></center></p>
<p>Thanks to my main SharePoint man, Trevor, for giving me this entire solution. You should start a blog, yo <img src='http://blog.netnerds.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/dOhajfisWlE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2012/01/sharepoint-simple-sample-approach-to-autonumber/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2012/01/sharepoint-simple-sample-approach-to-autonumber/</feedburner:origLink></item>
		<item>
		<title>SharePoint 2010: Use CSS to Auto-expand Calendar Entries</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/dfSSm0NSJkI/</link>
		<comments>http://blog.netnerds.net/2012/01/sharepoint-2010-use-css-to-auto-expand-calendar-entries/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 13:49:21 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1270</guid>
		<description><![CDATA[I looked all around the web for a simple solution to auto-expanding events in a monthly Calendar view. Unfortunately, this isn't something that's built-in to SharePoint, so it has to be done using workarounds. There were many solutions suggested on the web, though a majority required file system edits. Hey, no thanks! Here's what worked [...]]]></description>
			<content:encoded><![CDATA[<p>I looked all around the web for a simple solution to auto-expanding events in a monthly Calendar view. Unfortunately, this isn't something that's built-in to SharePoint, so it has to be done using workarounds. There were many solutions suggested on the web, though a majority required file system edits. Hey, no thanks! </p>
<p>Here's what worked for me: I created a new monthly view called Expanded View, set it to default, then fired up SharePoint designer and opened the new view for editing. Per the suggestion found on <a href="http://stackoverflow.com/questions/3609717/calendar-expand-all-by-default">StackOverflow</a>, I inserted a Content Editor Web Part right above the calendar, then used the split view to find the CEWP and between CDATA[[]], I added</p>
<div class="dirtycodenoclick"><code>&lt;script type=&quot;text/javascript&quot;&gt;<br />
<br />_spBodyOnLoadFunctionNames.push(&#039;WaitForCalendarToLoad&#039;);<br />
<br />function WaitForCalendarToLoad()<br />
{&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;SP.UI.ApplicationPages.SummaryItemRenderer.prototype.$2u = function ()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ULSvSp: ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!this.$1A_1) this.$1A_1 = 100;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.$1A_1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
&lt;/script&gt;</code></div>
<p>&nbsp;<br />
This works best for calendars that mostly have all-day events. Because hourly events add extra lines to display the hours, this solution may not be the best one for those needing to show calendars packed with hourly events; it's not as streamlined. If anyone has some code for making auto-expanded hourly events look good, I'd love to see it.</p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/dfSSm0NSJkI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2012/01/sharepoint-2010-use-css-to-auto-expand-calendar-entries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2012/01/sharepoint-2010-use-css-to-auto-expand-calendar-entries/</feedburner:origLink></item>
		<item>
		<title>PowerShell: Copy-Item -recurse -force Does Not Create Directories when Using Get-ChildItem -include</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/kVmUOTd251E/</link>
		<comments>http://blog.netnerds.net/2011/10/powershell-copy-item-recurse-force-does-not-create-directories-when-using-get-childitem-include/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 20:18:49 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1188</guid>
		<description><![CDATA[I recently wrote a PowerShell script which copied documents from a filter to my local hard drive. I chose PowerShell for this task because it was one of the few programs actually allowed on my ultra locked-down workstation (and 'cuz I love it.) Because I only wanted specific types of files, I gathered the list [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote a PowerShell script which copied documents from a filter to my local hard drive. I chose PowerShell for this task because it was one of the few programs actually allowed on my ultra locked-down workstation (and 'cuz I love it.) </p>
<p>Because I only wanted specific types of files, I gathered the list of documents using  get-childitem -recurse -include and then copied the files using copy-item. What I didn't initially realize was that copy-item's -recurse and -force switches are ineffective in my script because 1.) I'm passing the copy-item command one item at a time and 2.) the get-childitem <i>include</i> switch is "best considered a file filter," according to <a href=http://www.leeholmes.com>Lee Holmes</a> of Microsoft's PowerShell team.. </p>
<p>I got around this by manually creating the directory structure as needed using <b><small> if (!(test-path($dir))) { mkdir $dir }</small></b>. The entire script can be found below:</p>
<div class="dirtycodenoclick"><code>$source = &quot;L:\&quot;<br />
$destination = &quot;C:\docs\&quot;<br />
$since = (Get-date).AddDays(-365)<br />
$includes =&quot;*.doc*&quot;,&quot;*.pdf&quot;,&quot;*.xls*&quot;,&quot;*.ppt*&quot;<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;$items = get-childitem $source -recurse -include $includes |&nbsp;&nbsp;where-object {$_.LastAccessTime –gt $since}<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach ($item in $items)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dir = $item.DirectoryName.Replace($source,$destination)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $target = $item.FullName.Replace($source,$destination)<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!(test-path($dir))) { mkdir $dir }<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!(test-path($target)))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;copy-item -path $item.FullName -destination $target -recurse -force<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</code></div>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/kVmUOTd251E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2011/10/powershell-copy-item-recurse-force-does-not-create-directories-when-using-get-childitem-include/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2011/10/powershell-copy-item-recurse-force-does-not-create-directories-when-using-get-childitem-include/</feedburner:origLink></item>
		<item>
		<title>OpenVPN: Update Client DNS Servers on Mac OS X Using the Command Line.</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/1QBW0w5Lqng/</link>
		<comments>http://blog.netnerds.net/2011/10/openvpn-update-client-dns-on-mac-os-x-using-from-the-command-line/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 20:48:50 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1167</guid>
		<description><![CDATA[There's a bit of a debate on how best to update your DNS resolver on Mac OS X when connecting to an OpenVPN Server. For whatever reason, even if use DHCP on the VPN server, OS X won't use the assigned DNS server(s). It's been recommended to use scutil, but the scripts are crazy long [...]]]></description>
			<content:encoded><![CDATA[<p>There's a bit of a debate on how best to update your DNS resolver on Mac OS X when connecting to an OpenVPN Server. For whatever reason, even if use DHCP on the VPN server, OS X won't use the assigned DNS server(s). It's been <a href="http://www.mccambridge.org/blog/2007/10/correct-way-to-set-up-openvpn-client-on-mac-os-x/">recommended</a> to use <b>scutil</b>, but the scripts are crazy long and <a href="http://www.mccambridge.org/blog/2007/10/correct-way-to-set-up-openvpn-client-on-mac-os-x/comment-page-1/#comment-1959">I've read</a> the resolver order sometimes gets reset anyway. </p>
<p>The usual route of using /etc/resolv.conf <a href="http://www.afp548.com/article.php?story=20041015131913324"">does not work on OS X</a> but specifying DNS servers in your Network Preferences does. If you use public network servers like 8.8.8.8 or 4.2.2.2, you're already set. Move along <img src='http://blog.netnerds.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But if you rely on DHCP assigned DNS servers, the </a> the script below will do the trick. This script specifies or clears (sets back to DHCP default) the DNS servers on each of the adapters listed in <i>networksetup</i>.</p>
<div class="dirtycodenoclick"><code>#!/bin/bash<br />
<br /># Set bash delimeter to be line break<br />
IFS=$&#039;\n&#039;<br />
<br /># VPN DNS Server<br />
vpndns=&#039;172.20.0.1&#039;<br />
<br /># Get adapter list<br />
adapters=`networksetup -listallnetworkservices |grep -v denotes`<br />
<br />for adapter in $adapters<br />
do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo updating dns for $adapter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dnssvr=(`networksetup -getdnsservers $adapter`)<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if [ $dnssvr != $vpndns ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# set dns server to the vpn dns server<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;networksetup -setdnsservers $adapter $vpndns<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# revert back to DHCP assigned DNS Servers<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;networksetup -setdnsservers $adapter empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br />
done</code></div>
<p> Again, if you already set your DNS servers, your OpenVPN connection will use those. This script is effective for people who use DHCP assigned DNS servers by default and would like to tunnel their DNS requests when connecting to an OpenVPN server.</p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/1QBW0w5Lqng" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2011/10/openvpn-update-client-dns-on-mac-os-x-using-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2011/10/openvpn-update-client-dns-on-mac-os-x-using-from-the-command-line/</feedburner:origLink></item>
		<item>
		<title>OS X: Find Network Gateway using the Comand Line</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/vIYGyKQEX8U/</link>
		<comments>http://blog.netnerds.net/2011/10/os-x-find-defaul-network-gateway-using-the-comand-line/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 23:49:46 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1156</guid>
		<description><![CDATA[This is a bit more complex than it should be; I was hoping networksetup would make this easier but, alas. Using netstat -nr appears to be the best way to find your gateway from the command line: netstat -nr &#124; grep '^default' &#124; awk '{ print $2 }' If you haven't played around with networksetup, [...]]]></description>
			<content:encoded><![CDATA[<p>This is a bit more complex than it should be; I was hoping <i>networksetup</i> would make this easier but, alas. Using netstat -nr appears to be the best way to find your gateway from the command line:</p>
<p><b>netstat -nr | grep '^default' | awk '{ print $2 }'</b></p>
<p>If you haven't played around with <i>networksetup</i>, I recommend checking out <i>networksetup -getinfo "Airport"</i> and <i>networksetup -listnetworkserviceorder</i>.</p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/vIYGyKQEX8U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2011/10/os-x-find-defaul-network-gateway-using-the-comand-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2011/10/os-x-find-defaul-network-gateway-using-the-comand-line/</feedburner:origLink></item>
		<item>
		<title>PowerShell: Find/Replace Template</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/gGjFeeF57WM/</link>
		<comments>http://blog.netnerds.net/2011/10/powershell-findreplace-template/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 20:55:31 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1090</guid>
		<description><![CDATA[Brandon had this in some of his maintenance plan code and I found myself using it a bit so I thought I'd blog about it. Here is a simple script that reads a file (C:\scripts\maintenanceplans\$sqlversion\template.dtsx), replaces certain placeholders (in this case, [SERVERNAME] and [BACKUPPATH]), then writes a new file with that content. $serverName = &#34;sqlserver1&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Brandon had this in some of his maintenance plan code and I found myself using it a bit so I thought I'd blog about it. Here is a simple script that reads a file (C:\scripts\maintenanceplans\$sqlversion\template.dtsx), replaces certain placeholders (in this case, <strong>[SERVERNAME]</strong> and <strong>[BACKUPPATH]</strong>), then writes a new file with that content.</p>
<div class="dirtycodenoclick"><code>$serverName = &quot;sqlserver1&quot;<br />
$backupPath = &quot;D:\dbbackups&quot;<br />
<br /># Read in the maintenance plan template and replace the place holders<br />
$textTemplate = [IO.File]::ReadAllText(&quot;.\maintenanceplans\$sqlVersion\template.dtsx&quot;)<br />
$textTemplate = $textTemplate.Replace(&quot;[SERVERNAME]&quot;,&quot;$serverName&quot;)<br />
$textTemplate = $textTemplate.Replace(&quot;[BACKUPPATH]&quot;,&quot;$backupPath&quot;)<br />
<br /># Write the new package.&nbsp;&nbsp;MUST use UTF8 encoding or it will break.<br />
Set-Content -Encoding utf8 &quot;.\out.dtsx&quot; $packageContents</code></div>
<p>&nbsp;<br />
This particular script writes out XML files. If you are writing a plain text file, remove "-Encoding utf8" and you're set.</p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/gGjFeeF57WM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2011/10/powershell-findreplace-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2011/10/powershell-findreplace-template/</feedburner:origLink></item>
		<item>
		<title>iPhone Dev: Base SDK Missing Solved</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/oxPktQYZzto/</link>
		<comments>http://blog.netnerds.net/2011/10/iphone-dev-base-sdk-missing-solved/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 23:33:25 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1144</guid>
		<description><![CDATA[Someone awesome sent me the code to an iPhone app that he created for RealCajunRecipes.com. I unzipped the file, and opened the project in XCode 4.2. I immediately noticed the upper left hand drop down (what's that called anyway?) said "Base SDK Missing." So I went to all the usual places to change the SDK, [...]]]></description>
			<content:encoded><![CDATA[<p>Someone awesome sent me the code to an iPhone app that he created for <a href=http://www.realcajunrecipes.com>RealCajunRecipes.com</a>. I unzipped the file, and opened the project in XCode 4.2. I immediately noticed the upper left hand drop down (what's that called anyway?) said "Base SDK Missing." So I went to all the usual places to change the SDK, I saved it and restarted XCode. Nope, I still encountered the following error when trying to Build my project: <font color=red>error: There is no SDK with the name or path 'iphonesimulator3.1'</font>.</p>
<p>Google searches gave me the same "solution" over and over but none of it worked. Ultimately, I had to go into my projects <b>.xcodeproj directory</b> to edit the file <b>project.pbxproj</b>. </p>
<p>I changed the lines that referenced <i>SDKROOT</i> from <i>SDKROOT = iphonesimulator3.1</i> to <i>SDKROOT = iphoneos</i>, restarted XCode and successfully built the app.</p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/oxPktQYZzto" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2011/10/iphone-dev-base-sdk-missing-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2011/10/iphone-dev-base-sdk-missing-solved/</feedburner:origLink></item>
		<item>
		<title>SharePoint + PowerShell: Batch Import Models, Create ECT’s, Set Permissions</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/NEB3Hxx2XMM/</link>
		<comments>http://blog.netnerds.net/2011/09/sharepoint-powershell-batch-import-models-create-ects-set-permissions/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 04:47:19 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1130</guid>
		<description><![CDATA[Here is a script that will batch import Models, create associated ECT's, and set permissions for users and admins. Please modify the variables as needed. # script from netnerds.net # Make sure the namespace is the same as the namespace in your exported bdcm files # My $siteURL happens to be the same as my [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a script that will batch import Models, create associated ECT's, and set permissions for users and admins. Please modify the variables as needed.</p>
<div class="dirtycodenoclick"><code># script from netnerds.net<br />
# Make sure the namespace is the same as the namespace in your exported bdcm files<br />
# My $siteURL happens to be the same as my $namespace. That may not be the case for you.<br />
# Do this only on dev machines<br />
# I&#039;m running this on the SharePoint 2010 server so I made my servicecontext localhost<br />
#<br />
# What this does:<br />
# Scans current directory for BDC Export(.bdcm) files<br />
# Creates the External System/Lob and the External Content Types<br />
# Creates External Lists from those ECT&#039;s<br />
# Sets the proper permissions<br />
<br />$adminGroup = &quot;DOMAIN\SharePoint Admins&quot;<br />
$userGroup = &quot;DOMAIN\SharePoint Users&quot;<br />
$serviceContext = &quot;http://localhost/&quot;<br />
$nameSpace = &quot;http://sharepoint/&quot;<br />
$SiteUrl = $nameSpace<br />
<br />$bdc = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType Catalog -ServiceContext $serviceContext<br />
$pathtobdcmfiles = Get-Location<br />
$importFiles = Get-Childitem -path $pathtobdcmfiles | Where {$_.extension -eq &quot;.bdcm&quot; -and $_.basename -ne &quot;catalog&quot;}<br />
<br />foreach ($file in $importFiles) {<br />
Import-SPBusinessDataCatalogModel -Path $file.FullName -Identity $bdc -force -ModelsIncluded -PropertiesIncluded -PermissionsIncluded -Verbose<br />
<br /># THIS WHOLE CHUNK COMES FROM: http://gallery.technet.microsoft.com/scriptcenter/82437789-f294-4bcd-8210-a1ba0e081f82/<br />
# IT MAKES THE EXTERNAL LISTS FROM THE MODELS. AWESOME.<br />
&nbsp;&nbsp;&nbsp;&nbsp;$Model = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType Model -Name $file.baseName -ServiceContext $ServiceContext<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;$ListUrl = &quot;Lists/{0}&quot;<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ForEach ($Entity in $Model.AllEntities)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ns = $Entity.Namespace<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write-Host &quot;Entity Namespace : $ns&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$name = $entity.Name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write-Host &quot;Entity Name : $name&quot;<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write-Host &quot;Looking for MethodInstance specific finder&#46;..&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sf = $Entity.MethodInstances | Where-Object{ $_.MethodInstanceType -eq [Microsoft.BusinessData.MetadataModel.MethodInstanceType]::SpecificFinder }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If($sf -eq $null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write-Host &quot;Skipping external list creation as Method Instance of Type SpecificFinder was not found in Entity : $name&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write-Host &quot;Creating and Configuring SPListDataSource&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ds = New-Object -TypeName Microsoft.SharePoint.SPListDataSource<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$instanceName = [String]::Empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ForEach($instance in $entity.LobSystem.LobSystemInstances){$instanceName = $Instance.Name}<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ds.SetProperty(&quot;LobSystemInstance&quot;, $instanceName)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ds.SetProperty(&quot;EntityNamespace&quot;, $ns)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ds.SetProperty(&quot;Entity&quot;, $name)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ds.SetProperty(&quot;SpecificFinder&quot;, $sf.Name)<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$site = $null<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Try<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$site = Get-SPSite -Identity $SiteUrl<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$web = $site.OpenWeb()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$web.Lists.Add($Entity.Name, &quot;&quot;, [String]::Format($ListUrl, $Entity.Name), $ds);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Finally<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$web.Dispose()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$site.Dispose()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
#END CHUNK<br />
}<br />
<br />$claimAdmin = New-SPClaimsPrincipal -Identity $adminGroup -IdentityType WindowsSamAccountName<br />
$claimUsers = New-SPClaimsPrincipal -Identity $userGroup -IdentityType WindowsSamAccountName<br />
<br />Grant-SPBusinessDataCatalogMetadataObject -Identity $bdc -Principal $claimAdmin -Right &quot;Execute,SetPermissions,Edit,SelectableInClients&quot;<br />
Grant-SPBusinessDataCatalogMetadataObject -Identity $bdc -Principal $claimUsers -Right &quot;Execute,Edit,SelectableInClients&quot;<br />
<br />Copy-SPBusinessDataCatalogAclToChildren -MetadataObject $bdc<br />
<br />#Ignore this, its what I wish my namespace was&#46;..<br />
#$nameSpace = &quot;http://$env:USERDNSDOMAIN/&quot;.toLower()</code></div>
<p>&nbsp;<br />
As they say in the SuSE Linux motd: Have a lot of fun!</p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/NEB3Hxx2XMM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2011/09/sharepoint-powershell-batch-import-models-create-ects-set-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2011/09/sharepoint-powershell-batch-import-models-create-ects-set-permissions/</feedburner:origLink></item>
		<item>
		<title>SharePoint + PowerShell: Import All BDCM Files in a Directory and Set Permissions</title>
		<link>http://feedproxy.google.com/~r/netnerdsnet/~3/RVvwWOboyY4/</link>
		<comments>http://blog.netnerds.net/2011/09/sharepoint-powershell-import-all-bdcm-files-in-a-directory-and-set-permissions/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 03:55:06 +0000</pubDate>
		<dc:creator>Chrissy</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.netnerds.net/?p=1125</guid>
		<description><![CDATA[In order to invest as little effort as possible creating and recreating and recreating my External Content Types on my development server, I exported the ECT's then deleted External Content Types, External Systems, and BDC Models. I saved them all in a directory on the SharePoint server, then I placed ImportALLbdcms.ps1 in the same directory [...]]]></description>
			<content:encoded><![CDATA[<p>In order to invest as little effort as possible creating and recreating and recreating my External Content Types on my development server, I exported the ECT's then deleted External Content Types, External Systems, and BDC Models. I saved them all in a directory on the SharePoint server, then I placed ImportALLbdcms.ps1 in the same directory and ran it.</p>
<div class="dirtycodenoclick"><code>$adminGroup = &quot;DOMAIN\SharePoint Admins&quot; #for bdc permissions<br />
$userGroup = &quot;Domain\SharePoint Users&quot;<br />
<br />$serviceContext = &quot;http://localhost/&quot;<br />
$nameSpace = &quot;http://$env:USERDNSDOMAIN/&quot;.toLower()<br />
<br />$bdc = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType Catalog -ServiceContext $serviceContext<br />
$pathtobdcmfiles = Get-Location<br />
$importFiles = Get-Childitem -path $pathtobdcmfiles | Where {$_.extension -eq &quot;.bdcm&quot; -and $_.basename -ne &quot;catalog&quot;}<br />
<br />foreach ($file in $importFiles) {<br />
Import-SPBusinessDataCatalogModel -Path $file.FullName -Identity $bdc -force -ModelsIncluded -PropertiesIncluded -PermissionsIncluded -Verbose<br />
write-host $file.fullname<br />
}<br />
<br />$claimAdmin = New-SPClaimsPrincipal -Identity $adminGroup -IdentityType WindowsSamAccountName<br />
$claimUsers = New-SPClaimsPrincipal -Identity $userGrup -IdentityType WindowsSamAccountName<br />
<br />Grant-SPBusinessDataCatalogMetadataObject -Identity $bdc -Principal $claimAdmin -Right &quot;Execute,SetPermissions,Edit,SelectableInClients&quot;<br />
Grant-SPBusinessDataCatalogMetadataObject -Identity $bdc -Principal $claimUsers -Right &quot;Execute,Edit,SelectableInClients&quot;<br />
<br />Copy-SPBusinessDataCatalogAclToChildren -MetadataObject $bdc</code></div>
<p>&nbsp;<br />
Sorry for a junky intro and no conclusion, I've been working 19 hour straight and I'm about exhausted. Anyway, HTHY!</p>
<img src="http://feeds.feedburner.com/~r/netnerdsnet/~4/RVvwWOboyY4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.netnerds.net/2011/09/sharepoint-powershell-import-all-bdcm-files-in-a-directory-and-set-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.netnerds.net/2011/09/sharepoint-powershell-import-all-bdcm-files-in-a-directory-and-set-permissions/</feedburner:origLink></item>
	</channel>
</rss>

