<?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>Calazan.com &#187; scripting</title>
	<atom:link href="http://www.calazan.com/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.calazan.com</link>
	<description>Share the Knowledge</description>
	<lastBuildDate>Sun, 05 Sep 2010 00:59:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python&#8217;s &#8216;zipfile&#8217; Module</title>
		<link>http://www.calazan.com/pythons-zipfile-module/</link>
		<comments>http://www.calazan.com/pythons-zipfile-module/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 01:00:25 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.calazan.com/?p=537</guid>
		<description><![CDATA[I was writing some scripts today and part of it is to compress some files.  I normally make an external application call to 7-Zip command line when I do this, but then I decided to just do a quick Google search to see if Python has one built in.
It turned out there&#8217;s this zipfile module [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.calazan.com/wp-content/uploads/2010/07/python_logo.jpg"><img class="alignleft size-full wp-image-538" title="python_logo" src="http://www.calazan.com/wp-content/uploads/2010/07/python_logo.jpg" alt="" width="100" height="100" /></a>I was writing some scripts today and part of it is to compress some files.  I normally make an external application call to 7-Zip command line when I do this, but then I decided to just do a quick Google search to see if Python has one built in.</p>
<p>It turned out there&#8217;s this <a title="Python zipfile Module" href="http://docs.python.org/library/zipfile.html" target="_blank">zipfile</a> module that&#8217;s part of the standard library that can compress and decompress files for you (only the standard ZIP compression method is supported).</p>
<p>Here are a couple examples:</p>
<p><strong>Zipping a File</strong></p>
<pre class="brush: python;">
import zipfile

sourceFile = r&quot;C:\ziptest\testfile.txt&quot;
outputFile = r&quot;C:\ziptest\testfile.zip&quot;

try:
    zipper = zipfile.ZipFile(outputFile, &quot;w&quot;, zipfile.ZIP_DEFLATED)
    zipper.write(sourceFile)
except zipfile.BadZipfile as zipfileException:
    print zipfileException
finally:
    zipper.close()
</pre>
<p><strong>Unzipping a File</strong></p>
<pre class="brush: python;">
import zipfile

sourceFile = r&quot;C:\ziptest\testfile.zip&quot;
outputFolder = r&quot;C:\ziptest\unzipped&quot;

try:
    unzipper = zipfile.ZipFile(sourceFile)
    unzipper.extractall(outputFolder)
except zipfile.BadZipfile as zipfileException:
    print zipfileException
finally:
    unzipper.close()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.calazan.com/pythons-zipfile-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to automate Microsoft Office 2007 installation</title>
		<link>http://www.calazan.com/how-to-automate-microsoft-office-2007-installation/</link>
		<comments>http://www.calazan.com/how-to-automate-microsoft-office-2007-installation/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 00:53:25 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Windows admin]]></category>

		<guid isPermaLink="false">http://www.calazan.com/?p=337</guid>
		<description><![CDATA[I was just updating some documentation on our wiki and found some old notes on automating Office 2007 installation.  We upgraded our Microsoft Office software early last year from Office 2003 (and a few Office XP) to Office 2007 and this simple installation script saved us a lot of time. Here are the steps:
Step 1.  [...]]]></description>
			<content:encoded><![CDATA[<p>I was just updating some documentation on our wiki and found some old notes on automating Office 2007 installation.  We upgraded our Microsoft Office software early last year from Office 2003 (and a few Office XP) to Office 2007 and this simple installation script saved us a lot of time. Here are the steps:</p>
<p><strong>Step 1.  Copy the contents of the Office 2007 installation CD (or package) to a network share </strong>(eg. \\server\Office12)<strong>.</strong></p>
<p><strong>Step 2.  Run the Office Customization Tool and create a setup customization file </strong>(I got these instructions from a BDD 2007 document on Microsoft&#8217;s website)<strong>.</strong></p>
<p><span id="more-337"></span></p>
<ol>
<li><strong>Run the Office Customization Tool</strong>
<ol>
<li>Go to <strong>Start</strong>-&gt;<strong>Run</strong></li>
<li>Type the following command:  <strong>\\server\Office12\setup.exe /admin</strong></li>
</ol>
</li>
<li><strong>Create a setup customization file</strong>
<ol>
<li>In Office Customization Tool, Click OK to create a new setup file.</li>
<li>Specify the Installation Path, Organization Name</li>
<li>Add the network share location of the Office 2007 Installation Files Shared Folder. <strong>\\server\Office12 </strong></li>
<li>Specify the Product Key and Accept the License Agreement. And Modify the Display Options.</li>
<li>Configure other options</li>
<li>Finally, Click File, Save As, and save the Setup Customization File to Office12\Updates Folder</li>
<li>Close the Office Customization Tool</li>
</ol>
</li>
</ol>
<p><strong>Step 3.</strong> Download and install <a title="Download PowerShell" href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx" target="_blank">PowerShell</a>.</p>
<p><strong>Step 4. </strong>Download and install <a title="PsExec" href="http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx" target="_blank">PsExec</a>.</p>
<p><strong>Step 5. </strong>Open a text editor (WordPad or Notepad is fine) and use the sample script below.  Save the file as <em>office_2007_install.ps1</em>.</p>
<p style="padding-left: 30px;"><em>$hostname = &#8220;comp1&#8243;,&#8221;comp2&#8243;,&#8221;comp3&#8243; </em></p>
<p style="padding-left: 30px;"><em>foreach ($i in $hostname)<br />
</em><em>{<br />
&amp;&#8221;c:\psexec\psexec.exe&#8221; -s \\$i \\server\office12\setup.exe /adminfile cust_file.msp<br />
}</em></p>
<p>Replace comp1&#8230;comp3 with the computer&#8217;s hostname or IP addresss.</p>
<p><strong>Note:</strong> You can also pull the list of computers/IP addresses from a text file (one entry per line) by doing something like <em>$hostname = Get-Content c:\computers.txt</em>.</p>
<p><strong>Step 6. </strong>Schedule the script in Task Scheduler</p>
<p style="padding-left: 30px;"><em>c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit &#8220;c:\office_2007_install.ps1</em>&#8220;</p>
<p><strong><br />
Some suggestions:</strong></p>
<ul>
<li>Let your users know ahead of time when you are planning on upgrading their Office software.  They may be working on a project and can&#8217;t afford to lose any time adjusting to the new version.</li>
<li>Send these links (Interactive 2003 to 2007 Command Reference Guide) to your users before you upgrade their Office applications so there are no surprises when they first use Office 2007:
<ul>
<li><strong>Word:</strong> <a href="http://office.microsoft.com/en-us/word/HA100744321033.aspx" target="_blank">http://office.microsoft.com/en-us/word/HA100744321033.aspx</a></li>
<li><strong>Excel:</strong> <a href="http://office.microsoft.com/en-us/excel/HA101491511033.aspx" target="_blank">http://office.microsoft.com/en-us/excel/HA101491511033.aspx</a></li>
<li><strong>PowerPoint:</strong> <a href="http://office.microsoft.com/en-us/powerpoint/HA101490761033.aspx" target="_blank">http://office.microsoft.com/en-us/powerpoint/HA101490761033.aspx</a></li>
<li><strong>Outlook:</strong> <a href="http://office.microsoft.com/en-us/outlook/HA102221621033.aspx" target="_blank">http://office.microsoft.com/en-us/outlook/HA102221621033.aspx</a></li>
</ul>
</li>
<li>Start with a small group of computers so if you discover a problem (eg. software conflict) there will be minimal interruption.  For example, start with 5 computers and if there are no problems then increase it to 10 computers for the next batch, then 20, then 40, and so on.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.calazan.com/how-to-automate-microsoft-office-2007-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PowerShell Cheat Sheet</title>
		<link>http://www.calazan.com/powershell-cheat-sheet/</link>
		<comments>http://www.calazan.com/powershell-cheat-sheet/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 20:25:14 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Windows admin]]></category>

		<guid isPermaLink="false">http://www.calazan.com/2008/01/03/powershell-cheat-sheet/</guid>
		<description><![CDATA[I found this PowerShell Cheat Sheet a while back when I was looking for tips on PowerShell. It contains commands that you&#8217;ll be using a lot when working with PowerShell, and also examples on how to use them. Very helpful especially if you&#8217;re just starting to learn it. Also check out the PowerShell team blog [...]]]></description>
			<content:encoded><![CDATA[<p>I found this <a href="http://www.calazan.com/wp-content/uploads/2008/01/powershell_cheat_sheet.pdf" title="PowerShell Cheat Sheet">PowerShell Cheat Sheet</a> a while back when I was looking for tips on PowerShell. It contains commands that you&#8217;ll be using a lot when working with PowerShell, and also examples on how to use them. Very helpful especially if you&#8217;re just starting to learn it. Also check out the <a href="http://blogs.msdn.com/powershell/archive/2007/01/25/powershell-cheat-sheet-redux-the-pdf-version.aspx" title="PowerShell team blog">PowerShell team blog</a> where I got this document from.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calazan.com/powershell-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful PowerShell Scripts</title>
		<link>http://www.calazan.com/useful-powershell-scripts/</link>
		<comments>http://www.calazan.com/useful-powershell-scripts/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 08:00:18 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[Windows admin]]></category>

		<guid isPermaLink="false">http://www.calazan.com/?p=9</guid>
		<description><![CDATA[Below are some simple PowerShell scripts that I find pretty useful in Windows administration:
Note: For the scripts that connect to a remote machine, you will need to run PowerShell as a user with Administrator privileges to that machine.
Aliases:

Gwmi = Get-WmiObject
fl = Format-List
ft = Fomat-Table
-Comp = -ComputerName

Get a list of installed applications for a specified machine [...]]]></description>
			<content:encoded><![CDATA[<p>Below are some simple PowerShell scripts that I find pretty useful in Windows administration:</p>
<p><strong>Note:</strong> For the scripts that connect to a remote machine, you will need to run PowerShell as a user with Administrator privileges to that machine.</p>
<p><strong>Aliases:</strong></p>
<ul>
<li>Gwmi = Get-WmiObject</li>
<li>fl = Format-List</li>
<li>ft = Fomat-Table</li>
<li>-Comp = -ComputerName</li>
</ul>
<p><strong>Get a list of installed applications for a specified machine (32-bit OS only).<br />
</strong><em>Gwmi Win32_Product -Comp computer_name | Sort name | ft name, version, installdate</em></p>
<p><strong>Get the Service Tag (Dell computers) and BIOS version for a specified machine.<br />
</strong><em>Gwmi Win32_BIOS -Comp computer_name</em></p>
<p><strong>Get the computer information for a specified machine (Domain, Manufacturer, Model, Name, Owner, Memory).<br />
</strong><em>Gwmi Win32_ComputerSystem -Comp computer_name | fl</em></p>
<p><strong>Get storage drive information for a specified machine (Hard Drive, Floppy, CD/DVD-ROM).</strong><span class="mw-headline"> </span><br />
<em>Gwmi Win32_LogicalDisk -Comp computer_name | fl</em></p>
<p><strong>Get the logged on user name for a specified machine.<br />
</strong><em>Gwmi Win32_Computersystem -Comp computer_name | Select Name, UserName</em></p>
<p><strong>Get the running processes for a specified machine.<br />
</strong><em>Gwmi Win32_Process -ComputerName computer_name | Sort processname | ft processname, ws, executablepath</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.calazan.com/useful-powershell-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
