<?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 &#8211; CS@Worcester</title>
	<atom:link href="https://cs.worcester.edu/category/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>https://cs.worcester.edu</link>
	<description>Worcester State University Computer Science Department</description>
	<lastBuildDate>Thu, 28 Mar 2013 13:34:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
<site xmlns="com-wordpress:feed-additions:1">236835116</site>	<item>
		<title>Encrypting and Decrypting Sections of a Web.config with PowerShell</title>
		<link>https://joshjoubert.wordpress.com/2013/03/28/encrypting-and-decrypting-sections-of-a-web-config-with-powershell/</link>
		
		<dc:creator><![CDATA[Josh]]></dc:creator>
		<pubDate>Thu, 28 Mar 2013 13:34:34 +0000</pubDate>
				<category><![CDATA[CS@Worcester]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">https://joshjoubert.wordpress.com/?p=34</guid>

					<description><![CDATA[In this post I will show you how to Encrypt and Decrypt Sections of a Web.config file. This function will encrypt a sections of a web.config file. function Encrypt-ConfigurationSection([int] $id, [&#8230;]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=joshjoubert.wordpress.com&#38;blog=45046505&#38;post=34&#38;subd=joshjoubert&#38;ref=&#38;feed=1" width="1" height="1">]]></description>
										<content:encoded><![CDATA[<p>In this post I will show you how to Encrypt and Decrypt Sections of a Web.config file.</p>
<p>This function will encrypt a sections of a web.config file.</p>
<p><code>function Encrypt-ConfigurationSection([int] $id, [string] $app, [string] $section, [string] $version){<br />
$currentDirectory = (Get-Location)<br />
Set-Location "C:\windows\Microsoft.Net\Framework\$version\"<br />
.\aspnet_regiis.exe -pe $section -app $app -site $id -prov "RsaProtectedConfigurationProvider"<br />
Set-Location $currentDirectory<br />
} </code></p>
<p>Example call</p>
<p>Encrypt-ConfigurationSection 1 ‘/WebApplication1’ ‘connectionStrings’ ‘v4.0.30319’</p>
<p>This function will decrypt a sections of a web.config file.</p>
<p><code>function Decrypt-ConfigurationSection([int] $id, [string] $app, [string] $section, [string] $version){<br />
$currentDirectory = (Get-Location)<br />
Set-Location "C:\windows\Microsoft.Net\Framework\$version\"<br />
.\aspnet_regiis.exe -pd $section -app $app -site $id<br />
Set-Location $currentDirectory<br />
}</code></p>
<p>Example Call</p>
<p>Decrypt-ConfigurationSection 1 ‘/WebApplication1’ ‘connectionStrings’ ‘v4.0.30319’</p>
<p>Now, if you look at the functions you will notice that there is a <em>$version</em> variable. The <em>$version</em> variable is important. This is because if you are working with an ASP.net web application that uses an Application Pool with a Managed Runtime Version of v2.0, then you want to be using the aspnet_regiis application for that version. The same goes for Applications that use and Application Pool with a Managed Runtime Version of v4.0.</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/joshjoubert.wordpress.com/34/"><img decoding="async" alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/joshjoubert.wordpress.com/34/" /></a> <img data-recalc-dims="1" decoding="async" alt="" border="0" src="https://i0.wp.com/pixel.wp.com/b.gif?resize=1%2C1&#038;ssl=1" width="1" height="1" /></p>

<p class="syndicated-attribution"><em>From the blog <a href="https://joshjoubert.wordpress.com">joshjoubert » CS@Worcester</a> by <a href="https://cs.worcester.edu/author/0/" title="Read other posts by Josh">Josh</a></em> and used with permission of the author. All other rights reserved by the author.</p>]]></content:encoded>
					
		
		<enclosure url="https://2.gravatar.com/avatar/5a2a88bf779e5967e32eafa6e9f8c50e?s=96&#038;d=identicon&#038;r=G" length="0" type="" />

		<post-id xmlns="com-wordpress:feed-additions:1">1716</post-id>	</item>
		<item>
		<title>Encrypting and Decrypting Sections of a Web.config with PowerShell</title>
		<link>https://joshjoubert.wordpress.com/2013/03/28/encrypting-and-decrypting-sections-of-a-web-config-with-powershell/</link>
		
		<dc:creator><![CDATA[Josh]]></dc:creator>
		<pubDate>Thu, 28 Mar 2013 13:34:34 +0000</pubDate>
				<category><![CDATA[CS@Worcester]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">http://joshjoubert.wordpress.com/?p=34</guid>

					<description><![CDATA[In this post I will show you how to Encrypt and Decrypt Sections of a Web.config file. This function will encrypt a sections of a web.config file. function Encrypt-ConfigurationSection([int] $id, [&#8230;]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=joshjoubert.wordpress.com&#38;blog=45046505&#38;post=34&#38;subd=joshjoubert&#38;ref=&#38;feed=1" width="1" height="1">]]></description>
										<content:encoded><![CDATA[<p>In this post I will show you how to Encrypt and Decrypt Sections of a Web.config file.</p>
<p>This function will encrypt a sections of a web.config file.</p>
<p><code>function Encrypt-ConfigurationSection([int] $id, [string] $app, [string] $section, [string] $version){<br />
$currentDirectory = (Get-Location)<br />
Set-Location "C:\windows\Microsoft.Net\Framework\$version\"<br />
.\aspnet_regiis.exe -pe $section -app $app -site $id -prov "RsaProtectedConfigurationProvider"<br />
Set-Location $currentDirectory<br />
} </code></p>
<p>Example call</p>
<p>Encrypt-ConfigurationSection 1 ‘/WebApplication1’ ‘connectionStrings’ ‘v4.0.30319’</p>
<p>This function will decrypt a sections of a web.config file.</p>
<p><code>function Decrypt-ConfigurationSection([int] $id, [string] $app, [string] $section, [string] $version){<br />
$currentDirectory = (Get-Location)<br />
Set-Location "C:\windows\Microsoft.Net\Framework\$version\"<br />
.\aspnet_regiis.exe -pd $section -app $app -site $id<br />
Set-Location $currentDirectory<br />
}</code></p>
<p>Example Call</p>
<p>Decrypt-ConfigurationSection 1 ‘/WebApplication1’ ‘connectionStrings’ ‘v4.0.30319’</p>
<p>Now, if you look at the functions you will notice that there is a <em>$version</em> variable. The <em>$version</em> variable is important. This is because if you are working with an ASP.net web application that uses an Application Pool with a Managed Runtime Version of v2.0, then you want to be using the aspnet_regiis application for that version. The same goes for Applications that use and Application Pool with a Managed Runtime Version of v4.0.</p>
<p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/joshjoubert.wordpress.com/34/"><img decoding="async" alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/joshjoubert.wordpress.com/34/" /></a> <img data-recalc-dims="1" decoding="async" alt="" border="0" src="https://i0.wp.com/pixel.wp.com/b.gif?resize=1%2C1&#038;ssl=1" width="1" height="1" /></p>

<p class="syndicated-attribution"><em>From the blog <a href="https://joshjoubert.wordpress.com">joshjoubert » CS@Worcester</a> by <a href="https://cs.worcester.edu/author/0/" title="Read other posts by Josh">Josh</a></em> and used with permission of the author. All other rights reserved by the author.</p>]]></content:encoded>
					
		
		<enclosure url="https://2.gravatar.com/avatar/5a2a88bf779e5967e32eafa6e9f8c50e?s=96&#038;d=identicon&#038;r=G" length="0" type="" />

		<post-id xmlns="com-wordpress:feed-additions:1">3372</post-id>	</item>
	</channel>
</rss>
