The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

PowerShell is King – Create the “missing” VM on all the lab machines

Posted by Mikael Nystrom on July 9, 2014

Lets assume that you are running a class and suddenly someone raise the hand and say “I’m missing one of the VMs…” That is far from god, but wait a minute, what about PowerShell to the rescue?, of course, so here it is:

image

Code snip below:


$servers = 1..21 | ForEach-Object {
“VIAMONSTRA{0:D3}” -f $_
}

foreach ($Server in $Servers)
{
Invoke-Command -ComputerName $Server -ScriptBlock {
HostName
$VMName = “FS01″
$VMMemory = 2048MB
$VMDiskSize = 60GB
$VMNetwork = “Internal”
$VMLocation = “C:\VMs”
New-VM -Name $VMName -Generation 2 -MemoryStartupBytes $VMMemory -SwitchName $VMNetwork -Path $VMLocation -NoVHD | Out-Null
New-VHD -Path “$VMLocation\$VMName\Virtual Hard Disks\$VMName-Disk1.vhdx” -SizeBytes $VMDiskSize | Out-Null
Add-VMHardDiskDrive -VMName $VMName -Path “$VMLocation\$VMName\Virtual Hard Disks\$VMName-Disk1.vhdx” | Out-Null
}
}

 


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

Back to Basic–Where to find Drivers for Servers and Clients

Posted by Mikael Nystrom on July 8, 2014

During one of the sessions today (at the Geek Week in Redmond) we talked about drivers and where to find them. This is absolutely nothing “new” or amazing, its more of a “note to attendees” kind of post.

HP Clients

The HP SoftPaq Download Manager from HP. The tools has the ability to download drivers for every business model that is supported into a repository, which you can then export drivers from. It also provides .CVA files that gives you instructions on how to silently execute drivers and tools that needs to be installed as an application. HP also provides .CAB files for some newer models. http://www8.hp.com/us/en/ads/clientmanagement/drivers-bios.html

image

Dell Clients

Dell have a really great webpage with ready made .CAB files, ready for download. It also includes Windows PE drivers, be sure to pick the correct version. A general rule is to NOT add any Windows PE driver unless you really NEED them, in other words. If you get any IP address and you can see the disk using diskpart, you don’t NEED any drivers. http://en.community.dell.com/techcenter/enterprise-client/w/wiki/2065.dell-driver-cab-files-for-enterprise-client-os-deployment.aspx

image

Lenovo Clients

For Lenovo a nice tool is the ThinkVantage Update Retriever. The tool is pretty straightforward, just create a repository folder, download all the drivers for your models. The most important thing here is that you should not grab the drivers from that folder, instead you should use the to tool to export them. http://support.lenovo.com/en_US/detail.page?LegacyDocID=TVAN-ADMIN

