The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…


    Mikael Nystrom

    Mikael Nystrom

    OS Deployment Geek, Virtualization and System Center

    Mikael Nystrom is a Microsoft MVP and Principal Architect at TrueSec

  • Archives

  • Meta

Archive for the ‘Virtual Machine Manager’ Category

Nice to Know – Clean up the ISO name mess I SCVMM so that Windows Azure Pack looks nice

Posted by Mikael Nystrom on February 5, 2015

In System Center Virtual Machine Manager there is a library. The library stores resources used in the environment and one kind of resources is ISO images. The problem is that names on those ISO images is slightly “technical” and not so user-friendly. So who cares?

The Issue:

When you start using Windows Azure Pack to provide self-service, that is a very good reason to have nice names here is two samples

In the first picture, all the names looks ok, in the second picture, it looks different…

The names of the these files comes from System Center Virtual Machine Manager and they are easy to change, just go in to the library, open each and everyone and change the name…

How to modify the name of the ISO resource in the SCVMMLibrary using the UI.

However, doing that for one or two files are ok, more then that, it kind of gets boring after a while.

The Solution:

So, you can export all the information in to a CSV file, modify the CSV file to suit your organization and then import it again.

Export CD/DVD meta data from SCVMM using PowerShell

Get-SCISO -All -VMMServer “” | where HostType -EQ LibraryServer | Select LibraryServer,SharePath,Name,Description | ConvertTo-Csv -NoTypeInformation > “$env:TEMPISOInSCVMMLib.csv”

and that will give something like this:

A few of the ISO’s in the SCVMMLibrary.

So, open the file, modify name and description and run this

function Update-ISOForSCVMLib



$ISOToUpdate =  Get-SCISO -All | Where LibraryServer -EQ $LibraryServer | Where SharePath -EQ $SharePath
$ISOToUpdate | Set-SCISO -Description $Description -Name $Name

This will give you a new function and that new function can be used in the following way.

Import-Csv .\ISOInSCVMMLib.csv | foreach {Update-ISOForSCVMLib $_.LibraryServer -SharePath $_.SharePath -Name $_.Name -Description $_.Description}

The function is going trough the CSV file and search for the file, find the object and finally change the display name of the object.


Posted in SCVMM, System Center 2012 R2, Virtual Machine Manager | Leave a Comment »

Nice to Know–Bare metal deployment in SCVMM using Custom script and Custom resources could fail

Posted by Mikael Nystrom on May 4, 2014

The bare metal OS deployment function in SCVMM has the ability to be customized by adding custom scripts (also know as GCE). Basically there is two ways to do this, you either make sure the  script is in the WinPE image or you add it using recourses in the SCVMM Library. There are two locations for those scripts, Pre and Post and the problem seems to be true when we are doing Pre OSD GCE’s. So how do I know it fails then?, well that is not that hard. It will give you a very informative message in the job log like this:

Error (2941)
VMM is unable to complete the request. The connection to the agent on machine has been lost.
Unknown error (0x80072efe)

Recommended Action
Ensure that the WS-Management service and the agent are installed and running and that a firewall is not blocking HTTPS traffic.


And if you open the vmmAgentPE.exe.log file on the host you are deploying you will se this:

058C.05C4::05/04-12:23:13.425#00:OSDDownloadFileFromUrl.cpp(88)[000000000306EB: ThrowOnWin32Failure : 80072efe. Operation attempted WinHttpReceiveResponse(m_hRequest, NULL)
058C.05C4::05/04-12:23:13.425#00:exceptions.cpp(97)[000000000306EB: CarmineException::CarmineException: CarmineError: 1051488,  hr: 0x80072efe

If you look at the last file it tries to download you will see that it is trying to download the file and if you check the size of the file you will se that the size is 0 bytes and “carmine” does not like to transfer 0 size files in WinPE.


Modify the in notepad.exe and type whatever you like, close it, done. If you try once more it should work.


Posted in Deployment, SCVMM, System Center Virtual Machine Manager, System Center Virtual Machine Manager 2012, Virtual Machine Manager | Tagged: | Leave a Comment »

Nice to Know–Deploying Applications using System Center Virtual Machine Manager 2012 (SP1/R2) in UI or in PowerShell

Posted by Mikael Nystrom on August 21, 2013

Yes, I know, there other methods to deploy applications, but sometimes it make sense to use SCVMM to deploy applications to the host machines that you manage. If we look on this from a new and more modern way, SCVMM will be the System Center member that does the deployment of the “only” needed physical machines, that is the Hyper-V hosts and the fileservers used to store the VHDx files over the the SMB network, maybe there is no Configuration Manager Server in this datacenter for any reason.

