enuffsaid Posted April 5, 2004 Share Posted April 5, 2004 removed Link to comment Share on other sites More sharing options...
Bunzzing Posted April 6, 2004 Share Posted April 6, 2004 Cheers mate, was looking for this. I have 8 workstations in my domain, so this comes very handy.... Link to comment Share on other sites More sharing options...
X-U Posted April 7, 2004 Share Posted April 7, 2004 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 domainb. Unique to the pc userI 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 More sharing options...
enuffsaid Posted April 7, 2004 Author Share Posted April 7, 2004 removed Link to comment Share on other sites More sharing options...
pauledavey Posted April 7, 2004 Share Posted April 7, 2004 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 tagFor information on WMI search on technetHTHPaul Link to comment Share on other sites More sharing options...
Shotgun Posted April 9, 2004 Share Posted April 9, 2004 @X-ULook 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 More sharing options...
benjtodd Posted April 9, 2004 Share Posted April 9, 2004 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.SMBIOSAssetTagNextTechnet Scripting Example Link to comment Share on other sites More sharing options...
Bunzzing Posted April 9, 2004 Share Posted April 9, 2004 Hi Bunzzing,You're welcome. Glad to see this is being used by at least one person here! Regards,eNuffSaidI'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 More sharing options...
Guest SurfD Posted April 10, 2004 Share Posted April 10, 2004 on a somewhat related note, does anyone know how to set the computer DESCRIPTION when unattended installing? Link to comment Share on other sites More sharing options...
Scuba Steve Posted April 10, 2004 Share Posted April 10, 2004 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: " & strSerialNextThis 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 More sharing options...
Miphnik Posted April 11, 2004 Share Posted April 11, 2004 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 More sharing options...
enuffsaid Posted April 11, 2004 Author Share Posted April 11, 2004 removed Link to comment Share on other sites More sharing options...
Bunzzing Posted April 11, 2004 Share Posted April 11, 2004 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,eNuffSaidOk 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 belowECHO.ECHO Setting Computer NameECHO Please wait...for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%iIF %MAC% == 000C29401163 compname /c TestUnattendInitially 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 More sharing options...
Bunzzing Posted April 12, 2004 Share Posted April 12, 2004 Started the unattended installation, but at the point of changing the computername, it went wrong....It returns the error:%%i was unexpectedThis is what I put in the .cmd file.....CODE ECHO.ECHO Setting Computer NameECHO Please wait...for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%iIF %MAC% == 123456789012 compname /c SCRAPHEAPIF %MAC% == ABCDEFGHIJKL compname /c SANDBOXIF %MAC% == 11AA22BB33CC compname /c STELLARWhat could be wrong ? Link to comment Share on other sites More sharing options...
enuffsaid Posted April 12, 2004 Author Share Posted April 12, 2004 removed Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now