The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • about.me

    Mikael Nystrom

    Mikael Nystrom

    OS Deployment Geek, Virtualization and System Center

    Mikael Nystrom is a Principal Architect at TrueSec

  • Archives

  • Meta

Archive for the ‘Lite Touch’ Category

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: , , , , , , | 3 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 »

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 »

Nice to Know–Presenting applications in the MDT Wizard based on location

Posted by Mikael Nystrom on July 8, 2014

A friend (You know how you are…) asked me today “I need to have different application bundles in the MDT Wizard based on location, any ideas?” and since I cant refuse to help a friend, here is a solution.

Use WizardSelectionProfile, Selection Profile and Default Gateway

So here is a step by step, kind of.

Configure CustomSettings.ini

You need to add DefaultGateway to the customsettings.ini to match your environment. So it should look something like this:

[Settings]
Priority=DefaultGateway

[DefaultGateway]
192.168.1.1=NewYork
192.168.2.1=Stockholm

[NewYork]
WizardSelectionProfile=Wizard – HQ

[Stockholm]
WizardSelectionProfile=Wizard – BO

Create the Application folder

In the Deployment Workbench, create a Application folder, where you can store the applications that should be available at the BO site, something like this.

image

Create your WizardSelectionProfile’s

In the Deployment Workbench, Advanced Settings, Selection Profiles – Create a Selection Profile called “Wizard – HQ”. It should contain everything that should be selectable at the HQ site. In this case the folder is not available at HQ.

image

In the Deployment Workbench, Advanced Settings, Selection Profiles – Create a Selection Profile called “Wizard – BO”. It should contain everything that should be selectable at the BO site. In this case all folders are available.

image

Test and verify.

That should be it, so the net result would be something like this:

Running the Wizard at the BO

Apps at the BO

and running at HQ will give you this.

Apps at the HQ

/Mike

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

Nice to Know–Combine multiple application for multiple OS versions into one Bundle

Posted by Mikael Nystrom on June 18, 2014

A customer asked me:

“Mike, I’m deploying Windows 7 and Windows 8.1 and in some cases there is different versions of applications for different versions of the OS, but I would like to use Mandatory Applications in customsettings.ini based that is tied to model?”

That is a scenario that is rather easy to fix, however it can be fix in many different ways. Scripting is one, rerunning the gather step and use conditions based on other way, using OSVersionNumber is another. It could also be the situation that you for a reason is running Windows 7 x86 and Windows 8.1 x64 as your two different operating system and therefor you have different applications, but you would like to be able to have only “one” application. That way you can still use rules to deploy the application or you would make it easier for the technician that performs the deployment of the client. But here is one other trick:

Using Bundles with conditions

Let us assume that you are deploying Windows 7 and Windows 8.1 to a certain hardware model and that hardware requires a certain software and that the software comes in two different versions then you can do the following:

  • Import the Windows 7 and Windows 8 application.

    image
    My two applications imported into Deployment Workbench.

  • Set the conditions for each application

    image
    Conditions for the Windows 7 x86 application.

    image
    Conditions for the Windows 8.1 x64 application.

  • Hide the Applications

    image
    The “Install – Software for Model X – Windows 8.1 x64” has been hidden, repeat for the Windows 7 x86 application.

  • Create a bundle application
  • Add the both applications as dependences.

    image
    Both applications have been added to the bundle.

If you install the bundle only one of the applications will be installed, since the dependences have conditions that does not overlap.

Using Customsettings.ini and MandatoryApplications to install each application for the correct operating system.

If you modify the rules in LiteTouch (customsettings.ini) you can now based on model use the bundle GUID instead of having to use two applications

image
Using MandatoryApplications001 with the GUID from the Bundle and installing it based on Model.

/mike

Posted in Deployment, Lite Touch, MDT | Tagged: | 2 Comments »

OSD–Using ZTISendMail to send email in a LTI/ZTI task sequence

Posted by Mikael Nystrom on June 13, 2014

