Jump to content


  • 0
papagolf

How to build naming convention within OSD

Question

I'm trying to automate our computer deployment completely.

At the moment the helpdesk guys have to manually type in the name of the machine to a fairly simple naming convention which follows:

 

XX-YY-Username

 

Where XX is one of 3 brand initials, YY is either WS or LT depending on desktop/laptop and Username is the user's name.

 

Unfortunately this isn't being followed correctly so I'd like to automate it and change it around a bit going forward so that instead of using the Username I use the service tag of the machine.

I think I have the bits together to get the YY-ServiceTag but I'm really struggling on how to get the support guys to choose the brand.

 

Can anyone point me at an idiot proof guide to get his running, I've spent far too long googling for options and just can't figure out how to get it working.

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi papa,

i would suggest to use the Microsoft Deployment Toolkit. Here is Nialls Howto for Integration.
If you read thru and finish the Integration, here is a customsettings.ini example which will create a Computer Name according to your Needs.

 

Of course you have to fill up additional sections for your Hardware types and to remove the Gigabyte section (probably not the Lenovo section)

Also use the Serial number instead of the asset tag, which is not always filled.

[Settings]
Priority=Desktop,Default
Properties=MyModel,MyType

[Default]
Mytype=LP
MyModel=%MAKE%
OSDComputerName=#Replace("#Left("%MYMODEL%",2)#"," ","")#-%MYTYPE%-#Replace("#Left("%SERIALNUMBER%",7)#"," ","")#
Subsection=%MAKE%

[Desktop]
Subsection=Desktop-%IsDesktop%

[Desktop-True]
MyType=WS

[Gigabyte Technology Co., Ltd.]
MyModel=GT

[LENOVO]
MyModel=LV

Share this post


Link to post
Share on other sites

  • 0

Run the following from an administrative command prompt:

 

wmic /namespace:\\root\cimv2 path win32_computersystem get manufacturer

 

It should return your Mfg information.

 

As a .vbs you could do something like (I apolgize for the sloppy coding):

 

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strcomputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_SystemEnclosure")

For Each objItem in colItems

strComputerManufacturer = objitem.Manufacturer ' This should be the name you are looking for

strSMBIOSAssetTag = objitem.SMBIOSAssetTag ' This will return a value if it is set (YMMV as Peter33 notes above)

strSerialNumber = objitem.SerialNumber

Next

 

'WScript.Echo "Manufacturer: " & strComputerManufacturer
'WScript.Echo "Asset Tag: "& strSMBIOSAssetTag
'WScript.Echo "Serial Number: " & strSerialNumber

 

If strComputerManufacturer = "HP" or strComputerManufacturer = "Hewlett-Packard" Then
strComputerManufacturer = "HP"
XX = strComputerManufacturer
ElseIf strComputerManufacturer = "Dell Inc" Then
strComputerManufacturer = "DL"
XX = strComputerManufacturer
ElseIf strComputerManufacturer = "Lenovo" Then
strComputerManufacturer = "LN"
XX = strComputerManufacturer
Else strComputerManufacturer = "??"
End If

 

ZZ = strSMBIOSAssetTag
SN = strSerialNumber

 

WScript.Echo "Mfg: " & XX
WScript.Echo "Asset: " & ZZ
WScript.Echo "Serial: " & SN

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.