Showing posts with label MDT. Show all posts
Showing posts with label MDT. Show all posts

Thursday, 2 March 2017

ConfigMgr OSD - use MDT without using MDT

The title may not make much sense but please read on about a recent customer requirement.

Customer requirement

In the task sequence, set the computer name to match the service tag

Solution

Easy - use the OSDComputerName variable with a value of %SerialNumber% (or was it that easy?)

Problem Statement


How does the %SerialNumber% value get populated in this case? This is straightforward if I'm using MDT integration as I can use the Gather step. However, the customer does not have MDT integrated and this would take a few weeks to organize with a strict change request procedure.
So what do I do?


Solution (revised)

Do I actually need MDT integrated or do I just need some MDT files?

I had a word with @ncbrady from @WindowsNoob and we came up with a plan. I installed MDT on a laptop and created a deployment share.



I figured that these files were all that I needed - only 45MB. I copied the files to my content source location and created an MDT Gather package (with no program).
Then I configured the TS as shown in the screenshots.



First I ran ZTIGather.wsf with this command

Cmd.exe /c cscript.exe .\Scripts\ZTIGather.wsf /debug:TRUE

This was to "discover" the service tag.



The next step was to set the hostname to match the serial number (service tag).

Unfortunately the task sequence failed:

"Gathering complete, but no INI file found” with an error code of 0x00001F40



On examining the smsts.log file the hostname was in fact set to the service tag, even though the task sequence failed. Happy days. I was just missing a customsettings.ini file. I manually created a default .ini file and copied it to the scripts folder.

[Settings]
Priority=Default
Properties=MyCustomProperty

[Default]
OSInstall=Y
SkipCapture=YES
SkipAdminPassword=NO
SkipProductKey=YES


That did it - SUCCESS.
Thanks for the assistance Niall.

Until next time.......

Edit #1:

Jörgen Nilsson has contacted me to say that only a few of the MDT files are actually required (less than 800KB). Here they are:


Thanks Jörgen.

Edit #2:


I've had some feedback about other ways to set the computer name to the service tag without using MDT. Thanks for that. However, the whole point of this post was to show how you can achieve MDT functionality without actually integrating MDT with ConfigMgr.


After all, the title is "Use MDT without using MDT".





Wednesday, 19 March 2014

Sysprep & Capture thick image

Back to ConfigMgr main menu

Back to MDT Menu


In my experience it is best practice to capture your reference images using MDT build and capture task sequence. However, every now and then, you can be in a situation where a customer has provided a pre-built image (often using another deployment solution) and you have to capture this to a WIM file.

For this, you use a Sysprep & Capture task sequence. It's also an easy solution to implement.

Right click Task Sequences and choose to create one.


Enter a suitable ID and name.


Choose "Sysprep & Capture".


Choose the OS to match what you will be capturing.


No need to specify the product key.


Enter your details (you must enter details in each box to be able to continue).


No need to specify administrator password.


Review the summary and click Next.


Process has completed.


See the Scripts folder in the Deployment share. LiteTouch.wsf is available.


Now lets capture the thick image. Open a command prompt "As Administrator" on the reference computer. First, map a drive to the deployment share, so that we can enter credentials.

Then execute the following command:

cscript.exe \\UNC path\DeploymentShare$\Scripts\LiteTouch.wsf


Script runs.


We are presented with a menu of available task sequences. Choose "Systprep & Capture".


Enter local administrator password.


Choose to capture an image of the computer. Enter a location and file name.


Specify your network credentials.


Review the summary and click Begin.


The task sequence starts. Sysprep is executed. The computer then restarts and boots into Windows PE.


The image is being captured.


The task sequence has completed. You can now restart the computer - we do not need it any more.



Image file (.WIM) is now available to be imported into ConfigMgr.


Saturday, 15 March 2014

Step 5. Advanced image customisation

Back to ConfigMgr main menu

Back to MDT Menu

We have the basic solution in place. The last step is to add a task to pause the task sequence between the build and capture phases. This will allow us to apply any changes we need to the image before it is sysprepped and captured.


Add a new task (Run command line) to the Build & Capture task sequence below Apply Local GPO package.


Enter the command line: cscript.exe “%SCRIPTROOT%\LTISuspend.wsf”

(Edit 7th May 2015: It seems that this command is giving some trouble for some people (see comments below). Try using the command without the quotes if it doesn't work for you.).

That's it. Now run the task sequence again.





This time it pauses after the build phase. See the "Resume Task Sequence" icon on the desktop.

Now make your changes. You can reboot as many times as you like.


Install applications.


Make registry changes.


etc


When you are finished click to resume.


Sysprep is executed.


The image is captured.



Captured customised WIM via MDT 2013 Lite Touch Build & Capture.



 

Step 4. Build & Capture reference image

Back to ConfigMgr main menu

Back to MDT Menu


Everything is now in place so let's carry out our Windows 7 build and capture.



Create a VM with a blank disk. Add the boot media ISO to the VM.


Start the VM.


Enter your keyboard layout and choose to "Run the Deployment Wizard". 


Enter your credentials. This account must have permissions to write to the share that you select later in this post.


Select your Build and Capture task sequence.


Accept the defaults.


Accept the defaults. 


Accept the defaults. 


Enter your required settings.


Enter your required local administrator password.


Choose to capture an image and enter a location and file name.Use the FQDN here. Remember that your reference computer will be in a workgroup at all times.

Also note that the account you chose earlier must have write access to this share.


Review the summary and click Begin.


The MDT Lite Touch Build commences.


OS is applied.




See progress (if you are installing Windows 8 you must switch to the desktop to see this).


Windows PE is applied.


The Capture phase commences. Sysprep is executed.


The image is being captured.


Image capture has completed. You can now turn off the VM.


Image (WIM) is now available to import into ConfigMgr for your deployments.

Our image has been created. However it is just a vanilla Windows 7 image with no applications or customisations. How do we add these? We will do this in the final Step. We will add a task to pause the task sequence between the build and capture phases. This will allow us to apply any changes we need.