The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

Nice to Know – Yes, it is possible to copy items between to Task Sequences as well as copy items between 2 different deployment shares

Posted by Mikael Nystrom on November 11, 2014

This is NOT a new feature, I cant even remember how long this has been working, but this morning I saw a Tweet when someone was happy about the possibility to copy items between deployment shares in MDT, so for thoose that knows all this, you do not need to read more, for the rest of you.

Yes, you can copy items between Task Sequences

(it also works copy items within a Task Sequence)

This works in both MDT as well as in ConfigMgr.

image

image

image

Yes, you can copy items between Deployment Shares (Only for MDT, Lite Touch)

In this case I have 3 deployment shares in the Deployment Workbench and it is possible to copy all kind of items between these 3 deployment shares

image

Let us copy some application from one deployment share to another.

Select Application, right click and select Copy.

image

Browse to new location, right-click, select Paste.

image

The application has been copied to the new deployment share.

image

/mike

Posted in ConfigMgr, Lite Touch, MDT, OSD, Zero Touch | Tagged: , , , , , , | 2 Comments »

OSD – Using PowerShell Commands in UserExit VB script to extend the ZTIGather process during OSD

Posted by Mikael Nystrom on November 11, 2014

During todays session I realized that I have done a lot of OSD stuff, but never published it (shame on me), so time to work. First up is how to run PowerShell CommandLets inside a UserExit script. A UserExit script is an extension to the ZTIGather process, giving you the opportunity to extend the gather process with information that the Gather process does not cover. That has been possible for a long time, but VBscript is not really the easiest script language in the world, so I asked my self if it would be possible to use PowerShell inside the VBscript and of course it is!

The idea

The basic idea is to run the UserExit script from customsettings.ini as usual and then do a jump out into PowerShell, execute the PowerShell CMDLets, terminate and return the value into the VBscript, which then will be a value connected to a Custom Property in the gather process, which then can be consumed by customsettings.ini and/or the task sequence. you can download everything from here: http://1drv.ms/1u41Yj2

How-To

The Boot Image

The boot image must have support for PowerShell and you can get that by adding .NET and PowerShell

image
Lite Touch.

image
Zero Touch.

The Customsettings.ini file

The customsettings.ini file will direct ZTIGather to process the section called UserExits, which will execute the UserExit.vbs script, call the function called RunningPSCommand and return the value from that function into the property called PSCommand.

image
This is a sample of how the customsettings.ini file should look like to call the UserExit script.

The UserExit Script that runs PowerShell commands

The script is rather simple, basically the PowerShell command is a string, executed by PowerShell.exe and using Executor.StdIn.Close to close the window and then using Executor.StdOut.ReadAll to grab whatever you have in the window and put that in the RunningPSCommand, which then is returned back to the ZTIGather process as a value for the Property RunningPSCommand.

image

The result of running the ZTIGather

image

As you can see the PowerShell command was running and returned the value “Virtual Machine” and now the Property PSCommand is equal to Virtual Machine and can be used elsewhere in CustomSettings.ini or in the Task Sequence

/mike

Posted in ConfigMgr, Lite Touch, MDT, OSD, Zero Touch | Tagged: , , , , | 2 Comments »

OSD – Static IP Address does not work in Lite Touch using Offline Media

Posted by Mikael Nystrom on November 7, 2014

During a project Johan and was working a while ago, we used Offline Media and we had a problem to set a static IP Address during OSD. After digging Johan found the issue and here is the solution.

http://www.deploymentresearch.com/Research/tabid/62/EntryId/184/Fix-for-MDT-2013-offline-media-deployment-bug-Static-IP-addressing.aspx

image

/mike

Posted in MDT, OSD | Tagged: , , , | Leave a Comment »

Nice to Know – Improve Bare Metal Deployment success rate in System Center Virtual Machine Manager

Posted by Mikael Nystrom on November 5, 2014