Long time ago I had a need to send email an email in the end of the task sequence to notify the technician that the OS deployment was done, therefore creating a script which then ended up as a blog post at Deployment Research about two years ago. This week I’m running a Mastering Windows 7 and 8.1 OS Deployment using Lite Touch and Zero Touch in Minnesota and there where some requests on the subject so I decided to create a new version of the script and this time it is a PowerShell script instead. One of the request was to be able to send and email to the administrator that does the deployment (in Lite Touch) using the login name, so that need to to be taken under considerations to.

The script is tested in MDT 2013 but should work perfect in MDT 2012 Update 1 as well and it works when deploying Windows 8 and above.

Lite Touch

First you need to download the script and sample customsettings.ini  from here http://1drv.ms/1kvmobn and store the PowerShell it in the MDT Scripts folder.

Option Number One: Using the UserID directly

Update the CustomSettings like this. (you can copy and paste from the sample customsettings.ini files)

The name used to login to the LTI Wizard is defined as UserID and that is then used as a part of the email address to send it to.

image

Option Number Two: Using the UserID with translation.

In this case we create a section for every user account that should have an email an can logon. As an example, if you login as Administrator (don’t use that account!) an email would be sent to administartor@viamonstra.com, but you can have any other setting for that userID if you liketo.

Update the CustomSettings like this. (you can copy and paste from the sample customsettings.ini files)

image

Add a step in the TaskSequence.

image

Zero Touch

First you need to download the script and sample customsettings.ini  from here http://1drv.ms/1kvmobn and store the PowerShell it in the MDT Package Scripts folder.

In the ZTI we don’t really have a UserID and therefore we just send the email to a predefined email address and cc to an other.

Update the CustomSettings like this. (you can copy and paste from the sample customsettings.ini files)

image

Add a step in the Task Sequence like this.

image

Update the settings package and the MDT Package.

If you need a SMTP server to test against, read this http://deploymentbunny.com/2014/06/12/nice-to-knowa-simple-and-small-smtp-mailserver-fr-devlabtest-smtp4dev/

image

/mike

Posted in ConfigMgr, Deployment, Lite Touch, MDT, OS Deployment, OSD, SCCM, Zero Touch | Tagged: , , , , | 4 Comments »

Nice to Know – Switch from ImageX to DISM in MDT

Posted by Mikael Nystrom on May 19, 2014

Be default the capture process in MDT 2013 uses ImageX to capture the image, there is nothing wrong with that, well, it takes time since Imagex takes about 15 minutes or more just to scan the file system before it starts to capture the image and maybe you would like to get rid of that time. That is possible by doing some modification to one of the scripts in MDT so that it starts to use DISM.exe instead

The script that needs to be modified is ZTIBackup.wsf and you can download the updated version here. (Please make sure you have a copy of the previous version so that you can go back for any reason.)

(Important note: I have updated the script since I missed to include settings that will honor the wimscript.ini file, without that the image will not be cleanup from junk and therefore larger. So, if you did download the script and used it, download it once more, since it is now updated)

As a bonus this also fixes the problem to append the wim file to an existing wim file.

How-to?

  1. Download the file from here: http://1drv.ms/1gZICln
  2. Rename the Scripts\ZTIBackup.wsf to ZTIBackup.old
  3. Clear the Internet download flag from the new ZTIBackup.wsf.
  4. Copy the new ZTIBackup.wsf to the Scripts folder.

Done.

/mike

Posted in Deployment, Lite Touch, MDT | Tagged: | 32 Comments »

Deployment Roadshow 2013 in Sweden!

Posted by Mikael Nystrom on March 29, 2013

Inte första gången

och inte heller sista gången som vi gör detta, det är nämligen en av de få sakerna vi gör bara för att det är så grymt kul. Vi kommer att visa massor med olika saker kring OS Deployment och management. Du kan ta med dej kunskaperna hem och I praktiken använde det du har lärt dej direkt!. Mitt förslag är att du snabbt som attan anmäler dig här innan det är fullt. För du vill väl inte missa tillfället att ställa frågor och få svar, eller se praktiska runbooks, VDI demos, ConfigMgr 2012 SP1 prylar, nya snygga saker I AD:t, en portion PowerShell och annat smått och gott!