The App = HP Service Pack

In this case we are going to deploy the HP Service Pack to our hosts since we need that to be able to monitor correctly using OpsMgr (When using an Agent) amongst many things. The Application can be “pushed” from a central location but in this case we are going to run the application locally on each and every server and reboot it if needed. The Command to make a silent express install is HPSUM.exe /express_install and you download the Service Pack for the Proliant servers from ( After downloading the ISO, mount and extract and share the folder so it is accessible to all your hosts.

The GUI Method

Rater easy actually, we can use the “Run Script Command” that is available on every server in the SCVMM Console and then fill out all the parameters


Fill out the parameters like this:

-Executable program: \\vmm01\CD\hp\swpackages\hpsum.exe

-Parameters: /express_install

-Timeout: 1800


–Standard Output: Do not match

–Standard error: Do not match

–Exit Code: Do not Match

–Action when matched: Warn and Continue

–Job restart action: Ignore Script

–Always restart after the script has finished running: Checked

–Restart the computer or virtual machines if the specified exit code is returned: Unchecked


Summary using the UI:

This will work, but not they way I wanted it to, the problem is that I cannot define my own values in the dialg boxes, as an example the application HPSUM.exe will return exit code 1,2 or 3 when it needs a reboot and that cannot be “picked” in the dropdown list, however, using PowerShell well be easier, better and faster since you can define all the applications in an XML file wit all the different settings. so lets drop the UI and switch over to what works and make sense, PowerShell :-)

The PowerShell Method

In this case we will use the same engine, but fire it of using PowerShell instead, it gives us more flexibility and more control

Step Number One – Create the Apps.XML

Here we create an XML file that contain all the settings for all the different application we would like to deploy and here it how it looks:


as you can see it contains the application, arguments, reboot settings and all the return codes this application could return when it “feels” that it needs a reboot

Step Number Two – Create the Deploy-Apps.ps1 script

The script uses the Parameter function to read in data from the command line and then it reads the XML file, we also need to make sure that some of the data from the XML file is parsed correctly as strings or as Boolean. Then we use all that data set some static settings and last we use the Invoke-SCScriptCommand to execute the command on the host, the script looks like this:


Step Number Three – Execute!

Execute the script like this:


And wait for the job in the log and after a while it will inform you that the job did finish with warnings, the reason for the warning is that is actually a real warning from the application that is picked up up by the output :-)

The hpsum.exe detects the version of windows as 6.2 (and that is correct), but even if HP claims that is supported, the HPSUM.exe does not have the same opinion :-). Hopefully HP will fix this later.


So in the Job log it will show up like this:


Summary using PowerShell:

This gives a more stable solution which can be extended and automated and that I like…

You can download the scripts from here:

Posted in Deployment, PowerShell, SCVMM, System Center 2012, System Center 2012 R2, System Center Virtual Machine Manager 2012, Virtual Machine Manager | Tagged: , , | 4 Comments »

OS Deployment – Deploying Hyper-V hosts using System Center Virtual Machine Manager 2012 SP1 PowerShell Prompt – Part 1(2)

Posted by Mikael Nystrom on June 22, 2013

Working with OS deployment pretty much means that, I don’t really care if it is a client OS or a server OS, its still Windows from my perspective, there are small differences, but basically it is the same. One of the challenges you might have is to deploy Hyper-V host machines using System Center Virtual Machine Manager 2012 SP1 and with challenge I mean its is very opposite from MDT or SCCM, or even WDS since all of those belongs to “controlled my client/agent” but when it comes to SCVMM it is more of “controlled by SCVMM”. In this first part I will cover the Server Deployment, not the network configuration and reason is that I do this in a 2 –step process for many reasons, but the most obvious is:

  • If a customer would like to use any other method for the OS deployment part I can easily remove this part and replace it with the customer demands and still keep my script that does the network configuration easily
  • Using this method it pretty much work with any hardware in any configuration


Yes, there are some

  • You need to have a PXE environment and it cannot co-exists with Configuration Manager and it needs to be added to SCVMM
  • The server/compute/host needs to be configured to boot in PXE mode
  • The server needs to support IPMI or SMASH and you also need the password for that
  • SMBiosGuid mess: This is the bad and ugly, some vendors have ONE SMBiosGuid number when you ask IPMI and an other when the server boots and contacts WDS and therefore we need to know the “real” SMBiosGuid number (Easy, just boot the machine into PXE and check the WDS log


In the picture you can see the SMBiosGuid number that is used by the server when presenting it self to the PXE server, if that is correct it all works, otherwise we need to “cheat” just a bit and we do that by providing the real SMBiosGuid (can only be done using PowerShell)

The solution:

For this to work you need to have created the basic things in SCVVM, tings like logical network and such and now over to PowerShell :-) and here is how it looks:

