sodine Posted June 29, 2004 Posted June 29, 2004 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
GreenMachine Posted June 29, 2004 Posted June 29, 2004 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!
imthemp3king Posted June 29, 2004 Posted June 29, 2004 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 addressHere is an example of what I usecmdow @ /HIDECHO.ECHO Setting Computer NameECHO Please wait...for /f "tokens=1" %%i IN ('compname /d ?m') do set MAC=%%iIF %MAC% == 000000000000 compname /c pc1IF %MAC% == 000000000000 compname /c pc2IF %MAC% == 000000000000 compname /c pc3IF %MAC% == 000000000000 compname /c pc4IF %MAC% == 000000000000 compname /c pc5IF %MAC% == 000000000000 compname /c pc6IF %MAC% == 000000000000 compname /c pc7IF %MAC% == 000000000000 compname /c pc8IF %MAC% == 000000000000 compname /c pc9IF %MAC% == 000000000000 compname /c pc10EXITThat 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 = 1and 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=PC3Any 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
GreenMachine Posted June 29, 2004 Posted June 29, 2004 Sorry, imthemp3king, no idea. That was the thread I was reffering to, but it seems to have lost something in translation ...
sodine Posted June 29, 2004 Author Posted June 29, 2004 Thank you for the help! That seems like it will do the trick!--Mike
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