<?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>danejeffrey.com</title>
	<atom:link href="http://danejeffrey.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://danejeffrey.com/blog</link>
	<description>Good ways to break things.</description>
	<lastBuildDate>Tue, 06 Jul 2010 01:26:30 +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>Finding Old Snapshots &#8211; VMware vSphere PowerCLI</title>
		<link>http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/</link>
		<comments>http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 01:26:30 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=335</guid>
		<description><![CDATA[Because it&#8217;s a pain to check all VM&#8217;s for outstanding snapshots from the VI Client, this script is useful for listing any VM&#8217;s that have outstanding snapshots and when they were created. Referenced mostly from here [vSphere PowerCLI Blog]

Connect-VIServer vcenter-server.domain.com
$vms = Get-VM
$mybool = $False
foreach ($vm in $vms){
	$snap = Get-Snapshot -VM $vm
	if ($snap){
		$mybool = $True
		Write-Host "VM [...]]]></description>
			<content:encoded><![CDATA[<p>Because it&#8217;s a pain to check all VM&#8217;s for outstanding snapshots from the VI Client, this script is useful for listing any VM&#8217;s that have outstanding snapshots and when they were created. Referenced mostly from <a href="http://blogs.vmware.com/vipowershell/2010/02/get-your-popcorn-ready-sample-trainsignal-powercli-video.html">here</a> [vSphere PowerCLI Blog]</p>
<p><code><br />
Connect-VIServer vcenter-server.domain.com<br />
$vms = Get-VM<br />
$mybool = $False<br />
foreach ($vm in $vms){<br />
	$snap = Get-Snapshot -VM $vm<br />
	if ($snap){<br />
		$mybool = $True<br />
		Write-Host "VM Name: " $vm.Name " Snapshot Name: " $snap.Name " Created: " $snap.Created<br />
	}<br />
}<br />
exit<br />
</code><br />
In the above code the $mybool variable is used to keep track if any VM&#8217;s have snapshots or not. The purpose of this code was to send an email if any VM&#8217;s had  snapshots. So, you could replace <code>Write-Host</code> with a string variable and write the output to that then send it via email to alert someone. You can also use the <code>$snap.Size</code> property to determine how big the VM&#8217;s snapshots have grown which is a good indicator on how long it will take to commit them back the the parent disk, if that is your aim.</p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows PowerShell Send Email</title>
		<link>http://danejeffrey.com/blog/2010/07/06/windows-powershell-send-email/</link>
		<comments>http://danejeffrey.com/blog/2010/07/06/windows-powershell-send-email/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 01:16:11 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=337</guid>
		<description><![CDATA[This is posted in heaps of places online (this post is pretty useful &#8211; includes details on message format and attachments), so mainly for my own reference:

$emailFrom = "someone@domain.com"
$emailTo = "someone_else@domain.com"
$subject = "Subject"
$body = "Some text"
$smtpServer = "mail-server.domain.com"
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($emailFrom, $emailTo, $subject, $body)
]]></description>
			<content:encoded><![CDATA[<p>This is posted in heaps of places online (this <a href="http://social.technet.microsoft.com/Forums/en/winserverpowershell/thread/5f7a9d63-6a37-4d98-b710-d76fde920a37">post</a> is pretty useful &#8211; includes details on message format and attachments), so mainly for my own reference:<br />
<code><br />
$emailFrom = "someone@domain.com"<br />
$emailTo = "someone_else@domain.com"<br />
$subject = "Subject"<br />
$body = "Some text"<br />
$smtpServer = "mail-server.domain.com"<br />
$smtp = new-object Net.Mail.SmtpClient($smtpServer)<br />
$smtp.Send($emailFrom, $emailTo, $subject, $body)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/07/06/windows-powershell-send-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exchange 2007 Message Discovery and Removal Across Mailboxes</title>
		<link>http://danejeffrey.com/blog/2010/06/16/exchange-2007-message-discovery-and-removal-across-mailboxes/</link>
		<comments>http://danejeffrey.com/blog/2010/06/16/exchange-2007-message-discovery-and-removal-across-mailboxes/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 05:06:46 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=317</guid>
		<description><![CDATA[Originally found this post on the Technet forums which links to this MS Exchange Team blog from a few years ago.
This cmdlet is great for discovering or removing messages by searching one or many mailboxes. Excellent for removing large messages sent to large distribution groups or virus/spam messages if identified early by the administrator, etc.
A [...]]]></description>
			<content:encoded><![CDATA[<p>Originally found <a href="http://social.technet.microsoft.com/forums/en-US/exchangesvrgeneral/thread/c9025ff3-cf29-48ca-b17d-f98bb64c6bcf">this</a> post on the Technet forums which links to <a href="http://msexchangeteam.com/archive/2006/12/18/431934.aspx">this</a> MS Exchange Team blog from a few years ago.</p>
<p>This cmdlet is great for discovering or removing messages by searching one or many mailboxes. Excellent for removing large messages sent to large distribution groups or virus/spam messages if identified early by the administrator, etc.</p>
<p>A couple of errors that might be returned by this cmdlet are:<br />
<code><br />
[0] [ERROR] Error was found for <SourceMailbox> (SourceMailboxEmailAddress) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error:<br />
MAPI or an unspecified service provider.<br />
ID no: 00000000-0000-00000000, error code: -1056749164</p>
<p>[0] [ERROR] Error was found for <SourceMailbox> (SourceMailboxEmailAddress) because: Error occurred in the step: Creating target folder in the target mailbox. An unknown error has occurred., error code: -2147221233<br />
</code></p>
<p>These are permissions issues. The account running the command needs to have full permissions to the source mailbox (first error code) and the destination mailbox (second error code). This is explained well <a href="http://www.simple-talk.com/sysadmin/exchange/goodbye-exchange-exmerge,-hello-export-mailbox/">here</a></p>
<p>That said, also take a look at <a href="http://romanroz.blogspot.com/2008/03/getting-export-mailbox-cmdlet-to-work.html">this</a> if you are sure that permissions are set correctly</p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/06/16/exchange-2007-message-discovery-and-removal-across-mailboxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Active Directory Topology Diagrammer</title>
		<link>http://danejeffrey.com/blog/2010/05/07/active-directory-topology-diagrammer/</link>
		<comments>http://danejeffrey.com/blog/2010/05/07/active-directory-topology-diagrammer/#comments</comments>
		<pubDate>Fri, 07 May 2010 05:44:53 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=311</guid>
		<description><![CDATA[I may be a bit late in discovering this since it was last published in 2007, but this tool is brilliant. In short, it automatically discovers and diagrams Active Directory domains, OUs, Sites, Exchange organizations, Applications and Servers. 
It requires Visio 2003 or 2007 and uses the .NET Framework v2.0 and can be found here
]]></description>
			<content:encoded><![CDATA[<p>I may be a bit late in discovering this since it was last published in 2007, but this tool is brilliant. In short, it automatically discovers and diagrams Active Directory domains, OUs, Sites, Exchange organizations, Applications and Servers. </p>
<p>It requires Visio 2003 or 2007 and uses the .NET Framework v2.0 and can be found <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cb42fc06-50c7-47ed-a65c-862661742764&#038;displaylang=en">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/05/07/active-directory-topology-diagrammer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Favourite Topic (or Yet Another Lesson in Snapshot-ology)</title>
		<link>http://danejeffrey.com/blog/2010/04/29/my-favourite-topic-or-yet-another-lesson-in-snapshot-ology/</link>
		<comments>http://danejeffrey.com/blog/2010/04/29/my-favourite-topic-or-yet-another-lesson-in-snapshot-ology/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 07:18:17 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[vcb]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=307</guid>
		<description><![CDATA[Another snapshot post. Who new snapshots could be this awesome.
Again, the situation is VCB failing to remove the snapshot it took of a VM when the backup job that kicked it off failed (because of lack of disk space in this case).
First, vcbSnapshot was used to try and remove it via the VCB proxy manually. [...]]]></description>
			<content:encoded><![CDATA[<p>Another snapshot post. Who new snapshots could be this awesome.</p>
<p>Again, the situation is VCB failing to remove the snapshot it took of a VM when the backup job that kicked it off failed (because of lack of disk space in this case).</p>
<p>First, vcbSnapshot was used to try and remove it via the VCB proxy manually. For one reason or another, this failed and a Consolidate Helper- 0 snapshot is left behind. In the VI Client, it will show no snapshots in Snapshot Manager but a check of the VMDK targets show that the VM is indeed pointing to delta disks.</p>
<p>Tried taking a new snapshot manually to confirm the .vmsd file is not corrupt. The chain appeared good. Used:<br />
<code>vmare-cmd <vm_name>.vmx removesnapshots</code><br />
and received the error:<br />
<code>unable to access file <unknown> since it is locked</code></p>
<p>While looking into the problem, found these excellent resources for the undocumented vmkfstools -D switch which dumps file info to /var/log/vmkernel. It can be used to identify the owner of a file lock which could be causing the above error when trying to commit back the snapshot delta files:</p>
<p><a href="http://vi3.org/download/guides/english/vi3/StoppingaVMandReleasingFiles.pdf">http://vi3.org/download/guides/english/vi3/StoppingaVMandReleasingFiles.pdf</a><br />
<a href="http://blog.core-it.com.au/?p=477">http://blog.core-it.com.au/?p=477</a></p>
<p>In this case, however, I didn&#8217;t go through the process &#8211; instead took the coward&#8217;s way out and used: <code>service mgmt-vmware restart</code> on the host that the VM was running on and then used vmware-cmd to commit the snapshots &#8211; worked fine this time.</p>
<p>So, I would expect that if I had used the -D switch on the VMDK&#8217;s attached to the VM, the owner would have eventually been the ESX Host Agent which would be locking the file on behalf of the VCB request. Must remember to go through the process next time to find out for sure&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/04/29/my-favourite-topic-or-yet-another-lesson-in-snapshot-ology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