Here is all the variables we use

  • $OSDComputername = “The name of the computer to be installed”
  • $BMCAddress “The IP address of the BMC”
  • $MGMMacAddress “The Mac Address that should be used as the management NIC”
  • $MGMIPAddress “The IP address the computer should have as the Management IP address”
  • $HOSTProfileName “The name of the Host Profile to be used”
  • $HostGroup “The host group in SCVMM to put it”
  • $IPv4Subnet “The subnet of the Management IP address”
  • $RunAsAccount “The IPMI RunAsAccount that has the correct permissions to perform IPMI operations”
Section 1 :

The Parameter section, this section is created so that you can either read all the information from an .csv file or provide it on command like like it was a CMDLet


Section 2 :

We have all data, now we just need to get the data from SCVMM so we can start deploying, we also add a DNS A record for the machine, now that should NOT be needed, but to increase the odds to success I have started to add it since I hate “almost”


Section 3:

Time to deploy


Section 4:

You also need the CSV file to put in all the data and here is an example


And the you need to kick of the deployment

Import-Csv SCVMMostDeploy.csv | Deploy-HostII.ps1


Download here

Posted in Deployment, SCVMM, System Center 2012, Virtual Machine Manager | Tagged: , | 3 Comments »

Sommarkollo 2013 – Hybrid Moln skapar förutsättningar för en elastisk infrastruktur

Posted by Mikael Nystrom on June 19, 2013

Under denna session kommer vi att visa hur du kan koppla ihop din egna lokala infrasctruture med Azure Virtual Machine för att på så sätt skapa möjligheten att enkelt kunna expandera vid formtoppar.

4/7 Anmäl dig till sessionen här >

22/8 Anmäl dig till sessionen här >

Posted in Azure, Hyper-V, SCVMM, System Center 2012, System Center 2012 R2, Virtual Machine Manager, Windows Server 2012, Windows Server 2012 R2 | Tagged: | Leave a Comment »

Sommarkollo 2013 – Djupdykning i Nätverk och Storage i System Center Virtual Machine Manager och Windows Server 2012 – en magisk upptäcksfärd

Posted by Mikael Nystrom on June 19, 2013

Det finns två saker i nya Windows Server 2012 som man måste förstå och som har en flexibilitet som få har förstått. I denna session rätar vi ut alla frågetecken när vi dyker ner i detaljerna kring Virtual Switches, Virtual Network Adapters, Q o S, SMB3, Storage Spaces, FibreChannel, ISCSI, Cluster Shared Volumes och självklart blir det mycket PowerShell då det mesta av detta endast kan konfigureras med hjälp av PowerShell.

Notera att dessa seminarium är kostnadsfria

2/7 Anmäl dig till sessionen här >

13/8 Anmäl dig till sessionen här >

Posted in SCVMM, System Center 2012, System Center 2012 R2, Virtual Machine Manager, Windows Server 2012, Windows Server 2012 R2 | Tagged: | Leave a Comment »

Service Providers, Hosters, SPLA partners in Sweden – It’s time for the gathering of the year!

Posted by Mikael Nystrom on April 26, 2013

Det är dags för årets stora turné! Jag kommer att åka till Malmö, Göteborg och Stockholm och köra ett en dags seminarie med fokus på hur man bygger en elastiskt och flexibel infrastruktur med självbetjäning och interna automatiserade funktioner. Hela lösningen baseras på System Center 2012 SP1 och Windows Server 2012. Med andra hur man bygger ett så kallat Partner Cloud! Vi kommer inte att visa samma sak som förra året, istället lägger mer fokus på att visa hur man automatiserar på ett ENKELT sätt å at man kan få mer tid över till sådant som faktiskt kräver det, samtidigt så får du lära dig hur man bygger detta så att det blir flexibelt, med lite tur kommer du knappt hitta till server hallen efter ett tag!

Då Microsoft står för hela kalaset så är priset för detta event extremt lågt, det är faktiskt helt gratis så jag tycker absolut att du ska komma!

Plats Datum Anmälan
Malmö 2013-05-06
Göteborg 2013-05-07
Stockholm 2013-05-13


Posted in Cloud, Hyper-V, SCVMM, System Center 2012, Virtual Machine Manager, Windows Server 2012 | 2 Comments »

Where to find all WinPE drivers for almost all HP Servers in one location?

Posted by Mikael Nystrom on October 24, 2012

