Jump to content

Recommended Posts

Posted

I have been looking for a way to dynamically set the computer name based on the hostname at install time. The only solution I've found is unattended.sourceforge.net and I'd prefer not to go that route as a normal answer file takes care of all our other needs. Is there something I'm missing that MS provides to do this for me?

--Mike


Posted

There is a thread that addresses this exact topic. I believe it was posted 2 - 3 months ago. When you find it, post a link here for future reference!

And ... welcome to MSFN, Mike!

Posted

Here is the link to the article GreenMachine was referring to, though it appears that some of the important content was removed. Set computer name unattended using MAC address

Here is an example of what I use

cmdow @ /HID
ECHO.
ECHO Setting Computer Name
ECHO Please wait...
for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%i
IF %MAC% == 000000000000 compname /c pc1
IF %MAC% == 000000000000 compname /c pc2
IF %MAC% == 000000000000 compname /c pc3
IF %MAC% == 000000000000 compname /c pc4
IF %MAC% == 000000000000 compname /c pc5
IF %MAC% == 000000000000 compname /c pc6
IF %MAC% == 000000000000 compname /c pc7
IF %MAC% == 000000000000 compname /c pc8
IF %MAC% == 000000000000 compname /c pc9
IF %MAC% == 000000000000 compname /c pc10
EXIT

That seems to do the trick just fine. I know this isn't using hostnames, but it does do basically what you want it to do.

On another note, does anyone know how to set the computername using the WINNT.SIF file and a WINNT.UDB file from the CD? I wanna be able to set the names using the answer file and uniqueness database created by setup manager, but it doesn't seem to be working. Here is what I'm trying:

[Networking]
   InstallDefaultComponents = No

[NetAdapters]
   Adapter01 = params.Adapter01
   Adapter02 = params.Adapter02
   Adapter03 = params.Adapter03

[params.Adapter01]
   INFID = *
   NetCardAddress = 0xXXXXXXXXXXXX
   ConnectionName = "Local Area Connection"

[params.Adapter02]
   INFID = *
   NetCardAddress = 0xXXXXXXXXXXXX
   ConnectionName = "Local Area Connection"

[params.Adapter03]
   INFID = *
   NetCardAddress = 0xXXXXXXXXXXXX
   ConnectionName = "Local Area Connection"

[NetClients]
   MS_MSClient = params.MS_MSClient

[NetServices]
   MS_SERVER = params.MS_SERVER

[NetProtocols]
   MS_TCPIP = params.MS_TCPIP

[params.MS_TCPIP]
   AdapterSections = params.MS_TCPIP.Adapter01,params.MS_TCPIP.Adapter02,params.MS_TCPIP.Adapter03
   DNSDomain = *.com
   DNSSuffixSearchOrder = *.com
   EnableLMHosts = Yes
   UseDomainNameDevolution = No
   SyncDomainWithMembership = 0

[SetupMgr]
   ComputerName01 = PC1
   ComputerName02 = PC2
   ComputerName03 = PC3

[params.MS_TCPIP.Adapter01]
   SpecificTo = Adapter01
   DHCP = No
   IPAddress = xxx.xxx.xxx.xxx
   SubnetMask = xxx.xxx.xxx.xxx
   DefaultGateway = xxx.xxx.xxx.xxx
   DNSServerSearchOrder = xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx
   WINS = Yes
   WinsServerList = xxx.xxx.xxx.xxx
   NetBIOSOptions = 1

[params.MS_TCPIP.Adapter02]
   SpecificTo = Adapter02
   DHCP = No
   IPAddress = xxx.xxx.xxx.xxx
   SubnetMask = xxx.xxx.xxx.xxx
   DefaultGateway = xxx.xxx.xxx.xxx
   DNSServerSearchOrder = xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx
   WINS = Yes
   WinsServerList = xxx.xxx.xxx.xxx
   NetBIOSOptions = 1

[params.MS_TCPIP.Adapter03]
   SpecificTo = Adapter03
   DHCP = No
   IPAddress = xxx.xxx.xxx.xxx
   SubnetMask = xxx.xxx.xxx.xxx
   DefaultGateway = xxx.xxx.xxx.xxx
   DNSServerSearchOrder = xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx
   WINS = Yes
   WinsServerList = xxx.xxx.xxx.xxx
   NetBIOSOptions = 1

and here is the WINNT.UDB file

;SetupMgrTag
[UniqueIds]
   PC1=UserData
   PC2=UserData
   PC3=UserData

[PC1:UserData]
   ComputerName=PC1

[PC2:UserData]
   ComputerName=PC2

[PC3:UserData]
   ComputerName=PC3

Any ideas on why this won't work? I know if you install from a command prompt you need to use the :UDF switch in oder to specify the UDB file. But I am wanting to use this on a CD install. The CMD file I used as an example above works fine for me but I wanna try using the answer file if possible

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...