<?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>A Technical Journey &#187; Powershell</title>
	<atom:link href="http://www.technicaljourney.com/category/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technicaljourney.com</link>
	<description>www.technicaljourney.com - Web Blog Of Paul McSharry, Technical Consultant &#38; Trainer.</description>
	<lastBuildDate>Thu, 12 Aug 2010 12:02:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PowerShell &#8211; Clean Up Script &#8211; Files older than X number of days</title>
		<link>http://www.technicaljourney.com/2010/03/powershell-clean-up-script-files-older-than-x-number-of-days/</link>
		<comments>http://www.technicaljourney.com/2010/03/powershell-clean-up-script-files-older-than-x-number-of-days/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 22:43:41 +0000</pubDate>
		<dc:creator>Paul McSharry</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.technicaljourney.com/?p=69</guid>
		<description><![CDATA[I have been working with development teams for many years.  One of the most common requests, especially with development and test servers is to automate the deleting of  old log or temp file folders.  Most of the time these files contain debug information, and do not need archiving, but tend to fill the drives to capacity if not maintained.   To [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with development teams for many years.  One of the most common requests, especially with development and test servers is to automate the deleting of  old log or temp file folders.  Most of the time these files contain debug information, and do not need archiving, but tend to fill the drives to capacity if not maintained.  </p>
<p>To Solve this issue,  the following clean up powershell script is useful;</p>
<blockquote><p>#powershell clean up script based on file write time</p>
<p>gci &#8220;e:\temp\*.*”|? {$_.lastwritetime -lt (get-date).adddays(-1)} |</p></blockquote>
<blockquote><p>remove-item</p></blockquote>
<p>To run this script,   set the powershell  execution policy to RemoteSigned (run the command <em>set-</em><em>ExecutionPolicy RemoteSigned ) </em>and save the powershell  script  in a .ps1 file.</p>
<p>To configure the script, change the directory path (e:\temp\*.* in this example)  and the number of days required (-1).</p>
<p>To test the script add –whatif  after the “remote-item” cmdlet.  This will show the files that would be deleted and no data will be lost if errors exist.</p>
<p>Once tested, to schedule it  create a batch file with the following   (change the powershell file location).</p>
<blockquote><p>powershell -command &#8220;&amp; &#8216;c:\delete.ps1&#8242; &#8220;</p></blockquote>
<p>You can now schedule the script with the Windows task scheduler (point to the batchfile).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicaljourney.com/2010/03/powershell-clean-up-script-files-older-than-x-number-of-days/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check Exchange 2007 Server Edition Level</title>
		<link>http://www.technicaljourney.com/2010/02/check-exchange-2007-server-edition-level/</link>
		<comments>http://www.technicaljourney.com/2010/02/check-exchange-2007-server-edition-level/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 15:34:42 +0000</pubDate>
		<dc:creator>Paul McSharry</dc:creator>
				<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.technicaljourney.com/?p=65</guid>
		<description><![CDATA[To confirm the Exchange 2007 server edition (ie standard or enterprise),  run the following powershell one-liner  from the Exchange Management shell Get-ExchangeServer &#124; fl name,edition,admindisplayversion As the example output shows below,  each exchange server in the organisation will be listed with name, edition, and build/patch level. Name                : [...]]]></description>
			<content:encoded><![CDATA[<p>To confirm the Exchange 2007 server edition (ie standard or enterprise),  run the following powershell one-liner  from the Exchange Management shell</p>
<blockquote>
<p style="text-align: center;"><em>Get-ExchangeServer | fl name,edition,admindisplayversion</em></p>
</blockquote>
<p style="text-align: left;"><em><span style="font-style: normal;">As the example output shows below,  each exchange server in the organisation will be listed with name, edition, and build/patch level.</span></em></p>
<div id="_mcePaste">Name                : Mail1</div>
<div id="_mcePaste">Edition             : Enterprise</div>
<div id="_mcePaste">AdminDisplayVersion : Version 6.5 (Build 7638.2: Service Pack 2)</div>
<div id="_mcePaste">Name                : Mail2</div>
<div id="_mcePaste">Edition             : Enterprise</div>
<div id="_mcePaste">AdminDisplayVersion : Version 8.1 (Build 240.6)</div>
<div>Name                : Mail3</div>
<div id="_mcePaste">Edition             : Enterprise</div>
<div id="_mcePaste">AdminDisplayVersion : Version 8.1 (Build 240.6)</div>
<div>Name                : Mail4</div>
<div id="_mcePaste">Edition             : Enterprise</div>
<div id="_mcePaste">AdminDisplayVersion : Version 8.1 (Build 240.6)</div>
]]></content:encoded>
			<wfw:commentRss>http://www.technicaljourney.com/2010/02/check-exchange-2007-server-edition-level/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Requesting a new exchange 2007 SSL certificate in powershell.</title>
		<link>http://www.technicaljourney.com/2009/11/requesting-a-new-exchange-2007-ssl-certificate-in-powershell/</link>
		<comments>http://www.technicaljourney.com/2009/11/requesting-a-new-exchange-2007-ssl-certificate-in-powershell/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 14:53:30 +0000</pubDate>
		<dc:creator>Paul McSharry</dc:creator>
				<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://www.technicaljourney.com/?p=23</guid>
		<description><![CDATA[For Exchange Server 2007 functions such as autodiscovery, and client access roles ( OWA &#38; Outlook anywhere) a SSL certificate is required to secure data transfer between the exchange server and client. It is best practice to ensure that all external access is secured using a certificate issued from a public certificate authority. This is [...]]]></description>
			<content:encoded><![CDATA[<p>For Exchange Server 2007 functions such as autodiscovery, and client access roles ( OWA &amp; Outlook anywhere) a SSL certificate is required to secure data transfer between the exchange server and client.</p>
<p>It is best practice to ensure that all external access is secured using a certificate issued from a public certificate authority.</p>
<p>This is normally installed on the exchange client access server role , or an ISA server if the solution is being secured using that firewall solution.</p>
<p>To generate a certificate request file for the certificate authority the following powershell command can be used on the exchange server;</p>
<p><strong><em>New-ExchangeCertificate –generaterequest –subjectname &#8220;O=&lt;company name&gt;, OU=&lt;company dept&gt;, C=&lt;country code&gt;, S=&lt;area&gt;, L=&lt;city&gt;, CN=&lt;common name&gt;&#8221; –privatekeyexportable:1 -keysize 1024 –path c:\certifcaterequest.txt</em></strong></p>
<p>Key</p>
<ul>
<li>O – Organisation Name (legal name of company)</li>
<li>OU – Organisational Unit (i.e. Department)</li>
<li>CN – Common Name (i.e. domain.com)</li>
<li>C- Country</li>
<li>ST – State</li>
<li>L – Location</li>
</ul>
<p>This command will request a new certificate and save the contents in a text file &#8211; certifcaterequest.txt</p>
<p>This file can then be provided to the certificate provider to issue the appropriate certificate.</p>
<p>Note: For exchange 2007, a multi-site certificate is required to fully utilise functionality, this covers the internal and external server references and the auto discover address, ie.</p>
<ul>
<li>email.domain.com</li>
<li>autodiscovery.domain.com</li>
<li>exchangesvr.domain.local</li>
</ul>
<p>Once the certificate authority provides the certificate, it can be imported using the following powershell command</p>
<p><em><strong>Import-ExchangeCertificate -Path &#8220;C:\Certificate.cer&#8221;</strong></em></p>
<p><em>NB: It is is possible to use self-signed certificates within exchange 2007, this maybe acceptable for internal use, however public facing access should always be secured using a 3rd party signed certificate.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technicaljourney.com/2009/11/requesting-a-new-exchange-2007-ssl-certificate-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
