Microsoft Evangelist Blain’s Barton–IT Time Radio…

Yes, East Coast Sr. IT Pro Microsoft Evangelists Blain Barton and John Baker, will be hosting every Friday around noon and IT Radio show.  So, Tuned In, Listen, and participate with these two great speakers.

image

For more information click the following link: http://blogs.technet.com/b/blainbar/archive/2011/02/21/it-time-radio-launches-every-friday-stay-tuned-with-blain-barton-and-john-baker-on-it-topics.aspx

Convert your SQL PS variable results to XML… it’s easy!!

Here’s some PowerShell code use to create a PS variable results from a T-SQL query using the SQL  Server 2008 (or higher) SQLPS command “Invoke-SQLCmd”:

Import-Module SQLPSV2

$SQL1 = @”
Select * from SurfSpotTable
“@

$SQL1Query = Invoke-Sqlcmd -Server ‘MAX-PCWIN1’ -Database ‘Developer’ $SQL1Query

As you can see, with a few lines of code we got back some table information:

 

$SQL1Query

SpotID     SpotName            Location                      State
——       ——–                      ——–                            —–
     1          Wildernes               Aguadilla                     PR
     2         Aviones                   Carolina                       PR
     3         Surfers Beach        Aguadilla                     PR
     4         Jobos                        Isabela                         PR

There’s a couple of things to understand about this code:

1. You need to download either Chad’s Miller SQLPS module for SQL Server 2008 or my SQL Denali SQLPSv2 module version.

2. Need to use the Import-Module to load the SQL Server snapins.

3. Invoke-SQLCmd is using Windows Authentication to connect to the database.

Now, that we have our PS variable “$SQL1Query” then we use the Export-Clixml to export the information to a XML formatted file:

## Convert to XML
$SQL1Query | Export-Clixml -Path createxml.xml -NoClobber -Encoding ASCII

ii createxml.xml

Then, use an XML Editor such as SAPIEN Technologies PrimalXML 2009 to open the file and see the information.  The XML file will look like this:

<Objs Version=”1.1.0.1″ xmlns=”http://schemas.microsoft.com/powershell/2004/04″>
  <Obj RefId=”0″>
    <TN RefId=”0″>
      <T>System.Data.DataRow</T>
      <T>System.Object</T>
    </TN>
    <ToString>System.Data.DataRow</ToString>
    <Props>
      <I64 N=”SpotID”>1</I64>
      <S N=”SpotName”>Wildernes</S>
      <S N=”Location”>Aguadilla</S>
      <S N=”State”>PR</S>
    </Props>
  </Obj>
  <Obj RefId=”1″>
    <TNRef RefId=”0″ />
    <ToString>System.Data.DataRow</ToString>
    <Props>
      <I64 N=”SpotID”>2</I64>
      <S N=”SpotName”>Aviones</S>
      <S N=”Location”>Carolina</S>
      <S N=”State”>PR</S>
    </Props>
  </Obj>
  <Obj RefId=”2″>
    <TNRef RefId=”0″ />
    <ToString>System.Data.DataRow</ToString>
    <Props>
      <I64 N=”SpotID”>3</I64>
      <S N=”SpotName”>Surfers Beach</S>
      <S N=”Location”>Aguadilla</S>
      <S N=”State”>PR</S>
    </Props>
  </Obj>
  <Obj RefId=”3″>
    <TNRef RefId=”0″ />
    <ToString>System.Data.DataRow</ToString>
    <Props>
      <I64 N=”SpotID”>4</I64>
      <S N=”SpotName”>Jobos</S>
      <S N=”Location”>Isabela</S>
      <S N=”State”>PR</S>
    </Props>
  </Obj>
</Objs>

So, with a few lines of code we just produce an XML file from a SQL DataRow results.  You be the judge… but I think this is another example of PowerShell Awesomeness!!

.. I’m Just Saying!!

Stay tuned!! I will have more on PowerShell, SQL, and XML files soon.

PrimalSQL and PrimalForms 2011, a perfect couple…

Here’s a quick overview of both PrimalSQL and PrimalForms 2011 working together.  These products gives you the ability to create GUI PowerShell scripts on the fly so you cut down you scripting time.

PrimalSQL2011

PrimalForms2011

I am test driving the upcoming new SAPIEN Technologies PrimalSQL 2011, and especially the new option to either “Generate Query Form…”, or “Generate Query PowerShell Script…”.   The best is the ability the generate a basic query form that you can change using the new upcoming PrimalForms 2011.  Both products are looking very solid with few bugs, and it’s still not in Beta yet!  It’s impressive.

Here’s both products working together:

PrimalSQLFORMS2011

Stay tuned for more information about this new product releases! 

Checkout more on exporting to a PowerShell script on SAPIEN Technologies blog: http://blog.sapien.com/index.php/2011/01/11/feature-peek-2011-primalsql-exporting-powershell-guis/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SapienBlog+%28SAPIEN+Technologies+Blog%29

Florida’s first ITCampSaturday 2011 Open for Speakers…

OK!  Calling all Florida West and Central Coast IT professionals.  The first Florida ITCampSaturday is coming to Tampa, Florida on Saturday March 19th.  It’s an all day free event you don’t want to miss.

Topics can be anything applicable to SysAdmins or IT Pros including: SharePoint, System Center, SQL Server, PowerShell, Active Directory, or Windows 2008 R2 and Windows 7.

Call for Speakers is Open Now…  Here’s the link to register your session(s): http://itcampsaturday.com/tampa/2011/01/13/call-for-speakers-open/

Don’t be left out!  Register now at: http://itcampsaturday.com/tampa/

Have fun and learn more!