As a part of my daily life I build deployment solutions for customers that supports both Server OS and for Client OS and one of the components need are drivers for WinPE. Normally not a problem on the client side, but for servers there are some things that could let you grow a bit more gray hair then needed.

32bit drivers for 64bit OS

Since I prefer to have only one single boot image I would like to have the 32 bit version since that handles both 32 and 64 bit OS images. There is no obvious way to find the 32 bit versions of the driver in the 64 bit edition of Windows Server webpage. When deploying using System Center 2012 Virtual Machine Manager you need the 64 bit drivers and you might want to use the HP Insight Control for System Center instead

Specialized WinPE drivers might be needed

Even if WinPE is a subset of Windows it should be able to use the normal drivers, but “should” is just a word. In many cases the dual bus architecture or other “inventions” might require monolithic drivers. Those drivers should not be used in the running OS, only in WinPE

The solution (if you have a HP Server)

HP have something called Scripting Toolkit and that just happens to contain all the drivers needed for storage and network for all ML/DL/BL HP ProLiant DL/ML/SL 300, 500, 700, 900 and HP ProLiant BL server series and HP ProLiant 100 G6 series and higher which basically covers “all” server from HP. The current version is 8.70 for x86 and can be downloaded and the x64bit version here

When you extract the archive into a folder it will look like this

Guess where the drivers are…

Getting the drivers in the correct location

For MDT 2012 Update 1

This is pretty straight forward. Open deployment workbench and add the drivers to the WinPEx86 folder (if you do not have one, you should create that)


Modify so that all drivers from that folder is imported into the boot image


For Windows Deployment Services for Windows Server 2012

Not that hard either, remember we only need these drivers for WinPE, not for the running OS so when we import them we need to flag them so that will never be installed, we just need to have them imported so that we can apply them to the WinPE image, it should look like this


For WinPE from ADK

The offline method:

Dism /Mount-WIM /WimFile:c:\winpe\winpe.wim /index:1 /MountDir:c:\winpe\mount\
Dism /image:c:\winpe\mount /Add-Driver /Driver:e:\drivers /Recurse
Dism /unmount-wim /Mountdir:c:\winpe\mount /commit

The online method:

drvload.exe <path>

For System Center 2012 Virtual Machine Manager:

Note: For System Center 2012 Virtual Machine Manager you can also download the HP Insight Control for System Center, that contains HP server drivers for network and storage, however, those are only 64 bit drivers. So for the SCVMM solution you can either download the scripting toolkit driver pack, but for SCVMM they need to be x64 bit drivers or you can download the HP Insight Control for System Center kit that is only x64 bit version. It will basically be the same driver, the HP Insight Control for System Center has one part that is rather nice, it has an installer that will install all the drivers and then tag them during the import so that you can use tags when injecting them into WinPE

If the drivers are imported into the SCVMM library and tagged method:

Use the following PowerShell command:

Import-Module "C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psModules\virtualmachinemanager\virtualmachinemanager.psd1"
Get-SCVMMServer localhost
$mountdir = "e:\mount"
$winpeimage = "e:\temp\boot.wim"
$winpeimagetemp = $winpeimage + ".tmp"
mkdir "e:\mount"
copy $winpeimage $winpeimagetemp
dism /mount-wim /wimfile:$winpeimagetemp /index:1 /mountdir:$mountdir
$drivers = get-scdriverpackage | where { $_.tags -match "WINPE" }
foreach ($driver in $drivers)
$path = $driver.sharepath
dism /image:$mountdir /add-driver /driver:$path
Dism /Unmount-Wim /MountDir:$mountdir /Commit
publish-scwindowspe -path $winpeimagetemp
del $winpeimagetemp

If the drivers are in folder and NOT imported into the SCVMM library:

Use the following PowerShell command:

Import-Module "C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psModules\virtualmachinemanager\virtualmachinemanager.psd1"
Get-SCVMMServer localhost
$mountdir = "e:\mount"
$winpeimage = "e:\temp\boot.wim"
$winpeimagetemp = $winpeimage + ".tmp"
mkdir "e:\mount"
copy $winpeimage $winpeimagetemp
dism /mount-wim /wimfile:$winpeimagetemp /index:1 /mountdir:$mountdir
$path = "e:\temp\drivers"
dism /image:$mountdir /add-driver /driver:$path /recourse
Dism /Unmount-Wim /MountDir:$mountdir /Commit
publish-scwindowspe -path $winpeimagetemp
del $winpeimagetemp


Posted in Deployment, MDT, SCVMM, System Center 2012, Virtual Machine Manager | Leave a Comment »


Get every new post delivered to your Inbox.

Join 4,572 other followers