Quantcast
Channel: Ivanti User Community : Document List - OS Deployment and Provisioning
Viewing all articles
Browse latest Browse all 639

How to inject Inventory data during Provisioning or OSD

$
0
0

Description


To show how LANDESK can be used to recycle existing information from the LANDESK Database back into a newly re-imaged computer.

For this document, I chose to use the Windows "Description" inventory data, but the methodology could certainly be applied to any number of other useful pieces of Inventory data - the possibilities are endless!


Background


In a former environment, I used a VBScript for Device Name (NetBIOS/hostname) creation after OSD.  The PC naming convention is to use a 3-digit alpha code unique to each physical location, and the last six digits of the onboard Ethernet MAC address.  The alpha code is determined in VBScript by obtaining the IP address of the Ethernet adapter and matching the 2nd octet up to a string in a dictionary.

 

For example:

Arapahoe Ridge High School = ARH - network is 10.66.x.x - VBScript says if 2nd octet is 66 then device name will begin with ARH

Pioneer Elementary School = PIE - network is 10.67.x.x

Manhattan Middle School = MAM - network is 10.68.x.x

 

So device names end up being ARH3CF1BF, PIE789FAC, MAM82EF08, etc.

 

This naming convention is EXCELLENT when it comes to writing LANDESK scopes, queries, Active Directory automation, and custom scripts that must know the physical location of the computer.  This convention is TERRIBLE for actual identification of a single machine in the flock.

 

That is what Microsoft created the "Description" for, AKA the SRVCOMMENTvalue data in the HKLM\SYSTEM\CurrentControlSet\Lanmanserver\Parameters\ registry key.  Computers need a standardized network name that makes scripting easy, AND a Friendly-Name that is useful to us Humans.

desc.JPGdevdesc.JPG

 

When reimaging a whole lab like the BOH Library, it's time consuming to go around and re-describe each computer, especially when the description is the same as it was before.

 

_________________________________________________________________________________________________________________________________

 

HOW-TO for Provisioning (added September 13, 2011, tested on 9.0 SP2 and SP3)


Attached to this document is a Provisioning "Include" template for 9.0 SP2/SP3 - it greatly simplifies the Description injection over the Classic OSD method outlined in the next section.  It uses no INI or BAT files, requires no image modifications, and occurs in WinPE before an image ever boots up.

 

The Include template performs the following steps, and should be added to the Post-OS Installation phase at some point after the new OS image has been laid down to C: and the volume is writable:

 

Step 1 - Back up the SYSTEM registry hive to SYSTEM.BAK

Step 2 - REG.exe mounts the SYSTEM registry hive as OSDSYSTEM

Step 3 - REG.exe writes the new Description to the registry, using a Variable called "DeviceDescription" which references "Computer"."Description" from the DB

Step 4 - REG.exe unmounts the OSDSYSTEM registry hive.

 

That's it!  All you have to do is import the attached Include and include it in your Post-OS Installation phase of a Provisioning template.

 

 

HOW-TO for Classic OSD (tested on LDMS 8.8 SP3 and 9.0 SP2):

 

This is my old method for LANDESK 8.8 OSD and a Windows XP image, but it still works in LANDESK 9 and Windows 7.  Unlike the Provisioning Include method above, this process happens AFTER the image has been deployed, as part of the Sysprep routine.  It would be called during GuiRunOnce in WinXP, or during the Specialize phase as a RunSynchronousCommand in Win7.

 

Step 1 - In my \Drivers\Common\ directory that gets copied to each computer during my OSD driver injection routine (using CopyDrivers.exe), I created a DESCRIPTION.INI file.

 

               This file contains a single line with a variable called %DESC%

 

Step 2 - In my LANDESK OSD script, I added a line that runs:

 

TOKREPLW.EXE C:\DRIVERS\DESCRIPTION.INI DESC="%Computer - Description%"

 

               (NOTE:  Quotes around the LD database variable are critical since descriptions usually have spaces)

               This line reads the existing Description from the LD database and replaces the %DESC% variable in the INI file that lives on the freshly imaged drive

 

 

Step 3 - In my post-OSD batch file (called from GuiRunOnce) that runs after Windows Mini-Setup finishes and reboots, I added two lines:

 

SET /P DESCRIPTION=<C:\DRIVERS\DESCRIPTION.INI
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters" /v srvcomment /t REG_SZ /d "%DESCRIPTION%" /f

 

               The first line uses SET /P to read the new string from DESCRIPTION.INI, set it as an environment variable

               The second line uses REG to write the string stored in the variable back to the Registry.

 

 

 

Voila!  Every time you reimage a computer, LANDESK can now recycle the current Description from the DB.

Happy LANDESKing everyone.


Viewing all articles
Browse latest Browse all 639

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>