<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3859053332094757531</id><updated>2008-07-07T03:43:25.973-07:00</updated><title type='text'>Quick and Dirty Scripting</title><link rel='alternate' type='text/html' href='http://www.bjd145.org/scripting_blog.html'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.bjd145.org/atom.xml'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-6377526587696495105</id><published>2008-04-09T19:13:00.000-07:00</published><updated>2008-04-09T19:57:41.940-07:00</updated><title type='text'>Powershell Script to Create Sharepoint Web Application</title><content type='html'>Microsoft Sharepoint 2007 has a very nice web-based UI to create Web Applications, but there is one catch. The UI creates the backend database on the fly. In a lot of companies, this is the role of a DBA, and only they are allowed to create a new database. In a way this makes sense due to the fact that the DBAs must maintain the intergity of the database server. Microsoft has provided a switch within the stsadm command to create a new Web Application with an existing database, but I thought I could come up with a way to do it using Powersell.&lt;br /&gt;&lt;br /&gt;What I wanted to do was to supply a script with an XML configuration that would create 1-N Web Applications with 1-N Sites. The XML looks like the following:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;sharepoint&gt;&lt;/sharepoint&gt;&lt;/span&gt;&lt;sharepoint&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;Sharepoint&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;    &amp;lt;WebApplication name="Test Site #1" hostheader="http://portal.example.net"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;AppPoolName&amp;gt;WebApp-Portal&amp;lt;/AppPoolName&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;AppPoolUser&amp;gt;Domain\myServiceAccount&amp;lt;/AppPoolUser&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;AppPoolPass&amp;gt;test1235&amp;lt;/AppPoolPass&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;Port&amp;gt;80&amp;lt;/Port&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;DatabaseServer&amp;gt;DBS-SERVER-NAME\MOSS&amp;lt;/DatabaseServer&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;DatabaseName&amp;gt;WSS_Content_Potal&amp;lt;/DatabaseName&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;RootDirectory&amp;gt;d:\inetpub\wwwroot\wss\portal&amp;lt;/RootDirectory&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;Sites&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;            &amp;lt;Site Path="/"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;                &amp;lt;Title&amp;gt;Root Site&amp;lt;/Title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;                &amp;lt;Description&amp;gt;Root Site&amp;lt;/Description&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;                &amp;lt;Type&amp;gt;STS#1&amp;lt;/Type&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;                &amp;lt;AdminAccount&amp;gt;DOMAIN\Administrator&amp;lt;/AdminAccount&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;                &amp;lt;AdminName&amp;gt;Administrator1&amp;lt;/AdminName&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;                &amp;lt;AdminEmail&amp;gt;root@jexample.net&amp;lt;/AdminEmail&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;            &amp;lt;/Site&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;        &amp;lt;/Sites&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;    &amp;lt;/WebApplication&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;    &amp;lt;WebApplication&amp;gt;&amp;lt;/WebApplication&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/Sharepoint&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;webapplication name="Test Site #1" hostheader="http://wssportal.jpmchase.net"&gt;&lt;sites&gt;&lt;site path="/"&gt;&lt;/site&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;webapplication&gt;&lt;/webapplication&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/sites&gt;&lt;/webapplication&gt;&lt;/sharepoint&gt;&lt;/blockquote&gt;The first thing that needs to be done is load the Sharepoint .NET assembly and attach to the local farm&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")&lt;br /&gt;$farm = [microsoft.sharepoint.administration.spfarm]::local&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Then  load the XML configuration file and loop through all Web Applications.&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;function main()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;$moss = "Sharepoint"&lt;br /&gt;$cfg = [xml](gc $cfgFile)&lt;br /&gt;&lt;br /&gt;if( $? -eq $false ) {&lt;br /&gt;  Write-Host "Could not cleanly parase XML file. Exiting . . ."&lt;br /&gt;  return $false&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Write-Host "Found Sharepoint Farm on Local Host  . . "&lt;br /&gt;&lt;br /&gt;Write-Host "Using $cfgFile file . . ."&lt;br /&gt;&lt;br /&gt;$cfg.$moss.WebApplication | % {&lt;br /&gt;&lt;br /&gt;  createWebApp( $_ )&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;main&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Surprisingly to create new Web Application, all you need to do is create a Powershell object of type SPWebApplicationBuilder, assign the proper variables, create and then provision.  The command can take up to 10 minutes to complete so be patient.&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;function createWebApp( [object] $cfg )&lt;br /&gt;{&lt;br /&gt;$webAppBuilder = $nul&lt;br /&gt;$webAppBuilder =  new-object _&lt;br /&gt;    microsoft.sharepoint.administration.SPWebApplicationBuilder($farm)&lt;br /&gt;&lt;br /&gt;$secureString = ConvertTo-SecureString $cfg.AppPoolPass -asPlainText -force&lt;br /&gt;&lt;br /&gt;$webAppBuilder.Port = $cfg.port&lt;br /&gt;$webAppBuilder.ApplicationPoolId =  $cfg.AppPoolName&lt;br /&gt;$webAppBuilder.ApplicationPoolUsername = $cfg.AppPoolUser&lt;br /&gt;$webAppBuilder.ApplicationPoolPassword = $secureString&lt;br /&gt;&lt;br /&gt;$webAppBuilder.HostHeader = $cfg.hostheader&lt;br /&gt;$webAppBuilder.ServerComment = $cfg.name&lt;br /&gt;$webAppBuilder.DatabaseServer = $cfg.DatabaseServer&lt;br /&gt;$webAppBuilder.DatabaseName = $cfg.DatabaseName&lt;br /&gt;$webAppBuilder.RootDirectory = $cfg.RootDirectory&lt;br /&gt;&lt;br /&gt;if( $cfg.AllowAnonymous.ToString().ToLower() -eq "true" ) {&lt;br /&gt;  $webAppBuilder.AllowAnonymousAccess = $true&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Write-Host "Will now Provision this Web Application."&lt;br /&gt;Write-Host "This may take up to 10 minutes. . ."&lt;br /&gt;$webApp = $webAppBuilder.Create()&lt;br /&gt;$webApp.Provision()&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Finally, loop through all Sites that are listed in the XML and add them to the Web Application.&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;  $cfg.Sites.Site | % {&lt;br /&gt;      $title = $_.SiteTitle.ToString()&lt;br /&gt;      $path = $_.Path.ToString()&lt;br /&gt;&lt;br /&gt;      rite-Host "Will now Provision Site - $title ($path). "&lt;br /&gt;      Write-Host "This may take up to 10 minutes. . ."&lt;br /&gt;&lt;br /&gt;      $webApp.Sites.Add( $_.Path,&lt;br /&gt;               $_.Title,&lt;br /&gt;               $_.Description,&lt;br /&gt;               1033,&lt;br /&gt;               $_.Type,&lt;br /&gt;               $_.AdminAccount,&lt;br /&gt;               $_.AdminName,&lt;br /&gt;               $_.AdminEmail)&lt;br /&gt;  }&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;See easy as 1, 2, 3 . . .</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2008/04/powershell-script-to-create-sharepoint.html' title='Powershell Script to Create Sharepoint Web Application'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=6377526587696495105' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/6377526587696495105'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/6377526587696495105'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-5658306511518351106</id><published>2008-02-10T21:08:00.000-08:00</published><updated>2008-02-11T06:09:34.941-08:00</updated><title type='text'>Powershell Scriptblocks</title><content type='html'>One of the interesting features that is, I believe, little know in Powershell is the scriptblock.  What is a scriptblock? The way that I define it is a function or block of code that is assigned to a variable.  Why do you need to know about this?  I've found it most useful when using Powershell to create a GUI.  You have to assign an action to an element on the GUI (like a Button). But the action can not be a function. It must be a script block.  You can define the block as a variable or  define it within the {} of the Add_Click method of the System.Windows.Forms.Button object.&lt;br /&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;Now I'm probably completely wrong with this, and if I am I would love to learn more about it.  So please let me know! I want to cover how to create GUIs in Powershell in couple weeks so I will be building off this blog post.&lt;br /&gt;&lt;br /&gt;So how do you create a Script block. Its easy as assigning a variable to a anything within {}.&lt;br /&gt;&lt;br /&gt;A simple case would be something like&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;PS C:\temp&gt; $x = { Write-Host "Hello, World!" }&lt;br /&gt;&lt;br /&gt;PS C:\temp&gt; $x.GetType()&lt;br /&gt;&lt;br /&gt;IsPublic IsSerial Name                                     BaseType&lt;br /&gt;-------- -------- ----                                     --------&lt;br /&gt;True     False    ScriptBlock                              System.Object&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you just call the variable, it will return the block definition&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;PS C:\temp&gt; $x&lt;br /&gt;Write-Host "Hello, World!"&lt;/blockquote&gt;&lt;br /&gt;To invoke the scriptblock, you need to call the Inovke() method of the script&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;PS C:\temp&gt; $x.Invoke()&lt;br /&gt;Hello, World!&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Within the scriptblock, you can do whatever you want to do. It can be multiple lines, you can even call functions from within the block.  For example:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\temp&gt; function y () {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&gt;&gt; Write-Host "Within function y"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&gt;&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\temp&gt; y&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Within function y&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\temp&gt; $x = {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&gt;&gt; Write-Host "Within scriptblock x"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&gt;&gt; y&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&gt;&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\temp&gt; $x.Invoke()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Within scriptblock x&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Within function y&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Here are all of the methods that Scriptblocks provides within Powershell&lt;br /&gt;&lt;blockquote style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;PS C:\temp&gt; $x | Get-Member&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; TypeName: System.Management.Automation.ScriptBlock&lt;br /&gt;&lt;br /&gt;Name             MemberType Definition&lt;br /&gt;----             ---------- ----------&lt;br /&gt;Equals           Method     System.Boolean Equals(Object obj)&lt;br /&gt;GetHashCode      Method     System.Int32 GetHashCode()&lt;br /&gt;GetType          Method     System.Type GetType()&lt;br /&gt;get_IsFilter     Method     System.Boolean get_IsFilter()&lt;br /&gt;Invoke           Method     System.Collections.ObjectModel.Collection`1[[System.Management.Automation.PSObject, Syst...&lt;br /&gt;InvokeReturnAsIs Method     System.Object InvokeReturnAsIs(Params Object[] args)&lt;br /&gt;set_IsFilter     Method     System.Void set_IsFilter(Boolean value)&lt;br /&gt;ToString         Method     System.String ToString()&lt;br /&gt;IsFilter         Property   System.Boolean IsFilter {get;set;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I hope this gives you an introduction into scriptblocks. Next time, hopefully, we can cover the TCL/TK-like feature of Powershell - its GUI.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2008/02/one-of-interesting-features-that-is-i.html' title='Powershell Scriptblocks'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=5658306511518351106' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/5658306511518351106'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/5658306511518351106'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-1433455108993136975</id><published>2008-01-16T13:29:00.000-08:00</published><updated>2008-01-16T13:40:39.539-08:00</updated><title type='text'>Q&amp;D Ping Function for Powershell</title><content type='html'>&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;By default, Powershell does not have any built in functionality to send an ICMP ping to see if a remote computer is alive on and on the network.   But never fear because Powershell is based off .NET.  This means  it is very easy to implement a Ping function that you can add to a Powershell library file (along with other functions that I have blogged about previously).   The function is pretty straight forward. All that you really new to do is to create two .NET objects - Ping and PingReply.  My ping function only looks to see if a success was returned by ICMP. I am not looking for round trip time or to handle non-successful.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function Ping (  [string] $strComputer )&lt;br /&gt;{&lt;br /&gt;  $timeout=120;&lt;br /&gt;  trap { continue; }&lt;br /&gt;  &lt;br /&gt;  $ping = new-object System.Net.NetworkInformation.Ping &lt;br /&gt;  $reply = new-object System.Net.NetworkInformation.PingReply&lt;br /&gt;&lt;br /&gt;  $reply = $ping.Send($strComputer, $timeout);&lt;br /&gt;  if( $reply.Status -eq "Success"  ) &lt;br /&gt;  {&lt;br /&gt;     return $true;&lt;br /&gt;  }&lt;br /&gt;  return $false;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Again that's it.  The trap command will just ignore any errors that are throw by the $ping.Send command.  If anyone has questions than you can always email me at brian@bjd145.org.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2008/01/q-ping-function-for-powershell.html' title='Q&amp;D Ping Function for Powershell'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=1433455108993136975' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/1433455108993136975'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/1433455108993136975'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-1320459165659516628</id><published>2008-01-06T20:54:00.001-08:00</published><updated>2008-01-06T20:54:29.700-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Powershell and XML Configuration Files</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;One of the things that I almost always create when I am developing a script is a configuration file. Utilizing XML for a configuration file format is very easy with Powershell.&amp;nbsp; The first thing that you need to do is to layout your XML file. I typically don't create a DTD or verify the XML schema because well, only my scripts will be using the XML configuration file.&amp;nbsp; Not completely within spec, but I've learn to live with it. The XML does need to be well formed with proper closing brackets, root node, etc in order for Powershell to read the XML but that is the only restriction.&lt;/p&gt; &lt;p&gt;The most common XML file that I create includes a list of servers and some attribute about those servers. A simple&amp;nbsp; example that of a test application that is made up of three web servers and a database server. The way that I would create the XML would be as follows:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#000080"&gt;&amp;lt;test_app_servers&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dbs server="vm-dbs1" dbsname="eut"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;web dir="d$\inetpub\wwwroot"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;server&amp;gt;vm-test1&amp;lt;/server&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;server&amp;gt;vm-test2&amp;lt;/server&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;server&amp;gt;vm-test3&amp;lt;/server&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/web&amp;gt;&amp;lt;/test_app_servers&amp;gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now the important part, how does Powershell read the XML.&amp;nbsp; The code is very straight forward. You use the get-content command and cast the file as XML.&amp;nbsp; The command is:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#000080"&gt;$cfgFile = ".\test_app_config.xml"&lt;br&gt;$root = "test_app_servers"&lt;br&gt;$cfg = [xml] ( gc $cfgFile )&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now once you have the configuration saved in the variable $cfg then how do you use it?&amp;nbsp; Powershell stores the information in a tree format so it is easy to get at. Some samples of how to get at the data include:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#000080"&gt;$strDbsName = $cfg.$root.dbs.dbsname&lt;/font&gt; &lt;p&gt;&lt;font color="#000080"&gt;$strDbsServer = $cfg.$root.dbs.server&lt;/font&gt; &lt;p&gt;&lt;font color="#000080"&gt;$strWebDir = $cfg.$root.web.dir&lt;/font&gt; &lt;p&gt;&lt;font color="#000080"&gt;$cfg.$root.web.server | % { &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $strWebServer = $_&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Content of &lt;/font&gt;&lt;a href="file://\\$strWebServer\$strWebDir"&gt;&lt;font color="#000080"&gt;\\$strWebServer\$strWebDir&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080"&gt;"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dir &lt;/font&gt;&lt;a href="file://\\$strWebServer\$strWebDir"&gt;&lt;font color="#000080"&gt;\\$strWebServer\$strWebDir&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;&lt;font color="#000080"&gt;}&lt;/font&gt;&lt;/blockquote&gt; &lt;p&gt;And that is all you should need to know in order to utilize XML as a configuration file with Powershell&lt;/p&gt;  </content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2008/01/powershell-and-xml-configuration-files.html' title='Powershell and XML Configuration Files'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=1320459165659516628' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/1320459165659516628'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/1320459165659516628'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-1616842501609331367</id><published>2007-12-27T09:22:00.001-08:00</published><updated>2007-12-27T09:22:48.189-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware powershell'/><title type='text'>Update to VMware's Powershell Toolkit</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Just wanted to throw this out there for anyone using VMware's Powershell toolkit. They released a new CTP on 12/26. The file version is 68764.&amp;nbsp; They've added a bunch of new commands such as Get-Inventory, New/Get-OSCustomizationSpec, Add-VMHost, Move-Datacenter, Move-Cluster, Find-EntityViews, etc . . &lt;/p&gt; &lt;p&gt;I need to find some time to play with these new commands. I do know that the base Get-VIServer and Get-VMHost do work with ESX 3.5 which is nice to see as well.&lt;/p&gt; &lt;p&gt;Until I have more scripts to share. . . &lt;/p&gt;</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/12/update-to-vmware-powershell-toolkit.html' title='Update to VMware&amp;#39;s Powershell Toolkit'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=1616842501609331367' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/1616842501609331367'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/1616842501609331367'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-2589308881352341097</id><published>2007-12-02T19:53:00.000-08:00</published><updated>2007-12-02T20:12:33.617-08:00</updated><title type='text'>How to Find all Domain Computers Using Powershel</title><content type='html'>I'm asked a lot to find out something from all the servers in my Active Directory domain. Like "Tell me the free space on all servers in the domain" or "List all of the error events from Microsoft's Event Viewer for servers in the domain." These two questions can be answered very easily using WMI and Powershell,namely the get-WMIobject function. But how to get all of the server names? Using VBScript, this can be accomplished by using ADSI. But the code is hard to follow and I never really got a hang of using the ADSI calls. But why uses that when there is a great tool made already.  dsquery.  dsquery is tool written by Microsoft to query Active Directory (http://technet2.microsoft.com/WindowsServer/en/Library/46ba1426-43fd-4985-b429-cd53d3046f011033.mspx). Using this and combined with Powershell is Quick and Dirty but as always gets the job done.&lt;br /&gt;&lt;br /&gt;So how do you use it?   First the basic . . .&lt;br /&gt;&lt;br /&gt;dsquery computer "ou=Domain Controllers,DC=example,DC=com" will find all servers in the Organizational Unit Domain Controllers. dsquery has a option 'server' which will do the same thing (dsquery servers)&lt;br /&gt;&lt;br /&gt;The return result is . . .&lt;br /&gt;"CN=DC03,OU=Domain Controllers,DC=example,DC=com"&lt;br /&gt;"CN=DC02,OU=Domain Controllers,DC=example,DC=com"&lt;br /&gt;"CN=DC01,OU=Domain Controllers,DC=example,DC=com"&lt;br /&gt;&lt;br /&gt;To return all computers, just do  ....&lt;br /&gt;dsquery computer -limit 0  - The limit 0 tells dsquery not to limit the number of systems it returns. I believe the default is 100.&lt;br /&gt;&lt;br /&gt;dsquery can also be used to find servers in the domain . . . .&lt;br /&gt;dsquery computer -name "*WEB*"  will return &lt;br /&gt;"CN=DRWEB01,OU=Web,OU=Disaster Recovery,OU=Machines,OU=Shared Applications,DC=example,DC=com"&lt;br /&gt;"CN=DEV-WEB01,OU=Development,OU=Machines,OU=Shared Applications,DC=example,DC=com"&lt;br /&gt;"CN=STG-WEB01,OU=Stage,OU=Machines,OU=Shared Applications,DC=example,DC=com"&lt;br /&gt;"CN=STG-WEB02,OU=Stage,OU=Machines,OU=Shared Applications,DC=example,DC=com"&lt;br /&gt;"CN=PRD-WEB01,OU=Production,OU=Machines,OU=Shared Applications,DC=example,DC=com"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So can this be used with Powershell.  As long as dsquery is located in the path where powershell can call it from, just write a function such as this&lt;br /&gt;&lt;br /&gt;function GetDomainServers {&lt;br /&gt;        return @( dsquery computer -limit 0 -o rdn | % { $_.Split("`"")[1] } )&lt;br /&gt;} &lt;br /&gt;The -o rdn means to just return the server name. The server name will be in quotes which is why the return values are piped into Split("`""). This will split the server name into 3 parts. We just want the second value. This is combined to form an array which is returned.&lt;br /&gt;&lt;br /&gt;In other words,&lt;br /&gt;dsquery computer -limit 0 -o rdn  returns "PRD-WEB01". &lt;br /&gt;The powershell command Split("`"") will split the value on ".  &lt;br /&gt;This returns &lt;br /&gt;"&lt;br /&gt;PRD-WEB01&lt;br /&gt;"&lt;br /&gt;&lt;br /&gt;To call this function, its as easy as $servers = GetDomainServers.&lt;br /&gt;&lt;br /&gt;Well that's it. As always, I would love to hear feed back from anyone who finds these posts interesting and helpful.</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/12/how-to-find-all-domain-computers-using.html' title='How to Find all Domain Computers Using Powershel'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=2589308881352341097' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/2589308881352341097'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/2589308881352341097'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-6866760815411203567</id><published>2007-11-28T10:44:00.001-08:00</published><updated>2008-03-25T08:54:08.593-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='batch sql'/><title type='text'>Restoring A Database with  transaction logs</title><content type='html'>&lt;p&gt;I've been often asked to restore a database to another server and have all transactions logs applied to it up to a certain point. Using SQL Server 2005, you could setup Transaction Log shipping and it works very well, or you could copy the files over manually then apply them manually using SQL Server Enterprise Studio. Well I'm lazy so I came up with this simple script to do the work for me . . .&lt;/p&gt;&lt;p&gt;This script will ask for the database name to be restored as well as the directory where the transaction logs , drop any existing database of that name, restore the database and its transaction logs. It will not setup your database backups (full or transaction) nor will it replicate them over. I do have scripts for this but a tool like SyncBackSE works just as well. Oh this is a Windows batch script that utilizes osql which comes with SQL Server 2005.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;@echo off &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;set BAKFILE=%1&lt;br /&gt;set DBSNAME=%2&lt;br /&gt;set LOGDIR=%3&lt;/span&gt; &lt;p&gt;&lt;span style="color:#0000ff;"&gt;IF NOT DEFINED BAKFILE (GOTO HELP)&lt;br /&gt;IF NOT DEFINED DBSNAME (GOTO HELP)&lt;br /&gt;IF NOT DEFINED LOGDIR (GOTO HELP) &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;echo Using the following variables to restore the database&lt;br /&gt;echo Database Backup file - %BAKFILE%&lt;br /&gt;echo Database Name - %DBSNAME%&lt;br /&gt;echo Trans Log Directory - %LOGDIR%&lt;br /&gt;choice /M "Do you want to continue" &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;IF ERRORLEVEL 2 ( GOTO END) &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;set DATADIR=d:\DATA&lt;br /&gt;set SQL=%TMP%\restore.sql&lt;br /&gt;set OUT=.\restore_results.txt &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;IF EXIST %SQL% ( del %SQL% ) &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;IF NOT EXIST %BAKFILE% (&lt;br /&gt;echo %BAKFILE does not exist. Must exit.&lt;br /&gt;GOTO END&lt;br /&gt;) &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;echo USE [MASTER] &amp;gt; %SQL%&lt;br /&gt;echo GO &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo ALTER DATABASE %DBS% SET SINGLE_USER WITH ROLLBACK_IMMEDIATE &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo GO &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo DROP DATABASE %DBS% &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo GO &amp;gt;&amp;gt; %SQL%&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;echo RESTORE DATABASE [%DBSNAME%] &amp;gt; %SQL%&lt;br /&gt;echo FROM DISK = '%BAKFILE%' &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo WITH NORECOVERY &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo GO &amp;gt;&amp;gt; %SQL% &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;for /f "tokens=* delims= " %%a in ('dir /b /a-d /od %LOGDIR%\*.trn') do (&lt;br /&gt;echo RESTORE LOG [%DBSNAME%] &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo FROM DISK = '%LOGDIR%\%%a' &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo WITH NORECOVERY &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo GO &amp;gt;&amp;gt; %SQL%&lt;br /&gt;set LAST=%%a&lt;br /&gt;) &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;echo RESTORE LOG [%DBSNAME%] &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo FROM DISK = '%LOGDIR%\%LAST%' &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo WITH RECOVERY &amp;gt;&amp;gt; %SQL%&lt;br /&gt;echo GO &amp;gt;&amp;gt; %SQL% &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;osql -E -w 5000 -i %SQL% -o %OUT%&lt;br /&gt;GOTO END &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;:HELP&lt;br /&gt;echo.&lt;br /&gt;echo Usage: restore_dbs.bat [BAKFILE] [DBSNAME] [LOG DIR]&lt;br /&gt;echo.&lt;br /&gt;echo.&lt;br /&gt;echo BAKFILE - The full path to a recent backup file of the database&lt;br /&gt;echo DBSNAME - Name of the new database&lt;br /&gt;echo LOG DIR - The full path to a directory that contains all the recent tanslogs&lt;br /&gt;echo *The LOG DIR should not contain any transaction logs older than BAKFILE&lt;br /&gt;echo.&lt;br /&gt;echo Eg: restore.bat d:\Backups\SampleDBS_backup_200705222201.bak SampleDBS d:\Temp&lt;br /&gt;echo. &lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;:END&lt;br /&gt;IF EXIST %SQL% ( del %SQL% ) &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/11/restoring-database-with-transaction.html' title='Restoring A Database with  transaction logs'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=6866760815411203567' title='3 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/6866760815411203567'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/6866760815411203567'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-8677150168867840951</id><published>2007-11-26T06:11:00.001-08:00</published><updated>2007-11-26T06:11:58.669-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>VMware's Very Cool Get-Stat Command</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Today I want to briefly show&amp;nbsp; you the power of the VMware's Get-State command.&amp;nbsp; With it you can grab statistics on any VI entity - ESX Host, Virtual Machine, or Resource Pool.&amp;nbsp; To use it, all you need to do is supply the entity you want to monitor and which statistics do you want to grab (common, CPU, memory, disk, or network). So let's get some stats on an ESX host.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;font color="#0000ff"&gt;$&lt;em&gt;vc = Get-VIServer "vc1.example.com"&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;$esx = Get-VIHost "esx1.example.com"&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;Get-Stat $esx -Memory -maxsamples 3 -realtime&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value Unit&lt;br&gt;---------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----- ----&lt;br&gt;mem.vmmemctl.average 11/26/2007 1:52:2...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 KB&lt;br&gt;mem.vmmemctl.average 11/26/2007 1:52:0...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 KB&lt;br&gt;mem.vmmemctl.average 11/26/2007 1:51:4...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 KB  &lt;p&gt;Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 21.49&lt;br&gt;Timestamp&amp;nbsp;&amp;nbsp; : 11/26/2007 1:52:20 PM&lt;br&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp; : mem.usage.average&lt;br&gt;Unit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : %&lt;br&gt;Description : Memory usage as percentage of total configured or available memory&lt;br&gt;Entity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : VMware.VimAutomation.Client20.VMHostImpl  &lt;p&gt;Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 21.49&lt;br&gt;Timestamp&amp;nbsp;&amp;nbsp; : 11/26/2007 1:52:00 PM&lt;br&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp; : mem.usage.average&lt;br&gt;Unit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : %&lt;br&gt;Description : Memory usage as percentage of total configured or available memory&lt;br&gt;Entity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : VMware.VimAutomation.Client20.VMHostImpl  &lt;p&gt;Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 21.49&lt;br&gt;Timestamp&amp;nbsp;&amp;nbsp; : 11/26/2007 1:51:40 PM&lt;br&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp; : mem.usage.average&lt;br&gt;Unit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : %&lt;br&gt;Description : Memory usage as percentage of total configured or available memory&lt;br&gt;Entity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : VMware.VimAutomation.Client20.VMHostImpl  &lt;p&gt;mem.active.average&amp;nbsp;&amp;nbsp; 11/26/2007 1:52:2...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 78988 KB&lt;br&gt;mem.active.average&amp;nbsp;&amp;nbsp; 11/26/2007 1:52:0...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 78988 KB&lt;br&gt;mem.active.average&amp;nbsp;&amp;nbsp; 11/26/2007 1:51:4...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 78988 KB&lt;br&gt;mem.granted.average&amp;nbsp; 11/26/2007 1:52:2...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2097504 KB&lt;br&gt;mem.granted.average&amp;nbsp; 11/26/2007 1:52:0...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2097504 KB&lt;br&gt;mem.granted.average&amp;nbsp; 11/26/2007 1:51:4...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2097504 KB &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;Get-Stat $esx -common -maxsamples 1 -realtime&lt;/font&gt;&lt;/em&gt; &lt;p&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value Unit&lt;br&gt;---------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----- ----&lt;br&gt;cpu.usage.average&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/26/2007 2:05:4...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.86 %  &lt;p&gt;Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 297&lt;br&gt;Timestamp&amp;nbsp;&amp;nbsp; : 11/26/2007 2:05:40 PM&lt;br&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp; : cpu.usagemhz.average&lt;br&gt;Unit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MHz&lt;br&gt;Description : CPU usage in MHz over the collected interval. For hosts this can be represented on a per Virtual Machine&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basis as a stacked graph&lt;br&gt;Entity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : VMware.VimAutomation.Client20.VMHostImpl  &lt;p&gt;mem.usage.average&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/26/2007 2:05:4...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21.48 %  &lt;p&gt;Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 105&lt;br&gt;Timestamp&amp;nbsp;&amp;nbsp; : 11/26/2007 2:05:40 PM&lt;br&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp; : disk.usage.average&lt;br&gt;Unit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : KBps&lt;br&gt;Description : Aggregated storage performance statistics. For hosts this can be represented on a per Virtual Machine bas&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is as a stacked graph&lt;br&gt;Entity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : VMware.VimAutomation.Client20.VMHostImpl &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;And finally,&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;$stats = Get-Stat $esx -common -maxsamples 1 -realtime&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;$stats. GetType()&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;IsPublic IsSerial Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BaseType&lt;br&gt;-------- -------- ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --------&lt;br&gt;True&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; True&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Object[]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Array &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;Since the object returned to you is an array,this allows you to store and manipulate the return results - like&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;$stats[2]&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;MetricId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value Unit&lt;br&gt;---------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----- ----&lt;br&gt;mem.usage.average&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/26/2007 2:07:0...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21.48 %&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;&lt;font color="#0000ff"&gt;or $stats[2].Value&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;21.48&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;em&gt;These values can then be piped into a table or graph to display the results.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Next week, I want to go back to something basic in Powershell - XML configuration. Powershell makes parsing XML documents very easy and I want to show how you can use this to create XML configuration files.&lt;/p&gt;</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/11/vmware-very-cool-get-stat-command.html' title='VMware&amp;#39;s Very Cool Get-Stat Command'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=8677150168867840951' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/8677150168867840951'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/8677150168867840951'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-2115172269848295235</id><published>2007-11-21T15:06:00.001-08:00</published><updated>2007-11-21T15:06:57.589-08:00</updated><title type='text'>First post using Windows Live Writer</title><content type='html'>&lt;p&gt;This is a posting using Microsoft Live Writer which means this will be a short post.&lt;/p&gt; &lt;p&gt;Just want to say Happy Thanksgiving!!!!&lt;/p&gt; &lt;p&gt;Brian&lt;/p&gt; </content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/11/first-post-using-windows-live-writer.html' title='First post using Windows Live Writer'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=2115172269848295235' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/2115172269848295235'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/2115172269848295235'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-3859753814899934719</id><published>2007-11-14T09:04:00.000-08:00</published><updated>2007-11-14T09:24:01.437-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware powershell'/><title type='text'>Creating a VM from a Template using Powershell</title><content type='html'>Yesterday, I posted that I was having issues creating a new VM from a template while using VMware's Powershell commands.  It must have been the weather or something because today, it seems to be working without any issues.   The following is how you can create a new VM from a template using Powershell. I did notice one interesting thing that I want to ask VMware about which I will mention at the end of this entry.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\Temp&gt; $vc = Get-VIServer "vc.example.com"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;There were one or more problems with the server certificate:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;* The certificate's CN name does not match the passed value.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\Temp&gt; $t = Get-Template -Server $vc&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\Temp&gt; $t[0]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Name                 Id&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;----                 --&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;ESX3-WIN2K3SP2-ST... VirtualMachine-vm-23637&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\Temp&gt; $esx = Get-VMHost -Name "esx1.example.com"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\Temp&gt; $esx&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Name                 Id&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;----                 --&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;esx1.example.com   HostSystem-host-7523&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PS C:\Temp&gt; New-VM -Host $esx -Template $t[0]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;cmdlet New-VM at command pipeline position 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Supply values for the following parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Name: vm-1&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;At this point, a  Powershell progress bar appears and the progress of the deployment can be tracked.  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The shell's focus is not returned until after the deployment is complete. &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The interesting thing is, that I can CTRL-C and cancel this Powershell command but the template continues to be deployed from within VirtualCenter.  I am not sure how VMware will handle this situation but I would expect the deployment to be canceled once I cancel the Powershell command. I would love to hear any one else's thoughts on this matter as well. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/11/creating-vm-from-template-using.html' title='Creating a VM from a Template using Powershell'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=3859753814899934719' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/3859753814899934719'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/3859753814899934719'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-2595099621527228826</id><published>2007-11-13T06:38:00.001-08:00</published><updated>2007-11-14T06:23:35.444-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware powershell'/><title type='text'>Creating a Virtual Machine with Powershell</title><content type='html'>Sorry for the delay in posting this week. I had out-of-town guests in all weekend so everything has been turned upside down.  I would like to continue from last week and show how easy it is to create a new virtual machine with Powershell. Again you'll need the VMware Powershell management Snap-in before you have access to these commands.&lt;br /&gt;&lt;br /&gt;To Create a Virtual Machine, you need to do the following:&lt;br /&gt;1. Connect to your Virtual Center server -&lt;br /&gt;&lt;ul&gt;&lt;li&gt;$vc = Get-VIServer -Server "vc.example.com"&lt;/li&gt;&lt;/ul&gt;2. Connect to the ESX Host where you want to create the VM -&lt;br /&gt;&lt;ul&gt;&lt;li&gt;$esx = Get-VMHost -Server $vc -Name "esx.example.com"&lt;/li&gt;&lt;/ul&gt;3.  Create the virtual machine -&lt;br /&gt;&lt;ul&gt;&lt;li&gt;$vm = New-VM $esx&lt;br /&gt;&lt;/li&gt;&lt;li&gt;This will create a VM with a 4GB hard drive and 256MB of RAM.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The network will be the first Network Label sorted alphabetically&lt;/li&gt;&lt;/ul&gt;4.  If you want, you can specify options while you are creating the VM or you can use the Set-VM to modify the VM's specifications.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Set-VM $vm -MemoryMB 2048 -NumCPU 4 -Network "Local Lan"&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Proceed with update of the following parameters of virtual machine with name 'blah'?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;New MemoryMB: 2048MB&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;New NumCPU: 4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;New Networks: LAN-1,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;I tried to create a new VM from a template with the following steps, but I continually got an error while doing so. I guess this just goes to show that VMware is still developing this code and it has some ways to go.&lt;br /&gt;&lt;br /&gt;1. Get all templates that VC knows about&lt;br /&gt;&lt;ul&gt;&lt;li&gt;$t = Get-Templates -Server $vc&lt;/li&gt;&lt;/ul&gt;2. Create new virtual machine from the first template&lt;br /&gt;&lt;ul&gt;&lt;li&gt;$vm = New-VM -Host $y -Template $t[0]&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;cmdlet New-VM at command pipeline position 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Supply values for the following parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Name: blah2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;New-VM : The operation for the entity vm-3179 failed with the following message: "A specified parameter was not correct&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;If someone could show me what I am doing wrong, that would be great.</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/11/creating-virtual-machine-with.html' title='Creating a Virtual Machine with Powershell'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=2595099621527228826' title='7 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/2595099621527228826'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/2595099621527228826'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-3254110789419905772</id><published>2007-11-05T20:53:00.000-08:00</published><updated>2007-11-14T06:24:16.220-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>PowerShell and VMware Managment</title><content type='html'>I know that I just blogged yesterday about sending emails with PowerShell, BASH, and VBScript, but I got a chance today to install VMware's PSSnapin for Powershell.  From the looks of this beta, its going to be a very powerful product that almost anyone can write scripts for.  What an example.&lt;br /&gt;&lt;br /&gt;I wrote a script in Perl using VMware's Perl SDK to display any VM Snapshot that a supplied VirtualCenter knows about. The code to do this in Perl is as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre  style="color: rgb(0, 0, 0);font-family:courier new;"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;use strict;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;use warnings;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;use Getopt::Long;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;use VMware::VIRuntime;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;use Term::ReadKey;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;my %opts = (server =&gt; undef,&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt; username =&gt; undef,&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;GetOptions (\%opts,&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;"server=s",&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt; "username=s");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;if( !defined ($opts{server} &amp;amp;&amp;amp; $opts{username}) ) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;   help();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;   exit (1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;ReadMode('noecho');&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;print "Enter $opts{username}\'s password: ";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;my $password = ReadLine(0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;chomp $password;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;ReadMode('normal');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;# login&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;my $url = "https://" . $opts{server}. "/sdk/vimService";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Vim::login(service_url =&gt; $url, user_name =&gt; $opts{username}, password =&gt; $password);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;# get VirtualMachine views for all powered on VM's&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;my $vm_views = Vim::find_entity_views(view_type =&gt; 'VirtualMachine');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;# snapshot each VM&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;my $i;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;foreach (@$vm_views) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt; if( defined $_-&gt;snapshot ) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  print "-------------------------------------------------------------\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  print $_-&gt;name . " has at least one snapshot defined  . . . \n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  foreach $i (0 .. $#{$_-&gt;snapshot-&gt;rootSnapshotList} ) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;     print "\t" . $_-&gt;snapshot-&gt;rootSnapshotList-&gt;[$i]-&gt;name . " @ " . $_-&gt;snapshot-&gt;rootSnapshotList-&gt;[$i]-&gt;createTime . "\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  print "-------------------------------------------------------------\n";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;# logout&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Vim::logout();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;sub help {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;   my $help_text = &lt;&lt;'END';  USAGE:    query_snapshot.pl --server &lt;/span&gt;&lt;virtual center=""&gt;&lt;span style="color: rgb(51, 102, 255);"&gt; --user &lt;/span&gt;&lt;user login=""&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;   query_snapshot.pl --server vc1 --user administrator&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;   print $help_text;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/user&gt;&lt;/virtual&gt;&lt;/pre&gt;&lt;br /&gt;Now using Powershell and the VMware Snapin:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255);font-family:courier new;" &gt; Add-PSSnapin VMware.VimAutomation.Core&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255);font-family:courier new;" &gt; Get-VIServer vc1.example.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255);font-family:courier new;" &gt; Get-VM | % { $_.Name; Get-Snapshots $_ }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That's it. Everything is provided for you like Authentication, handling XML returned by VirutalCenter's Web Services, etc . . . The Perl SDK is very powerful as well, but you have to do a lot more coding to get things done.  With the PowerShell snapin, the script is all of three lines. Now the snapin is only in beta testing right now so things can change in the future.</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/11/powershell-and-vmware-managment.html' title='PowerShell and VMware Managment'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=3254110789419905772' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/3254110789419905772'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/3254110789419905772'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-3480005991510750299</id><published>2007-11-04T20:00:00.000-08:00</published><updated>2007-11-08T20:54:55.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='email'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='vbscript'/><title type='text'>Sending email via a Script</title><content type='html'>One of the most basic tasks that any system administrator needs to accomplish while writing scripts is to send e-mail. Typically this is to send results of script itself or of some event.&lt;br /&gt;&lt;br /&gt;The easiest way to send email is if you are using Linux. Almost all Linux servers have the mail command installed by default. This command can be used by a BASH script to send your mail. The problem with the mail program is that it doesn't send attachments.   To send attachments, you'll need mutt.  Mutt can be installed via apt-get or yum or via tar balls, on all Linux systems.  To send an email via Mutt, you simply need to have the following line in your script&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;mutt -s $subject -c $ccpt_list -a $attachfile $rcpt_list &lt; $email  &lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;The variables defined include:&lt;br /&gt;1. A subject ($subject)&lt;br /&gt;2. A receipt list ($rcpt_list). This is defined in BASH as rcpt_list=someone@company.com.&lt;br /&gt;3. The body of the email is stored in the variable/file $email. $email is a file on the server that is piped into the Mutt command. It is defined as  email=/tmp/email.tmp echo Hello World &gt;&gt; $email&lt;br /&gt;4. OPTIONAL: An attach file. The variable $attachefile holds the path location of the file to attache&lt;br /&gt;5. OPTIONAL: An CC list of email address.&lt;br /&gt;--&lt;br /&gt;&lt;br /&gt;Over in the Microsoft world, there isn't a command line mail program built into any Windows server, but VBScript is. All that you need to send email via VBScript is the following:&lt;br /&gt;&lt;br /&gt;&lt;pre style="color: rgb(51, 102, 255);"&gt;Const SMTP_SERVER = "SMTP mail server address"&lt;br /&gt;Const SMTP_PORT = 25&lt;br /&gt;&lt;br /&gt;Set objMessage = CreateObject("CDO.Message")&lt;br /&gt;objMessage.Sender = sSender 'Email address of sender&lt;br /&gt;objMessage.To = sRecipients 'Comma separate list of people who will receive the email&lt;br /&gt;objMessage.Subject = sSubject 'The subject of the email&lt;br /&gt;objMessage.Textbody = sBody 'The body of the email.&lt;br /&gt;&lt;br /&gt;'This is optional.  sAttachment is the fully qualified path to the file to attach&lt;br /&gt;objMessage.AddAttachment sAttachment&lt;br /&gt;&lt;br /&gt;objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2&lt;br /&gt;objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTP_SERVER&lt;br /&gt;objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTP_PORT&lt;br /&gt;objMessage.Configuration.Fields.Update&lt;br /&gt;&lt;br /&gt;objMessage.send&lt;br /&gt;&lt;/pre&gt;---&lt;br /&gt;&lt;br /&gt;With Powershell just being released from Microsoft, you can write a function to send email and include that function in all scripts that need to send email. The function could look something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre style="color: rgb(51, 102, 255);"&gt;function send-email($s,$b,$to) {&lt;br /&gt;  $from = "send@company.com"; //Who will be sending the email&lt;br /&gt;  $domain  = "smtp.company.com"; //SMTP server to send the message&lt;br /&gt;&lt;br /&gt;  $mail = new-object System.Net.Mail.MailMessage;&lt;br /&gt;&lt;br /&gt;  for($i=0; $i -lt $to.Length; $i++) {&lt;br /&gt;     $mail.To.Add($to[$i]);&lt;br /&gt;  }&lt;br /&gt;  $mail.From = new-object System.Net.Mail.MailAddress($from);&lt;br /&gt;  $mail.Subject = $s;&lt;br /&gt;  $mail.Body = $b;&lt;br /&gt;&lt;br /&gt;  $smtp = new-object System.Net.Mail.SmtpClient($domain);&lt;br /&gt;  $smtp.Send($mail);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To call this function, you just need to do the following:&lt;br /&gt;&lt;br /&gt;&lt;pre style="color: rgb(51, 102, 255);"&gt;$SUBJECT="This is the subject";&lt;br /&gt;$EMAILADDR=@("person1@company.com","person2@company.com");&lt;br /&gt;$BODY="Hello World";&lt;br /&gt;send-email -s $SUBJECT -b $BODY -to $EMAILADDR&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Sending email is pretty easy and I know that there are  a lot of places on the Web that already so you how to send email. Hopefully, though we can build off this to build much more complex scripts.  I received an email from VMware concerning their Powershell interface to ESX. I am planning on next week to show how to write some simple scripts to manage an ESX build out with Powershell and we'll be using the send-email functions.&lt;br /&gt;&lt;br /&gt;Well this ends my first real blog post. I hope someone out there finds these scripts/functions useful and I will write more next week.</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/11/sending-email-via-script.html' title='Sending email via a Script'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=3480005991510750299' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/3480005991510750299'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/3480005991510750299'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry><entry><id>tag:blogger.com,1999:blog-3859053332094757531.post-7791067697237181122</id><published>2007-10-29T09:41:00.000-07:00</published><updated>2007-10-29T09:49:28.147-07:00</updated><title type='text'>First Post!</title><content type='html'>Hi. My name is Brian Denicola  and this is the first post for what I hope will be a weekly blog that focuses on scripting for system administrators.  I have working in the IT world for the past 10 years and have been automating tasks for most of them. This blog will focus on getting things done using any language available. But I'll mainly focus on Windows batch scripting, Bash scripting, VBscript, Perl, and Powershell. Every once in a while I might throw in a how to script for ASP.NET or SQL. I I won't be going into too much theory of the language, rather I hope to show how to get things done in Windows, Linux, or even VMware ESX. And I hope this will become a site where others can post how they do things as well.&lt;br /&gt;&lt;br /&gt;Well that is all for now. Next time I will be show you how to send e-mail via powershell. I'll start simple and go from there.</content><link rel='alternate' type='text/html' href='http://www.bjd145.org/2007/10/first-post.html' title='First Post!'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3859053332094757531&amp;postID=7791067697237181122' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.bjd145.org/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/7791067697237181122'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3859053332094757531/posts/default/7791067697237181122'/><author><name>Brian Denicola</name><uri>http://www.blogger.com/profile/08340580464424064808</uri><email>noreply@blogger.com</email></author></entry></feed>