I am sure we gonna see some great sessions about new features in System Center Virtual Machine Manager 2012 and other products.
Monthly Archives: April 2011
Hyper-V Hotfix for Intel Sandy Bridge and Westmere
If you are using Microsoft Hyper-V with new Intel Sandy Bridge or Intel Westmere processors and our server has over 48GB of physical RAM you may get a performance decrease. Microsoft released a hotfix (KB2517329) for this problem.
This could also be a problem with a lot of Hyper-V installations on Cisco UCS, because the most of them will use more than 48GB of memory.
The performance decrease could show its self in the the following issues:
- The CPU usage is high and the server responds slowly when you copy large files on the computer. For example, you copy a 10-GB file
- The disk I/O performance of the virtual machines (VMs) is slow
- Windows takes a long time to start
The hotfix is not include in Service Pack 1 for Hpyer-V R2 or Windows Server 2008 R2.
For more information about this you can check KB2517329
Powershell: Create a tempfile with Powershell

Sometimes you need to save some data in to a tempfile. And instead of creating a ownen file for this you could use the .NET function to create a really tempfile in the tempfile directory.
This is the how you can create a new tempfile:
$tempFile = [System.IO.Path]::GetTempFileName()
And now you can parse data into this file.
Profiles in System Center Virtual Machine Manager 2012
![]()
Michel Lüscher wrote a very interesting blog post about the new profiles in System Center Virtual Machine Manager 2012. SCVMM 2012 brings a lot of really cool new features especially for deployment of private and public clouds.
Here are some things I really like about SCVMM 2012:
- Host Profiles for Hyper-V Hosts. This is probably the most important and coolest new feature of SCVMM 2012. This lets you create Profiles for your Hyper-V Hosts (like in vSphere) but the best thing is the way you can deploy new hosts. Microsoft uses the Boot from VHD feature to setup new hosts. More on this here.
- The Hardware Profile lets you now add an IP addresses to network adapter in a VM
- Applications Profiles, select roles and features of Windows Server 2008 R2. For a very quick deploy of new services.
If you wanna read more about the profiles in SCVMM 2012 you should check out this blog post (german).
Powershell: Run MySQL Querys with Powershell