http://www.deploymentevents.se/

Var? När?
Göteborg 2013-04-22
Malmö 2013-04-23
Stockholm 2013-04-24
Umeå 2013-04-25

 

/mike

Posted in Deployment, Windows 7, RoadShow, MDT, Lite Touch, Windows 8, SCCM, Windows Server 2012, System Center 2012 | Tagged: , , , , , | Leave a Comment »

Modelalias User Exit for Microsoft Deployment Toolkit 2010/2012

Posted by Mikael Nystrom on May 1, 2012

No, I did not create this script, I think this has been around for a long time, somewhere around 2007 and correct me if I’m wrong but I believe it was Ben Hunter that started this back in the days. I have then seen this at the Deployment Guys and various other TechNet sites I did some updates to it since I do a lot of OS deployment in virtual environments, VirtualBox, VMware, Xen and of course Hyper-V. In MDT 2012 they spot most of this with the following information but in some cases you need a bit ore, and you need to be able to modify it to

So Credit goes to Microsoft, Ben Hunter and “The Deployment Guys” (and I’m sure Michael Niehaus has been involved too, so credits for him as well)

Using the Modelalias User Exit script in the Virtual World

In MDT 2012 they have bumped up the information you get from the ZTIGather script, below is the most important information we get from it. But sometimes we need more, but before we get into that, check out the list below. Notice the two last Hyper-V examples, we have the same info returned but that is not the same version of the Hypervisor.

What do you get directly from MDT 2012 s virtualization information?

Here is the result you get during the inventory when running on a VMWare ESXI or VMware Workstation

  • Property IsHypervisorRunning is now = True
  • Property IsVM is now = True
  • Property VMPlatform is now = VMware

Here is the result you get during the inventory when running on a VirtualBox

  • Property IsHypervisorRunning is now = False
  • Property IsVM is now = True
  • Property VMPlatform is now = VirtualBox

Here is the result you get during the inventory when running on a Xen

  • Property IsHypervisorRunning is now = True
  • Property IsVM is now = True
  • Property VMPlatform is now = Xen

Here is the result you get during the inventory when running on Hyper-V (2008 R2)

  • Property IsHypervisorRunning is now = True
  • Property IsVM is now = True
  • Property VMPlatform is now = Hyper-V

Here is the result you get during the inventory when running on Hyper-V (2012 BETA)

  • Property IsHypervisorRunning is now = True
  • Property IsVM is now = True
  • Property VMPlatform is now = Hyper-V

There are more info that we will get in MDT around virtualization, here is the complete information around virtualization for a Hyper-V guest OS

  • Property IsHypervisorRunning is now = True
  • Property SupportsVT is now = False
  • Property SupportsNX is now = True
  • Property Supports64Bit is now = True
  • Property SupportsHyperVRole is now = False
  • Property VMHost is now = IBL04.tslab.net
  • Property VMName is now = TESTHV20
  • Property IsVM is now = True
  • Property VMPlatform is now = Hyper-V

As you can see we also get the hostname and VMname, but only if the IC’s are loaded and they are not loaded by default in WinPE, but a friend of mine banged his head against the keyboard for a while and here is the answer…

Is this ok?

This is mostly ok and fine, but sometimes I really need to know what version of Hyper-V (or other platform) it is and at the same time I would like to support and handle the different naming standards that all vendors has and translate it all to one new property called ModelAlias. Then I can use ModelAlias instead of Model, since I can tweak, twist and bend whatever the OEM’s try to do I can translate it to something that is easy to handle. ModealAlias has been one of the easy ways to deal with Lenovo’s interesting model naming. They use 4+3 digits as model, the first 4 is the real model and the rest is the “unique” build, like unique keyboards and such (things that matters outside the OS deployment world), but for me the same driver is going to be installed even if the keyboard is in Swedish…

