Jump to content

Recommended Posts

Posted

Hi,

 

I'm new to MDT, just installed a WDS/MDT 2016 server. How do I make a computer keep it's old computername/OU/Security groups, etc? The computer names are in the form of "LT######"/"DT######" so I cannot generate them from MAC addresses or serial numbers like most of the online resources suggest.

 

Many thanks.

Posted (edited)

You can do it as simply as entering the old machine name during the OS deployment wizard (assuming the account you're using has the appropriate permissions).

If you want to get fancier you can install a database and integrate it with MDT so that the machine is queried for something unique (Asset tag, MAC, system serial number) and then the details you would manually enter are pulled from the database you've pre-populated.

If you're getting into MDT I can't recommend Johan Arwidmark's stuff enough. His book "Deployment Fundamentals" and sites https://deploymentresearch.com/ https://deploymentartist.com/ are well worth looking at.

Also, Scriptimus Prime is another MDT favourite https://scriptimus.wordpress.com/

Edited by jtotheb
  • Thanks 1
Posted

Hi,

 

Thank you, I'll give those a read. Sorry I should have specified, I was looking for it to do this unattended. We have 300/400 machines and sometimes we do this in bulk so having to manually put the computer name isn't preferable.

 

Using the database, would I be able to make MDT query for a unique part of a machine such as the MAC address and then use this to fill in the computer name, OU, etc?

 

Thanks.

Posted

Depending on the firmware of your computers (with use Lenovo) you can send a WOL packet to start the PC’s,then setup windows deployment services to auto respond (without having to press f12) if you have WDS setup with its database it works like a dream using MAC address to identify the computer and assign the computers name.

I have this setup and re-image the whole site each year with the latest version of Windows, I use WDS to identify the model of the computer and send just the relevant drivers to the computer.

It has been a lot of work and research to get it working but it’s worked very well.

Our next step will be to move our deployment share to a DFS share so that the WDS server is not doing all the work.

Posted

I've always pre-staged the computers in AD and used WDS with %MACHINENAME% in the answer file for computer name. Computer accounts that have been staged only need it to be done once. The script uses a CSV with two columns that associates MAC addresses with the name. I got that information from the DHCP logs before imaging labs. Don't know if this applies to MDT though.

 

 

Script not my own - found somewhere on the net.

 

   # V3.0
   # Changes:
   #    No longer relies on Quest AD Snap in
   #    No longer uses the kludgey Test-XADObject to validate the existence of computers in AD
    
   import-module activedirectory
    
   import-csv "c:\computers.csv" | foreach-object{ #imports CSV containing Name and MAC headings
    
       $name = $_.Name
       $MAC = $_.Mac  
      
       $CheckExists = get-adobject -Filter {(ObjectClass -eq "computer") -and (Name -eq $name)}  #Will be $NULL if this is a new computer
      
          
       if ($CheckExists -eq $NULL){
           [guid]$nbGUID = "00000000-0000-0000-0000-$MAC"  #casts 0s + MAC into a GUID, which is required for the netbootGUID property
           new-adcomputer -Name $name -SamAccountName $name -OtherAttributes @{'netbootGUID'=$nbGUID}        
           write-host $name " - " $nbGUID
         }
         else {
           write-host "$name already exists."
           }
          
   }

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