Bare Metal Deployment in SCVMM is a bit different compared to everything else, since it is using a push method. So instead of having some kind of client application controlling the deployment, the SCVMM server is controlling the OS Deployment. There could be issues, since SCVMM is building team and switches and there is a chance that SCVMM will loose connectivity to the host and the Bare Metal Deployment stops. In many case that is related to DNS and DNS cache, since that is the method used to be able to connect to the host during deployment. By decreasing the DNS cache timeout on the SCVMM server the success rate will improve very, very much.

How to fix it?

Logon to your SCVMM server and execute the following PowerShell commands to set the DNS Cache to a minimum and restart the DNS Cache services

New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name "MaxCacheTtl" -Value 5 -PropertyType "DWORD" -Force
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" -Name "MaxNegativeCacheTtl" -Value 5 -PropertyType "DWORD" -Force
Restart-Service -Name Dnscache -Force -Verbose

/mike

Posted in Hyper-V, OS Deployment, SCVMM | Tagged: , , , | Leave a Comment »

PowerShell is King – Testing OS Deployment Web Services using PowerShell

Posted by Mikael Nystrom on November 2, 2014

Recently I was setting up Maik Kosters OS Deployment Web Services for a customer and I need to test them, sure, you can do that interactively directly by running them, but I wanted the “PowerShell” way to do it.

You can get the Web Services from Maik Koster here: http://mdtcustomizations.codeplex.com/documentation?referringTitle=Home

Testing a Web Services the Non PowerShell Way.

image
Browsing to the Web Services

image
Select the DoesComputerExists

image
Type in a value and Invoke.

Testing a Web Services the PowerShell Way.

Since PowerShell has the function built-in it is very much a no-brainer.

To connect and get all members from the Web Services execute this:

$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL
$ADWebS | Get-Member -Type Method

That will give you something like this back

image

To connect and get one member with some detail execute this:

$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL
$ADWebS | Get-Member -Name DoesComputerExist -Type Method | Format-List

That will give you something like this back

image

So, to test the DoesComputerExists with a value you can now execute the following:

$CompuerNameToTest = "MDT01"
$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL
$ComputerExistsInAd = $ADWebS.DoesComputerExist("$CompuerNameToTest")

Write-Host "The Computer $CompuerNameToTest exists in Active Directory: $ComputerExistsInAd"

So if the Computer Exists in Active Directory you should get something like this back

image

/mike

Posted in Lite Touch, MDT, OS Deployment, Zero Touch | Tagged: , , , , , , | Leave a Comment »

TechEd EU 2014 – WIN-B314

Posted by Mikael Nystrom on November 2, 2014

During the session I did demo some scripts and here they are:

Script to configure the Build LAB Deployment share:

Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
New-PSDrive -Name "DS001" -PSProvider MDTProvider -Root "E:\MDTBuildLab"

#Set permisions correct
net share E:\MDTBuildLab '/grant:EVERYONE,change'
icacls E:\MDTBuildLab\Captures /grant '"MDT_BA":(OI)(CI)(M)'
icacls E:\MDTBuildLab\Logs /grant '"MDT_BA":(OI)(CI)(M)'

#Create the folder structure
new-item -path "DS001:\Applications" -enable "True" -Name "Install" -Comments "" -ItemType "folder" -Verbose
new-item -path "DS001:\Applications" -enable "True" -Name "Action" -Comments "" -ItemType "folder" -Verbose
new-item -path "DS001:\Operating Systems" -enable "True" -Name "Windows 8.1 x64" -Comments "" -ItemType "folder" -Verbose
new-item -path "DS001:\Task Sequences" -enable "True" -Name "Ref" -Comments "" -ItemType "folder" -Verbose

#Import the OS
import-mdtoperatingsystem ´
-path "DS001:\Operating Systems\Windows 8.1 x64" ´
-SourcePath "G:\Raw\Windows 8.1 x64" ´
-DestinationFolder "W81X64-001" ´
-Verbose