In our Hosting enviroment we are now using MS SQL Servers for our back-end. But there are still some MySQL Server left which store some data. Now since we do a lot of automation with Windows Powersehll I wrote a function to run MySQL querys with Powershell.
First you have to install the MySQL .NET Connector or just copy the MySql.Data.dll from the MySQL.
You can now load this:
With DLL File:
[void][system.reflection.Assembly]::LoadFrom("C:\myscript\MySQL.Data.dll")
or if you have installed the MySQL .NET Connector:
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")
Now basiclly this function does everything for you:
Function Run-MySQLQuery {
<#
.SYNOPSIS
run-MySQLQuery
.DESCRIPTION
By default, this script will:
- Will open a MySQL Connection
- Will Send a Command to a MySQL Server
- Will close the MySQL Connection
This function uses the MySQL .NET Connector or MySQL.Data.dll file
.PARAMETER ConnectionString
Adds the MySQL Connection String for the specific MySQL Server
.PARAMETER Query
The MySQL Query which should be send to the MySQL Server
.EXAMPLE
C:\PS> run-MySQLQuery -ConnectionString "Server=localhost;Uid=root;Pwd=p@ssword;database=project;" -Query "SELECT * FROM firsttest"
Description
-----------
This command run the MySQL Query "SELECT * FROM firsttest"
to the MySQL Server "localhost" with the Credentials User: Root and password: p@ssword and selects the database project
.EXAMPLE
C:\PS> run-MySQLQuery -ConnectionString "Server=localhost;Uid=root;Pwd=p@ssword;database=project;" -Query "UPDATE firsttest SET firstname='Thomas' WHERE Firstname like 'PAUL'"
Description
-----------
This command run the MySQL Query "UPDATE project.firsttest SET firstname='Thomas' WHERE Firstname like 'PAUL'"
to the MySQL Server "localhost" with the Credentials User: Root and password: p@ssword
.EXAMPLE
C:\PS> run-MySQLQuery -ConnectionString "Server=localhost;Uid=root;Pwd=p@ssword;" -Query "UPDATE project.firsttest SET firstname='Thomas' WHERE Firstname like 'PAUL'"
Description
-----------
This command run the MySQL Query "UPDATE project.firsttest SET firstname='Thomas' WHERE Firstname like 'PAUL'"
to the MySQL Server "localhost" with the Credentials User: Root and password: p@ssword and selects the database project
#>
Param(
[Parameter(
Mandatory = $true,
ParameterSetName = '',
ValueFromPipeline = $true)]
[string]$query,
[Parameter(
Mandatory = $true,
ParameterSetName = '',
ValueFromPipeline = $true)]
[string]$connectionString
)
Begin {
Write-Verbose "Starting Begin Section"
}
Process {
Write-Verbose "Starting Process Section"
try {
# load MySQL driver and create connection
Write-Verbose "Create Database Connection"
# You could also could use a direct Link to the DLL File
# $mySQLDataDLL = "C:\scripts\mysql\MySQL.Data.dll"
# [void][system.reflection.Assembly]::LoadFrom($mySQLDataDLL)
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")
$connection = New-Object MySql.Data.MySqlClient.MySqlConnection
$connection.ConnectionString = $ConnectionString
Write-Verbose "Open Database Connection"
$connection.Open()
# Run MySQL Querys
Write-Verbose "Run MySQL Querys"
$command = New-Object MySql.Data.MySqlClient.MySqlCommand($query, $connection)
$dataAdapter = New-Object MySql.Data.MySqlClient.MySqlDataAdapter($command)
$dataSet = New-Object System.Data.DataSet
$recordCount = $dataAdapter.Fill($dataSet, "data")
$dataSet.Tables["data"] | Format-Table
}
catch {
Write-Host "Could not run MySQL Query" $Error[0]
}
Finally {
Write-Verbose "Close Connection"
$connection.Close()
}
}
End {
Write-Verbose "Starting End Section"
}
}
You can use this Powershell function like this:
run-MySQLQuery -ConnectionString "Server=localhost;Uid=root;Pwd=p@ssword;database=project;" -Query "SELECT * FROM firsttest"
If you wanna run more than one command you could do something like this:
$connString = "Server=localhost;Uid=root;Pwd=p@ssword;database=project;"
[array]$sQLDings += "SELECT * from project.firsttest"
[array]$sQLDings += "UPDATE project.firsttest SET firstname='Thomas' WHERE Firstname like 'Paul'"
[array]$sQLDings += "SELECT * from project.firsttest"
foreach($sQLquery in $SQLDings) {
run-MySQLQuery -connectionString $connString -query $sQLquery
}
If you need more information about Powershell and MySQL Mark Alexander Bain wrote a blog post about this.
And if you need a local MySQL Server on your machine to test this, you could use Microsoft Platform Installer to install MySQL and other cool Webtools.
Microsoft WebMatrix and Microsoft WebPlatform Installer
For a project at KTSI we needed a platform to quick deploy PHP and MySQL applications. There are a lot of solutions out there in the web, for example XAMPP. After testing some options I had a closer look at the Microsoft WebPlatform Installer and Microsoft WebMatrix. Those two tools do exactly what I need. With the WebPlatform Installer you can easily install a local instance of IIS Express with ASP.NET, PHP, MSSQL and MySQL support with in 5-10 minutes.
But the coolest tool in my opinion is WebMatrix. Webmatrix lets developers create, manage and deploy Web Applications very very easy. And if you need to to more Webmatrix lets you also work with Visual Studio on the same project.
IE9 on Windows Phone 7: fast!

Microsoft showed a preview for the next big Windows Phone 7 update called “Mango”. The new upgdate brings Internet Explorer 9 to your mobile phone. Impressive fast!
More information on the coming Windows Phone 7 update can you get here.










