+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
O/S Deployment Thread, Rename w/ serial # and join domain in Technical; I've been playing around with FOG but before I go too far with it I need to know if it ...
  1. #1

    Join Date
    Aug 2009
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Post Rename w/ serial # and join domain

    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)

  2. #2

    Join Date
    Oct 2008
    Location
    Lincolnshire
    Posts
    2,189
    Thank Post
    13
    Thanked 226 Times in 216 Posts
    Rep Power
    66
    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.

  3. #3

    Join Date
    Aug 2009
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks - I'll definitely look at that. Never enough time to learn the stuff that would make life easier is there?

  4. #4

    Join Date
    Apr 2009
    Location
    ALBANY
    Posts
    39
    Thank Post
    6
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Rename with serial

    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

  5. #5

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Quote Originally Posted by Onslow View Post
    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.

  6. #6
    mmarsman's Avatar
    Join Date
    Sep 2009
    Location
    San Diego, California, USA
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by MatthewL View Post
    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?

  7. #7

    Join Date
    Jul 2009
    Location
    Shropshire
    Posts
    49
    Thank Post
    2
    Thanked 4 Times in 3 Posts
    Rep Power
    11
    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=Impersonat e}!\\" & _
    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.

  8. Thanks to whitenight639 from:

    SimpleSi (14th May 2010)

  9. #8
    ssx4life's Avatar
    Join Date
    Sep 2009
    Posts
    106
    Thank Post
    0
    Thanked 12 Times in 12 Posts
    Rep Power
    12
    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

    Code:
    ;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--

  10. #9
    ssx4life's Avatar
    Join Date
    Sep 2009
    Posts
    106
    Thank Post
    0
    Thanked 12 Times in 12 Posts
    Rep Power
    12
    never mind, fixed it.

    oh btw you don't need to use external .vbs scripts to change host names and or add system's to AD. =) FOG service does it all

  11. #10
    ssx4life's Avatar
    Join Date
    Sep 2009
    Posts
    106
    Thank Post
    0
    Thanked 12 Times in 12 Posts
    Rep Power
    12
    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?

  12. #11

    Join Date
    Jul 2009
    Location
    Shropshire
    Posts
    49
    Thank Post
    2
    Thanked 4 Times in 3 Posts
    Rep Power
    11
    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.

  13. #12
    ssx4life's Avatar
    Join Date
    Sep 2009
    Posts
    106
    Thank Post
    0
    Thanked 12 Times in 12 Posts
    Rep Power
    12
    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!

    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.

  14. #13

    Join Date
    Oct 2009
    Location
    Connecticut
    Posts
    22
    Thank Post
    0
    Thanked 2 Times in 2 Posts
    Rep Power
    10
    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.

  15. #14

    Join Date
    Jul 2010
    Location
    Hogansville
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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?

  16. #15
    R0M
    R0M is offline
    R0M's Avatar
    Join Date
    Mar 2009
    Location
    Perth
    Posts
    68
    Thank Post
    7
    Thanked 8 Times in 8 Posts
    Rep Power
    12
    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.

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. No Domain Join during Setup
    By Nick_Parker in forum Windows 7
    Replies: 19
    Last Post: 24th August 2009, 01:13 PM
  2. Replies: 4
    Last Post: 6th August 2009, 10:25 AM
  3. Join Domain and Set Hostname
    By DanW in forum Scripts
    Replies: 1
    Last Post: 18th July 2009, 02:36 PM
  4. Cannot join domain, dns problems
    By pod in forum Windows Server 2000/2003
    Replies: 0
    Last Post: 14th February 2009, 03:04 PM
  5. Domain Rename = Anyone done it ?
    By pooley in forum Windows
    Replies: 3
    Last Post: 25th May 2006, 12:57 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •