Jump to content

Set your Computer Name unattended...


Recommended Posts


Hi guys, thanks for the quite good tips.

I have another idea,I have 150 DELL desktops and 40 laptops, I want to use the DELL service tag (a series such as GX10PH8) to be the PC name, it will be few advantage:

a. Unique computer name in the domain

b. Unique to the pc user

I believe there is no tool can record the DELL service tag, but I want to put a interactive command line dialog to metion to type in the tag before I start the windows setup.then the auto installed windows can import what I key in to be as the computer name.

Any good spot on this? thanks!

Link to comment
Share on other sites

If you want to use the Dell Asset tag as your computer name the easiest way of doing so will be to have a runonce section of your unattend call a vbscript. In the vbscript you can use WMI to obtain the asset tag and place in a variable. Then use NSET.exe (from the win2k resource kit) and the variable you have captured to rename the computer to the asset tag

For information on WMI search on technet

HTH

Paul

Link to comment
Share on other sites

@X-U

Look at the Dell Tools subdir in your Hard Disk. On my Dell Optiplex GX-1 at work we found in that subdir an utility that could read the service tag from the command prompt. I don't know if the Dell Support website has a download for it.

Edit: Just checked the Dell website. They have a download for the utility. It's called SVCTAG.EXE, just search for it in the website. A word of caution, the utility will not run under windows (or a command prompt window), it must run under MSDOS (Real mode?). It detects if running from multitasking environment, so it must be used from a boot floppy (or CD).

Link to comment
Share on other sites

You can actually read most service tags which are usually serial numbers (I don't have a dell but I do have IBMs, Intels, Toshibas, etc) by using smbios calls in vbscript. An example from Microsoft is below. Note that you can use this during the GuiRunOnce on XP, but while it will work during cmdlines on 2000 it will not work in cmdlines on XP. I worked with MS on that issue and they say thats just the way it is now (the object returns null). But since most people in this forum use GuiRunOnce that shouldn't be a problem generally.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
   & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery _
   ("Select * from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
   Wscript.Echo "Part Number: " & objSMBIOS.PartNumber
   Wscript.Echo "Serial Number: " & objSMBIOS.SerialNumber
   Wscript.Echo "Asset Tag: " & objSMBIOS.SMBIOSAssetTag
Next

Technet Scripting Example

Link to comment
Share on other sites

Hi Bunzzing,

You're welcome. Glad to see this is being used by at least one person here! :)

Regards,

eNuffSaid

I've read your instructions, but I'm not quite sure were to put the compname.exe file ? So, where do I put it ? And what do I fill in the box for computername when creating the winnt.sif file ? I left it empty because I want to use the compname.exe file....

Can you post parts of your relevant files (*.cmd / winnt.sif etc.) in which you reffered to the compname.exe file ?

Thanx....

Link to comment
Share on other sites

Guest SurfD

on a somewhat related note, does anyone know how to set the computer DESCRIPTION when unattended installing?

Link to comment
Share on other sites

Well i don't know how to set the description of the Computer but I took the above VBS file and edited it to return only one dialog. In my limited experience, the three items are either null or return the same value. (The three items i am talking about is: objSMBIOS.PartNumber, objSMBIOS.SerialNumber, objSMBIOS.SMBIOSAssetTag) So I basicly added some if tests to see if they had anything in them and if so, I set strSerial to whatever is in it.

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSMBIOS = objWMIService.ExecQuery _

("Select * from Win32_SystemEnclosure")

For Each objSMBIOS in colSMBIOS

   

    If Len(objSMBIOS.PartNumber)>0 Then

strSerial = objSMBIOS.PartNumber

    ElseIf Len(objSMBIOS.SerialNumber)>0 Then

strSerial = objSMBIOS.SerialNumber

    ElseIf Len(objSMBIOS.SMBIOSAssetTag)>0 Then

strSerial = objSMBIOS.SMBIOSAssetTag

    End If

Wscript.Echo "Computer Name: " & strSerial

Next

This is all great and all, but now that I have this vbs script, how do i use it to make the mostly automated install set what ever strSerial is to the computer name? Details are great and much appreciated.

Link to comment
Share on other sites

I've used compname.exe in my RunOnceEx to retrieve the asset tag information from my Dell GX240, 260, 270's.

It has been my experience that the serial number stored in the Dell is the same as the service tag number. Compname \c ?s should do the trick if I remember correctly.

Link to comment
Share on other sites

I've read your instructions, but I'm not quite sure were to put the compname.exe file ? So, where do I put it ? And what do I fill in the box for computername when creating the winnt.sif file ? I left it empty because I want to use the compname.exe file....

Can you post parts of your relevant files (*.cmd / winnt.sif etc.) in which you reffered to the compname.exe file ?

Thanx....

I put Compname.exe in the root of my $oem$, along with all my other files (apps.cmd, GUIRunOnce)

I didn't put anything in my WINNT.SIF; I allow WinXP to generate its own name.

The only code I have in my Unattended setup is the part I posted in my first post, which I put at the end of my GUIRunOnce.

Hope that helps.

Regards,

eNuffSaid

Ok thx. I already figured it out. I have put in in the system32 folder and tested it and it works... For all who dont know, check my compname.cmd file below

ECHO.

ECHO Setting Computer Name

ECHO Please wait...

for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%i

IF %MAC% == 000C29401163 compname /c TestUnattend

Initially I put in a c instead of a C in the macadres. When the command compname /d ?m is executed, the result is a mac adres with capital letters in it. So if you put it with a c instead of a C your computername won't be changed....

Link to comment
Share on other sites

Started the unattended installation, but at the point of changing the computername, it went wrong....

It returns the error:

%%i was unexpected

This is what I put in the .cmd file.....

CODE

ECHO.

ECHO Setting Computer Name

ECHO Please wait...

for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%i

IF %MAC% == 123456789012 compname /c SCRAPHEAP

IF %MAC% == ABCDEFGHIJKL compname /c SANDBOX

IF %MAC% == 11AA22BB33CC compname /c STELLAR

What could be wrong ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...