(For fun, search for it and you will ALWAYS find at least one dog… http://www.bing.com/images/search?q=ThinkVantage+Update+Retriever&qs=n&form=QBIR&pq=thinkvantage+update+retriever&sc=5-29&sp=-1&sk=)

image

HP Servers

For HP Servers the best way I have found so far is to install the HP Proliant in the operating system during deployment using (scripts or MDT/SCCM applications/Packages or in SCVMM as Host Command line post OSD)

That means that I usually don’t import other drivers then Network and Storage drivers in the deployment solution, since the Support Pack will take care of the rest.

The HP Proliant Service Pack: http://h17007.www1.hp.com/us/en/enterprise/servers/products/service_pack/spp/index.aspx

image

However, you do need Windows PE Drivers and the easiest way to find them is to look somewhere else. You will find them in the HP Scripting Toolkit for Windows.

http://www.hp.com/swpublishing/MTX-4bbbd9504e2a4286b6ae8300b4

image

Dell Servers

I have to be honest, I do deploy more HP servers then Dell servers, but when I do I use the standard webpage to download drivers. For servers Dell provides Driver Application Packages, which will install all the drivers for that particular model. Download it and run it as a part of the TaskSequence or do it Post OSD.

http://www.dell.com/support/home/us/en/04/Products/ser_stor_net/poweredge

image

What about System Center Integration?

Yes, there are ready made applications for System Center Integration.

For HP it is called Insight Management: https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=IMDVD#7.3

For Dell it is called OpenManage Integration Suite for Microsoft System Center: http://en.community.dell.com/techcenter/systems-management/w/wiki/4111.openmanage-integration-suite-for-microsoft-system-center.aspx

/Mike

Posted in Drivers | Tagged: , , , , , | 3 Comments »

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 »

PowerShell is King–Test RDP Connection and Connect

Posted by Mikael Nystrom on July 2, 2014

So, during the class today we talked about simple but useful things you could do with PowerShell. So we had a very simple situation, during reboot of servers everyone asked “how long time does it take to reboot the server?” Since this is real servers, with a real firmware the correct answer will “Longer then you would like it to take…”. So, ping the machine, wait to you get the response is what IT pros does, or could a very simple PowerShell function be a better way?

image

Using this method it will use the Test-NetConnection until it succeeds accessing TCP 3389 and then fire up MSTC.exe and connect, simple and neat.

Download it from: http://1drv.ms/1o7PgK7

Run it (or load it as a module)

Execute the following command from the PowerShell prompt like this:

image

/mike

Posted in PowerShell | Tagged: | 3 Comments »

PowerShell is King–Convert Windows Server Editions during OS Deployment (MDT/LiteTouch)

Posted by Mikael Nystrom on July 2, 2014

Yesterday I posted a simple UI based PowerShell script that allows the local administrator of the server to change the Windows Edition. That is is a nice to have function, but what if you would like to do that during the deployment of the server instead of after. This way you can have two task sequences, one for Standard and one for datacenter but just have one WIM file (also means one reference image). For the same reasons I mentioned in the previous post,  I have created some scripts for this.

You can read the previous post on the UI method here http://deploymentbunny.com/2014/07/01/powershell-is-kingconvert-windows-server-editions-using-a-ui-based-powershell-script/

All three options here are using the same base logic with the same kind of option. Instead of defining every different “upgrade” , I decided to have just 2, NEXT and TOP. When TOP is selected as an option it will upgrade to the TOP Edition, in other words Datacenter. When NEXT is selected, it will do the NEXT level. That means that a standard will be datacenter, unless it is a 2008 r2, then a standard will be enterprise. Evaluations will be the “same, so a standard evaluation, will be a standard . In a bit more detail, this is what the scripts actually do…

What kind of conversion can the scripts perform?

Source OS   UpgradeLevel Destination OS
Windows Server 2008 R2 Standard to NEXT Windows Server 2008 R2 Enterprise
Windows Server 2008 R2 Standard   TOP Windows Server 2008 R2 Datacenter
Windows Server 2008 R2 Enterprise   NEXT/TOP Windows Server 2008 R2 Datacenter
Windows Server 2012 Standard Evaluation   NEXT Windows Server 2012 Standard
Windows Server 2012 Standard Evaluation   TOP Windows Server 2012 Datacenter
Windows Server 2012 Standard   NEXT/TOP Windows Server 2012 Datacenter
Windows Server 2012 R2 Standard Evaluation   NEXT Windows Server 2012 R2 Standard
Windows Server 2012 R2 Standard Evaluation   TOP Windows Server 2012 R2 Datacenter
Windows Server 2012 R2 Standard   NEXT/TOP Windows Server 2012 R2 Datacenter

 

Option No:1 (VB Script as an Application)

The first option is to use a VBscript and run it as an application, that gives a great logging and integration with the Task Sequence in MDT. The script uses a Custom property called UpgradeLevel (which can be set to either NEXT or TOP) that you needs to be added to CustomSettings.ini

Step By Step, kind of…

Download Script from : http://1drv.ms/TBO9Zw

Add the Custom property UpgradeLevel.

image

Import the Application in the Deployment Workbench.

image

Modify the Task Sequence (add a Set Task Sequence Variable Step)

image

Modify the Task Sequence (Add the Application)

image

Deploy a Server and check the logfile.

image

Option No:2 (PowerShell Script as an Application)

The second option is to use a PowerShell script instead, still running as an application, I added some logic to discover the presence of a Task Sequence, that way logging can end up in the correct location

Step By Step, kind of…

Download Script from : http://1drv.ms/TBOgEn

Add the Custom property UpgradeLevel.

image

Import the Application in the Deployment Workbench

image
The command line is a bit long so here it is in text form
PowerShell.exe -ExecutionPolicy Bypass -File Upgrade-SKU.ps1 -UpgradeLevel %UPGRADELEVEL%

Modify the Task Sequence (add a Set Task Sequence Variable Step)

image

Modify the Task Sequence (Add the Application)

image

Deploy the server and check the logfile.

image

Option No:3 (PowerShell Script in TaskSequence)

The third option is to run it as a PowerShell task Sequence

Step By Step, kind of…

Download Script from :http://1drv.ms/1qjoOAk

Save the script in the scripts folder

Modify the Task Sequence (Run PowerShell script)

image

Modify the Task Sequence (Add a reboot Action)

image

Deploy a server and check the logfile.

image

/mike

Posted in MDT, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Tagged: , , | Leave a Comment »

PowerShell is King–Convert Windows Server Editions using a UI based PowerShell script

Posted by Mikael Nystrom on July 1, 2014

If possible it is best practices to keep the number of images to a minimum. So, in my line of work I’m building reference images for both client and servers, many of the organization I work with are struggling with the fact that they need to have both old images and new images, both servers and clients and also both 32 and 64 bit. Add all that up you will realize that, hmm, lets see… that will be 9 images to maintain, no, wait, I missed the fact that we also have different editions. Servers have Standard and Datacenter edition, that is three more, or actually its 4 more since Windows Server 2008 R2 have Standard, Enterprise and Datacenter.

Download the script from http://1drv.ms/1lMpr4i

The solution

Since it is possible to upgrade every Windows Server edition (Windows Server 2008 R2 and above) to a higher edition (and that includes evaluation editions to) by changing the product key using DISM.exe it is possible to create reference images with the lowest SKU(Edition) that your organization needs and upgrade during the deployment or as this blog post is about, after the OS has been deployed. Internally for us this is great since we are running many proof of concept, labs, tests and such and many cases. I gave up telling/explaining for our internal staff on how to do this, ending up with a script that is “user-friendly”.

To be able to change edition, you need to have a product key, and what we do is that we change to the KMS client key, so yes it needs to be activated after it has been modified. You can find all these product keys at TechNet here: http://technet.microsoft.com/en-us/library/jj612867.aspx

What kind of conversion can the script perform?

Windows Server 2008 R2 Standard to Windows Server 2008 R2 Enterprise
Windows Server 2008 R2 Standard to Windows Server 2008 R2 Datacenter
Windows Server 2008 R2 Enterprise to Windows Server 2008 R2 Datacenter
Windows Server 2012 Standard Evaluation to Windows Server 2012 Standard
Windows Server 2012 Standard Evaluation to Windows Server 2012 Datacenter
Windows Server 2012 Standard to Windows Server 2012 Datacenter
Windows Server 2012 R2 Standard Evaluation to Windows Server 2012 R2 Standard
Windows Server 2012 R2 Standard Evaluation to Windows Server 2012 R2 Datacenter
Windows Server 2012 R2 Standard to Windows Server 2012 R2 Datacenter

How to use?

Execute the script from an elevated command prompt and select upgrade type.

image
Changing from Windows Server 2008 R2.

image
Changed from Windows Server 2008 R2.

image
Changing from Windows Server 2012 R2 Standard Evaluation.

image
Changing from Windows Server 2012 Standard.

Posted in PowerShell, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Tagged: , , , | 1 Comment »

Nice to Know – MAP 9.1 has been released

Posted by Mikael Nystrom on June 27, 2014

Microsoft Assessment and Planning (MAP) Toolkit 9.1 has been released which is a great to tool to discover what the environment contains before you start doing anything. I use this on a regular basis BEFORE making any kind of decisions.

Download and install on a computer from: http://www.microsoft.com/en-us/download/details.aspx?&id=7826

Read more: http://blogs.technet.com/b/mapblog/archive/2014/06/27/announcing-the-map-toolkit-9-1.aspx

The short story is:

Discover Windows 8.1, Windows Server 2012 R2, Can target a Windows Server 2012 R2 Hyper-V when doing server consolidation, improved SQL Server discovery.

Install.

image

Starting for the first time.

image

Create a Database.

image

Select what to inventory.

image

Watch paint dry.

image

And so we wait a while, and then some, and wait…

The environment.

image

Usage tracking.

image

Server Virtualization (Consolidation and Private Cloud).

image

Desktop overview.

image

The Excel reports are nice.

image

A tip, before running the assessment for desktops, adjust the assessment value according to this to make sense, not that I don’t use 4096 or 2048 to represent 4gb and 2gb since we need to compensate for GPU ram…

image

Desktop Report.

image

Hardware Inventory.

image

/mike

Posted in MAP | Tagged: | Leave a Comment »

Nice to Know–CU2 for ConfigMgr 2012 R2 is available for download

Posted by Mikael Nystrom on June 27, 2014

Cumulative Update 2 for System Center Configuration Manager 2012 R2 has been released and it is available for download.

image
About to install CU2.

You can get the download from here http://support.microsoft.com/kb/2970177

Items that have been fixed / changed / modified

  • Administrative Console
  • Remote Control
  • Mobile Device Management / Intune
  • Client
  • Operating System Deployment
  • Site Systems
  • Application Virtualization
  • Content Management
  • PowerShell

Read about all the changes here : http://support.microsoft.com/kb/2970177

Read about all PowerShell changes here : http://support.microsoft.com/kb/2962855

(Note: There is a lot of changes, I mean A LOT of changes to the cmd-lets. Please read trough the PowerShell changes document IF you are using any PowerShell script or command, they might need to be updated)

Read about all Linux/Unix changes here: http://support.microsoft.com/kb/2976481

(Please, read before install…)

image
CU2 installed.

Posted in ConfigMgr, CU2 | Tagged: | Leave a Comment »

Back to Basic: .NET Framework 4.5.2 deployment in MDT using a VB Script wrapper

Posted by Mikael Nystrom on June 27, 2014

I got a tweet, it said “Why doing 4.5.1 when 4.5.2 is out”. So, this is just an update of the 4.5.1 post you can see here. http://deploymentbunny.com/2014/06/24/back-to-basic-net-framework-4-5-1-deployment-in-mdt-using-a-vb-script-wrapper/

How to Use it

Step 1: Download it

Download it from here: http://1drv.ms/TDbKJC

Step 2: Import it as an Application

Using the Deployment Workbench, import the application with the following options:

  • Application Type:
    • Application with source files
  • Details:
    • Application Name: Install – Microsoft .NET Framework 4.5.2
  • Source:
    • Source Directory: The location where you unzipped the files
  • Destination:
    • Directory Name: Install – Microsoft .NET Framework 4.5.2
  • Command Details:
    • Command Line: cscript.exe Install-NetFramework452.wsf

If you prefer PowerShell to import the application, here is an example POSH Snippet:

Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"

New-PSDrive -Name "DS001" `
-PSProvider MDTProvider `
-Root "E:\MDTBuildLab"

import-MDTApplication `
-path "DS001:\Applications\Install" `
-enable "True" `
-Name "Install – Microsoft .NET Framework 4.5.2" `
-ShortName "Install – Microsoft .NET Framework 4.5.2" -Version "" `
-Publisher "" `
-Language "" `
-CommandLine "cscript.exe Install-NetFramework452.wsf" `
-WorkingDirectory ".\Applications\Install – Microsoft .NET Framework 4.5.2" `
-ApplicationSourcePath "C:\Users\Administrator\Desktop\Install – Microsoft .NET Framework 4.5.2" `
-DestinationFolder "Install – Microsoft .NET Framework 4.5.2" `
-Verbose

Step 3: Download .NET framework 4.5.2 exe file and save it in the Application\Source folder

Download from http://www.microsoft.com/en-us/download/details.aspx?id=42642

Step 4: Modify the Task Sequence

Open your task sequence and add the application like this:

image

Sample of a Windows 7 task sequence with .NET Framework 4.5.2

image
Sample of a Windows 8.1 task sequence with .NET Framework 4.5.2

Note: You might need to add a reboot before and one after, since .Net Framework might feel better, my sequence does not need it, but yours might depending on what you add before this.

Note: For Windows 8/8.1 (Server 2012/2012 R2) I always add .NET 2/3 as Roles BEFORE adding 4.5.2, just to make sure nothing is messed up.

Step 5: Create your Ref Image

/mike

Posted in MDT, OS Deployment, OSD, Reference Image | Tagged: , | 1 Comment »

Back to Basic: .NET Framework 4.5.1 deployment in MDT using a VB Script wrapper

Posted by Mikael Nystrom on June 24, 2014

Yesterday an OS Deployment friend (you know who you are…) asked around for a way to install .NET Framework 4.5.1 as a part of the reference image creation and I told him I would post it today, so here it is. The reason I do this with VB script wrappers (not only me, most of the people I know and works with OSD does that) is logging and full control, but also the fact that I have a bunch of VBscripts that are very similar and the fact that MDT has a very nice module called ZTIUtility that connects external scripts built in functions make this a very easy choice.

Hey, you might need 4.5.2 instead? –> http://deploymentbunny.com/2014/06/27/back-to-basic-net-framework-4-5-2-deployment-in-mdt-using-a-vb-script-wrapper/

How to Use it

Step 1: Download it

Download it from here: http://1drv.ms/TqAqVD

Step 2: Import it as an Application

Using the Deployment Workbench, import the application with the following options:

  • Application Type:
    • Application with source files
  • Details:
    • Application Name: Install – Microsoft .NET Framework 4.5.1
  • Source:
    • Source Directory: The location where you unzipped the files
  • Destination:
    • Directory Name: Install – Microsoft .NET Framework 4.5.1
  • Command Details:
    • Command Line: cscript.exe Install-NetFramework451.wsf

If you prefer PowerShell to import the application, here is an example POSH Snippet:

Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"

New-PSDrive -Name "DS001" `
-PSProvider MDTProvider `
-Root "E:\MDTBuildLab"

import-MDTApplication `
-path "DS001:\Applications\Install" `
-enable "True" `
-Name "Install – Microsoft .NET Framework 4.5.1" `
-ShortName "Install – Microsoft .NET Framework 4.5.1" -Version "" `
-Publisher "" `
-Language "" `
-CommandLine "cscript.exe Install-NetFramework451.wsf" `
-WorkingDirectory ".\Applications\Install – Microsoft .NET Framework 4.5.1" `
-ApplicationSourcePath "C:\Users\Administrator\Desktop\Install – Microsoft .NET Framework 4.5.1" `
-DestinationFolder "Install – Microsoft .NET Framework 4.5.1" `
-Verbose

Step 3: Download .NET framework 4.5.1 exe file and save it in the Application\Source folder

Download from http://www.microsoft.com/en-us/download/details.aspx?id=40779

Step 4: Modify the Task Sequence

Open your task sequence and add the application like this:

image

Sample of a Windows 7 task sequence with .NET Framework 4.5.1

image
Sample of a Windows 8.1 task sequence with .NET Framework 4.5.1

Note: You might need to add a reboot before and one after, since .Net Framework might feel better, my sequence does not need it, but yours might depending on what you add before this.

Note: For Windows 8/8.1 (Server 2012/2012 R2) I always add .NET 2/3 as Roles BEFORE adding 4.5.1, just to make sure nothing is messed up.

Step 5: Create your Ref Image

/mike

Posted in MDT, OS Deployment, OSD, Reference Image | Tagged: , | 7 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 3,710 other followers