Jump to content

Recommended Posts

Posted

I've been playing around with FOG but before I go too far with it I need to know if it is possible to rename machines with a specific name and then join the domain. We name machines with an organization prefix and then the manufacturer's serial number. I know that there exists a utility called compname.exe and I know about putting netdom on the machines. Ideally I need compname to pull the asset tag or serial # from the bios and pass it on. Has anyone done this successfully?

Thanks in advance guys.

 

(If I sound like I'm trying to short circuit testing it myself please try to be understanding - there's 3 of us for just shy of 1000 users - 40 or 50 or so of whom need their laptops imaged during any given week. Hopefully that number will drop soon as we've tightened up on them considerably)

Posted
We have ours pull their Dell Service Tag through and use that as a computer name, it works on most machines like HP, Panasonic, there is a thing called MySysPrep which we got off here, if you do a search there should be something to help you out, unfortantly I wasnt the one who did it so not sure where exactly it is.
  • 2 weeks later...
Posted

I have used a app called wsname in the past that can pull info from the bios as well as other places

I used a txt file that named the computer based on its mac address But I do seem to recall it could use other system variables as well. I just set it as a runonce before I sysprepped or imaged. I do not think it will also change sid but it saved me hours of work. It was also nice because I would keep a txt file with all my machine mac address and names so when I needed to I could just tell a bunch of machines in a lab to hit the program and they would all rename

 

Workstation Name Changer. Not 100

Posted
I've been playing around with FOG but before I go too far with it I need to know if it is possible to rename machines with a specific name and then join the domain. We name machines with an organization prefix and then the manufacturer's serial number. I know that there exists a utility called compname.exe and I know about putting netdom on the machines. Ideally I need compname to pull the asset tag or serial # from the bios and pass it on. Has anyone done this successfully?

Thanks in advance guys.

 

(If I sound like I'm trying to short circuit testing it myself please try to be understanding - there's 3 of us for just shy of 1000 users - 40 or 50 or so of whom need their laptops imaged during any given week. Hopefully that number will drop soon as we've tightened up on them considerably)

 

To do this you need to use the 'bulk CSV upload' feature a list of MAC address + Machine Names to inform FOG what each machine should be called. You will also need to make sure the machines start up cleanly after a fresh image via an unattended sysprep. You will also have to put the FOG client service on the image.

  • 3 weeks later...
Posted
We have ours pull their Dell Service Tag through and use that as a computer name, it works on most machines like HP, Panasonic, there is a thing called MySysPrep which we got off here, if you do a search there should be something to help you out, unfortantly I wasnt the one who did it so not sure where exactly it is.

 

This is exactly what I am trying to accomplish. Can you give some details on how you accomplish this? :D

Posted

I'll give you the script I use if it will help, it renames the machines from serials and then I use a batch file to add a start-up reg entry that runs another vb script upon reboot to join the machine to domain, its dirty and it wont reset the SIDs but its worked for me untill i get a spare minute to work out the FOG method.

 

 

Rename PC based on serial;

 

 

'Visual basic Script to rename computer and join domain v1.0 July 2009

'Rename Computer

'prep

dim Bios, BiosSerial, objFSO, objTextFile

'Const ForReading = 1, ForWriting = 2, ForAppending = 8

 

'get serial number

for each Bios in GetObject("winmgmts:").InstancesOf ("win32_bios")

BiosSerial = Bios.SerialNumber

exit for

next

 

Set WshNetwork = WScript.CreateObject("WScript.Network")

 

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

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

 

Set colComputers = objWMIService.ExecQuery _

("Select * from Win32_ComputerSystem")

 

For Each objComputer in colComputers

err = objComputer.Rename(BiosSerial)

Next

 

'messagebox

msgbox "Computername changed to " + BiosSerial + "...", yes

 

 

Join machine to domain;

 

 

'Visual basic Script to rename computer and join domain v1.0 July 2009

'Rename Computer

 

'Next part will join to domain

Const JOIN_DOMAIN = 1

Const ACCT_CREATE = 2

Const ACCT_DELETE = 4

Const WIN9X_UPGRADE = 16

Const DOMAIN_JOIN_IF_JOINED = 32

Const JOIN_UNSECURE = 64

Const MACHINE_PASSWORD_PASSED = 128

Const DEFERRED_SPN_SET = 256

Const INSTALL_INVOCATION = 262144

 

strDomain = "YOURDOMAIN.DOMAIN"

strPassword = "YOURPASSWORD"

strUser = "YOURUSERNAME"

 

Set objNetwork = CreateObject("WScript.Network")

strComputer = objNetwork.ComputerName

 

Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _

strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _

strComputer & "'")

 

ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _

strPassword, strDomain & "\" & strUser, NULL, _

JOIN_DOMAIN + ACCT_CREATE)

 

 

