Virtually Sober

If there is free booze and Virtualization; I'm there!

Tag Archives: SQL

Creating a vSphere Change Management DB for free – Step 1 of 4

In my last blog post I gave an introduction to Working with SQL Databases using PowerShell. What I’d now like to do is share an example of a cool use case for combining PowerShell, SQL and PowerCLI.

After drinking a few beers (this blog is called virtually sober for a reason!) I started to think about different problems that I could solve by logging information into a SQL database. What info could I pull and store that would be useful to a virtualization admin? Then the answer hit me. Every setting in the vCenter from VMs to port groups, clusters, hosts to datastores! Why? Because the vCenter database only stores the latest setting.

Read more of this post

Working with SQL databases using PowerShell

One of the things I love about PowerShell is the sheer number of use cases you can address. A perfect example is working with SQL databases. If you think you need to wait for a DBA to give you data from a SQL database then you’d be wrong. You can use SELECT queries to pull data directly into PowerShell from any SQL database and not only that, you can also INSERT, UPDATE, DELETE or whatever else you desire, all from the comfort your scripts using invoke-sqlcmd in the Sqlserver PowerShell module. This also means you can now store data from your PowerShell scripts in SQL for long-term reporting, configuration management, you name it.

SQLServerBrowser

Read more of this post