If you look at the last example, you will see that we get the same result for Hyper-V in all releases, well that’s “ok”, but the issue is that If I need to install the Integration Components I need to know what version to install to be supported and optimized. So by using the ModelAlias userexit script in MDT (Works in both LiteTouch and in ZeroTouch) the script will examine the bios version (and other information if you need to) and determine the version. So if we take a peek into the script it looks like this for the Hyper-V part.

As you can see BIOS version VRTUAL – 3000919 will give me ModelAlias=Hyperv2008R2 and BIOS version VRTUAL – 9001114 will give me ModelAlias Hyper-V2012BETA

Using the Modelalias User Exit script in the Physical World

Here is another example on how to use this, I was deploying servers not long ago and I was using MDT 2010 LiteTouch. I handle drivers using %make%\%model% in most cases but in this case that was kind of tricky. The reason, well IBM has some fancy characters in the model string (like -[]-), not really easy to use as a path. J

As you can see they have —[HS22]— as model name and after using the userexit script it will be converted into IBMHS22 and that is a bit easier to handle as part of a file path.

Here is one other example for a HP Compaq 8240. HP has a bunch of “different” 8240’s, but from my perspective it is just the same when it comes to drivers and apps, so we convert them into something more useful, like this

Here you can see the real model name being “HP Compaq nw8240 (PY442EA#AK8)” and after a translation it will be just “HP Compaq nw8240″ instead, easier to handle, easier to have as a path in MDT

How do you use the UserExit script?

This is the easy part, just download it, unpack it and save it in the scripts folder in MDT. Then you modify the customsettings.ini to use the script like this:

[Settings]
Priority=SetModelAlias, ModelAlias, Default
Properties= ModelAlias

[SetModelAlias]
UserExit=ModelAliasExit.vbs
ModelAlias=#SetModelAlias()#

[Hyper-V2008R2]
MandatoryApplications001=<GUIDNumberOFApplicationInLTI>

[Hyper-V2012BETA]
MandatoryApplications001=<GUIDNumberOFApplicationInLTI>

(If you are using SCCM you will the use Packages or Application name, but it works the same)

When you run ZTIGather.wsf you can see the result like this on a Windows Server 2012 BETA

You can download the ModelAlias.vbs script here

Here is some links to older versions of the script:

The Deployment Guys

Ben Hunters Blog

/mike

Posted in Deployment, Hyper-V, Lite Touch, MDT, SCCM | Tagged: , , | Leave a Comment »

OS Deployment PreCon(s)–Spring and Summer 2012

Posted by Mikael Nystrom on March 3, 2012

This spring I will deliver 3 PreCons on the topic of OSD or Operating System Deployment. All these three will bi similar, we will cover both the basics and the really advanced topics. The focus will be on Windows 7 deployment, but we will also cover Windows 8 and Server Deployment. The tools that we will cover are MAP/ACT, WAIK/ADK, WDS, MDT and SCCM (and then some). The hardware vendors that we will cover are HP, Dell and Lenovo. We had some questions regarding the level of these sessions, so I did an interview with Michael Niehaus

Microsoft TechDays 2012

  • Date: 24th of April 2012
  • Speakers: Mikael Nystrom and Johan Arwidmark
  • Language: Swedish
  • Location: Örebro, Sweden

Microsoft TechEd North America 2012

  • Date: 10th of June 2012
  • Speakers: Mikael Nystrom, Michael Niehaus and Ben Hunter
  • Language: English
  • Location: Orlando, US

Microsoft TechEd Europe 2012

  • Date: 25th of June 2012
  • Speakers: Mikael Nystrom, Michael Niehaus and Ben Hunter
  • Language: English
  • Location: Amsterdam, NL

Posted in ACT, Deployment, Drivers, Lite Touch, MAP, MDT, SCCM, SCVMM, TechEd, Windows 7, Windows 8, WinPE | Tagged: | 3 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 4,368 other followers