#Create the Task Sequence
import-mdttasksequence ´
-path "DS001:\Task Sequences\Ref" ´
-Name "Ref Windows 8.1 x64 Enterprise" ´
-Template "Client.xml" -Comments "" ´
-ID "RW81X64" -Version "1.0" ´
-OperatingSystemPath "DS001:\Operating Systems\Windows 8.1 x64\Windows 8.1 Enterprise in W81X64-001 install.wim" ´
-FullName "ViaMonstra" ´
-OrgName "ViaMonstra" ´
-HomePage "about:blank" ´
-Verbose

Set-ItemProperty -Path DS001: -Name Boot.x86.LiteTouchWIMDescription -Value 'MDT Build Lab x86'
Set-ItemProperty -Path DS001: -Name Boot.x86.LiteTouchISOName -Value 'MDT Build Lab x86.iso'
Set-ItemProperty -Path DS001: -Name Boot.x64.LiteTouchWIMDescription -Value 'MDT Build Lab x64'
Set-ItemProperty -Path DS001: -Name Boot.x64.LiteTouchISOName -Value 'MDT Build Lab x64.iso'
Set-ItemProperty -Path DS001: -Name SupportX86 -Value 'False'

Script to bulk import applications

http://deploymentbunny.com/2014/09/03/powershell-is-king-bulk-import-applications-i-mdt/

Wrapper for C++

http://deploymentbunny.com/2014/09/25/nice-to-havevb-script-wrapper-for-all-vc-installers-to-be-used-in-mdt/

Script to download all C++

http://deploymentbunny.com/2014/08/05/powershell-is-king-download-all-vc-runtimes-using-a-script/

Sample Custom Settings.ini

http://deploymentbunny.com/?s=customsettings.ini

/m

Posted in Session, TechEd | Tagged: , | Leave a Comment »

TechDays Sweden 19-20/11 – Den nya generationens datacenter

Posted by Mikael Nystrom on October 16, 2014

(in Swedish)

Den 18 november, d.v.s. en dag INNAN TechDays öppnar portarna för årets Microsoft konferens I Sverige kommer jag och Markus Lassfolk att köra en hel dag kring frågan hur man bygger datacenter numera. Design kommer i huvudsak röra det som kallas converged och innehållet för dagen kommer att handla om

Hyper-V, design, best pratices, nätverk, VMQ, RSS, RDMA, CPU, Minne, IOPS, Storage Spaces, Scale-Out Files server, NVGRE networks, Gateway och mycket, mycket mer. Ska du bygga, håller du på att bygga, ska du kasta ut VMware och vill veta från oss som gör det på löpande band. Kom…

 

image

Posted in Session, TechDays | Tagged: , | Leave a Comment »

Nice to Know–Microsoft Virtual Machine Converter 3.0 released to web

Posted by Mikael Nystrom on October 13, 2014

image

Now with P2V, yes!

New Features in MVMC 3.0
The 3.0 release of MVMC adds the ability to convert a physical computer running Windows Server 2008 or above server operating systems or Windows Vista or above client operating systems to a virtual machine running on Hyper-V host.

Standard stuff is:

  • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Microsoft Azure.
  • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
    Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
  • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
  • Supports conversion of offline virtual machines.
  • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
  • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion.
  • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts on any of the following operating systems:
  • Windows Server® 2012 R2
  • Windows Server® 2012
  • Windows Server 2008 R2 SP1
  • Converts VMware virtual machines, virtual disks, and configurations for memory, virtual processor, and other virtual computing resources from the source to Hyper-V.
  • Adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.0, and VMware vSphere 4.1 hosts to Hyper-V.
  • Has a wizard-driven GUI, which simplifies performing virtual machine conversions.
  • Uninstalls VMware Tools before online conversion (online only) to provide a clean way to migrate VMware-based virtual machines to Hyper-V.
    Important MVMC takes a snapshot of the virtual machine that you are converting before you uninstall VMware Tools, and then shuts down the source machine to preserve state during conversion. The virtual machine is restored to its previous state after the source disks that are attached to the virtual machine are successfully copied to the machine where the conversion process is run. At that point, the source machine in VMware can be turned on, if required.
    Important MVMC does not uninstall VMware Tools in an offline conversion. Instead, it disables VMware services, drivers, and programs only for Windows Server guest operating systems. For file conversions with Linux guest operating systems, VMware Tools are not disabled or uninstalled. We highly recommend that you manually uninstall VMware Tools when you convert an offline virtual machine.
  • Supports Windows Server and Linux guest operating system conversion. For more details, see the section “Supported Configurations for Virtual Machine Conversion” in this guide.
  • Includes Windows PowerShell capability for offline conversions of VMware-based virtual hard disks (VMDK) to a Hyper-V–based virtual hard disk file format (.vhd file).
    Note The offline disk conversion does not include driver fixes.

Posted in Hyper-V, SCVMM | Tagged: , | 1 Comment »

Nice to Know–Deploying Windows Server Technical Preview on HP Proliant Microserver Gen 8

Posted by Mikael Nystrom on October 11, 2014

I use the HP Microserver Gen 8’s at home, since they are quiet and act as a full-grown server with full iLO support, dual network adapters and then some. I can basically do all kinds of testing with new operating systems and system center management platforms without upsetting my family to much and that is very practical.

During the deployment of Windows Server Technical Preview everything worked as expected. After the installation I added the Hyper-V role to start testing to deploy VM’s. I booted up the MDT Boot image, selected the Task Sequence and the install was working great, but hey, the network performance???

According to ImageX it will take 45 minutes to lay down the image! That cannot be correct, there is something wrong here. That kind of slow performance over the network just have to be an issue.. and it is…

You need to update the network driver for the built-in network adapters in HP Proliant Microserver Gen 8.

The built in driver is a Broadcom Nextreme driver and that does not work correctly with Hyper-V

Download the HP Ethernet 1 GB 2-port 332i Adapter driver from HP and install that instead, the 45 minutes is now just 5 minutes…

image

image

Happy Deployment.
/mike

Posted in Drivers, HP, Hyper-V, Windows Server vNext | Tagged: , , , | 2 Comments »

PowerShell is King – vNext Hyper-V gets support for Network Device Naming

Posted by Mikael Nystrom on October 4, 2014

And that my friends is GREAT. Basically that means you can create a a VM Network Adapter in Hyper-V while the VM is running (also a new feature), give it a name and enable Device Naming on the VM Network Adapter and then inside the VM find the Network Adapter using PowerShell and configure it without using the Mac Address as the identification.

Create the Network Adapter:

  • Create the NIC while the VM is running (just for the fun of it) using PowerShell
    • Add-VMNetworkAdapter -VMName SRV101 -SwitchName UplinkSwitch -Name MikesNIC01 -Verbose
  • Enable Device Naming
    • Set-VMNetworkAdapter -VMName SRV101 -Name MikesNIC01 -DeviceNaming On -Verbose
  • Verify Device Naming using PowerShell, or Settings, or directly in the Hyper-V Manager
    • Get-VMNetworkAdapter -VMName SRV101 | Format-List Name, DeviceNaming

image

Log in to the VM:

Using PowerShell you can now get the network adapter name in the VM with the name gave network adapter in the parent partition.

  • Get-NetAdapterAdvancedProperty -Name * | Where-Object -FilterScript {$_.DisplayValue -LIKE “Mike*”}

You can also see this as properties in the Network Adapter.

image

Summary:

This gives us an easier way to automate the creation/configuration of VMs when it comes to handing over a task from the host to a VM when building solutions.

/mike

Posted in Hyper-V, PowerShell, Windows Server vNext | Tagged: , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 4,172 other followers