I'll stress again its not perfect and it might not work for all motherboards, but it works for the ones ive used. :)

  • Thanks 1
Posted

First of all thank you whitenight639 for your information on the scripts.

 

Could you please be a bit more detailed on a few pointers for me here? I'm trying to replicate what you have done with FOG when it comes to renaming the clients based off of serial # + rebooting.

 

I'm attempting to do all of this via sysprep.inf

 

;SetupMgrTag
[unattended]
   OemSkipEula=Yes
   InstallFilesPath=C:\sysprep\i386
   TargetPath=\WINDOWS

[GuiUnattended]
   AdminPassword="*******************"
   EncryptedAdminPassword=YES
   TimeZone=20
   OemSkipWelcome=1
   OEMSkipRegional=1
   AutoLogon=Yes
   AutoLogonCount=1

[userData]
   ProductKey=WDWCD-QBBPF-*****-*****-*****
   FullName="XXXXXXXXXX"
   OrgName="XXXXXXXXXX"
   ComputerName=*

[TapiLocation]
   AreaCode=XXX

[identification]
   JoinWorkgroup=WORKGROUP

[Networking]
   InstallDefaultComponents=Yes

[branding]
   BrandIEUsingUnattended=Yes

[Proxy]
   Proxy_Enable=0
   Use_Same_Proxy=0

[GuiRunOnce]
   Command0="cscript.exe %systemdrive%\system32\compname.vbs"

 

I have tested your .vbs standalone and it works as intended on our hardware. Now I'm looking to implement it into our fog images, and I'm hoping you can point me in the right direction.

 

 

1. System is sysprep'ed and auto logs in after the final restart.

2. I see a dos window appear during the inital login, which tells me that the script is indeed running. However I do not get a window confirming the change.

 

Could you please tell me how you get your commands to run? Do you run a .bat script in which a .vbs is contained?

 

I'm adding the systems to AD via FOG which is working great.

 

Any help would be appreciated.

 

Thanks,

--ssx--

  • 7 months later...
Posted

My apologies in advance for bringing this thread back from the grave, but I can't seem to get the script to work on some of my new computer systems at work. It works fine on the older units but not the new ones! (mostly dell's)

 

Anyone have a new version of this script? Am I missing something?

Posted

What OS are you running the scripts on and what model of dell machines? does system information bring up the serial numbers?

 

I know we've had some shuttles bought from a company that had its own custom bios splash screen and serial numbers replaced with there company name which was a pain.

Posted

I think I found the root cause of my issues.

 

If the field is null (in the smbios) then it can't apply the field! :doh:

 

I was running the script (change name + reboot) on a Dell that had the motherboard replaced. It looks like the tech forgot set the service tag in the bios so it was blank (hense why it failed).

 

I booted up my copy of the dell technician's bios rom CD and manually set the bios field (i'm WPD certified so I am allowed to have one of these).

 

All is fixed now.

Posted

With FOG's inventory feature, I don't use serial number in the name. The first time a new system comes in, I have it boot to the FOG boot image and go through the complete inventory and imaging feature. This allows me to image and name the machine one time only. The machine sends it's inventory information, which includes all kinds of useful data to the FOG server. I name my systems by where they are located and an identifying number. Example, if a machine is located in our middle school room 17, it will be names VC17-001 for the first one and so on. That way, I'm never confused at to which computer someone is referencing with a problem.

 

After that, the FOG database has the computer name always.

  • 2 months later...
Posted
Does this mean that you have a separate image for each computer, or can a lab full of similar computers share image storage and each still have their own unique name?
Posted
You can have a lab of computers with the same (or very similar) hardware and push the same image to all of the at once with multicast and they will all run through a setup and get their own unique names and then be joined to the domain and placed in the correct OU. :D

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



×
×
  • Create New...