none
MDT 2012 - pull computername from database RRS feed

  • Question

  • Hi

    I have read most of the posts on Technet regarding this but havent found an answer...

    I have a database setup using TCPIP (cant use named pipes in my envrionment). It is populated with my test PC (serial No, MAC, UUID and Description).

    Here is my cs.ini:

    [Settings]
    Priority=CSettings, CPackages, CApps, CAdmins, CRoles, Locations, LSettings, LPackages, LApps, LAdmins, LRoles, MMSettings, MMPackages, MMApps, MMAdmins, MMRoles, RSettings, RPackages, RApps, RAdmins, Default
    Properties=MyCustomProperty,ComputerName
    EventService=http://MDTSERVER:9800
    
    
    [Default]
    _SMSTSORGNAME=Slaughter and May
    OSInstall=Yes
    SkipCapture=YES
    SkipAdminPassword=YES
    SkipProductKey=YES
    SkipComputerBackup=YES
    SkipBitLocker=YES
    SkipUserData=Yes
    SkipDomainMembership=Yes
    SkipLocaleSelection=Yes
    SkipComputerName=Yes
    UILanguage=en-US
    userLocale=en-GB
    keyboardLocale=en-GB
    SkipTimeZone=Yes
    TimeZoneName=GMT Standard Time
    SkipSummary=Yes
    EventService=http://MDTSERVER:9800
    ComputerName=%ComputerName%
    OSDComputerName=%ComputerName%
    
    
    
    
    [Computers] 
    SQLSERVER=SQLSERVER
    Database=MDTDB
    NetLib=DBMSSOCN
    DBID=SQLUSER
    DBPWD=SQLPASSWORD
    Table=ComputerIdentity
    Parameters=ID, Description, MacAddress, UUID
    ParameterCondition=OR
    
    [CSettings]
    SQLServer=SQLSERVER
    Database=MDTDB
    Netlib=DBMSSOCN
    SQLShare=DeploymentShare$
    DBID=SQLUSER
    DBPWD=SQLPASSWORD
    Table=ComputerSettings
    Parameters=UUID, AssetTag, SerialNumber, MacAddress
    ParameterCondition=OR
    

    We only do Rebuilds here, no refreshes run from desktop. All of our images are triggered by PXE. I need a way to pull the computer name from the database, based on the UUID/MAC/Serial whatever, into the build. I have tried the above with my TS and it always gets called MININT-XXXXX no matter what. I have also tried to set the task sequence variable OSDCOMPUTERNAME to %computername%, but this doesnt seem to work either.

    Monday, August 5, 2013 2:28 PM

Answers

  • If you are always deploying by PXE, then MDT treats this as a new computer and uses the WinPE standard MININT-XXXXX as the computer name. To pull the computer name from the MDT database you have to import the computer information into the database, not by using properties in the customsettings.ini. Take a look at this article:

    http://www.windowsnetworking.com/articles-tutorials/windows-7/Deploying-Windows-7-Part16.html


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

    Monday, August 5, 2013 8:10 PM
  • Hi Stealthgeek,

    First, remove all the lines under [Default] and set them in the database. Depending on the priority they can override the database.

    Next, get the UUID or MAC address of a pc and use them to target a PC in the database. From then you can set values for that machine.


    Blog: http://scriptimus.wordpress.com

    Monday, August 5, 2013 8:38 PM
  • Right, you need a computer record in the database to key off of. In the MDT console under advanced Configuration, Database, Computers. Right click and create a new record, using at least one of (I only use one) Asset tag, UUID serial number or MAC address.

    When the MDT process starts, it will gather the hardware info, and query the database for a match, if it finds one, it will use the values you've specified in the computer record.

    *Usually* database settings override customsettings.ini, but Andrew is right, if you've screwed up something somewhere else, it may get it from the ini files.

    In fact, the process is all about the hierarchy. Out of the box, Computer records will take precedence over location records, over Make and Model, which override the Roles, over the customsettings.ini, which overrides defaults.

    This line:

    Priority=CSettings, CPackages, CApps, CAdmins, CRoles, Locations, LSettings, LPackages, LApps, LAdmins, LRoles, MMSettings, MMPackages, MMApps, MMAdmins, MMRoles, RSettings, RPackages, RApps, RAdmins, Default

    controls that. Those are the queries and the order they run in. Any you delete from there won't run.

    and get rid of ComputerName here, you don't need it.
    Properties
    =MyCustomProperty,ComputerName

    • Marked as answer by stealthgeek Tuesday, August 6, 2013 1:22 PM
    Monday, August 5, 2013 9:20 PM

All replies

  • If you are always deploying by PXE, then MDT treats this as a new computer and uses the WinPE standard MININT-XXXXX as the computer name. To pull the computer name from the MDT database you have to import the computer information into the database, not by using properties in the customsettings.ini. Take a look at this article:

    http://www.windowsnetworking.com/articles-tutorials/windows-7/Deploying-Windows-7-Part16.html


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

    Monday, August 5, 2013 8:10 PM
  • Hi Stealthgeek,

    First, remove all the lines under [Default] and set them in the database. Depending on the priority they can override the database.

    Next, get the UUID or MAC address of a pc and use them to target a PC in the database. From then you can set values for that machine.


    Blog: http://scriptimus.wordpress.com

    Monday, August 5, 2013 8:38 PM
  • Right, you need a computer record in the database to key off of. In the MDT console under advanced Configuration, Database, Computers. Right click and create a new record, using at least one of (I only use one) Asset tag, UUID serial number or MAC address.

    When the MDT process starts, it will gather the hardware info, and query the database for a match, if it finds one, it will use the values you've specified in the computer record.

    *Usually* database settings override customsettings.ini, but Andrew is right, if you've screwed up something somewhere else, it may get it from the ini files.

    In fact, the process is all about the hierarchy. Out of the box, Computer records will take precedence over location records, over Make and Model, which override the Roles, over the customsettings.ini, which overrides defaults.

    This line:

    Priority=CSettings, CPackages, CApps, CAdmins, CRoles, Locations, LSettings, LPackages, LApps, LAdmins, LRoles, MMSettings, MMPackages, MMApps, MMAdmins, MMRoles, RSettings, RPackages, RApps, RAdmins, Default

    controls that. Those are the queries and the order they run in. Any you delete from there won't run.

    and get rid of ComputerName here, you don't need it.
    Properties
    =MyCustomProperty,ComputerName

    • Marked as answer by stealthgeek Tuesday, August 6, 2013 1:22 PM
    Monday, August 5, 2013 9:20 PM
  • OK, here is my updated cs.ini:

    [Settings]
    Priority=CSettings, CPackages, CApps, CAdmins, CRoles, Locations, LSettings, LPackages, LApps, LAdmins, LRoles, MMSettings, MMPackages, MMApps, MMAdmins, MMRoles, RSettings, RPackages, RApps, RAdmins, Default
    Properties=MyCustomProperty
    EventService=http://MDTSERVER:9800
    
    
    [Default]
    EventService=http://MDTSERVER:9800
    
    [Computers] 
    SQLSERVER=SQLSERVER
    Database=MDTDATABASE
    NetLib=DBMSSOCN
    DBID=MDTUSER
    DBPWD=MDTPASSWORD
    Table=ComputerIdentity
    Parameters=ID, Description, MacAddress, UUID
    ParameterCondition=OR
    
    ....

    The other sections have been omitted, but are the defaults. I have updated the share and replaced the WDS boot image as well.

    I still get MININT-XXXXX when imaging, despite entering the details into the computer record. Database querys must be working, as I have specified a certain Task Sequence in the computer record.

    However, computer name is not being set. I have set OSDComputerName to the actual hostname I want, I have left the ComputerName field null, since it says it is deprecated. I have a null string written in the unattend.xml also if this is relevant?

    Thanks

     

     


    • Edited by stealthgeek Tuesday, August 6, 2013 10:07 AM
    Tuesday, August 6, 2013 9:47 AM
  • Thats odd, it appears to be working on the 2nd/3rd runs after making these changes....!

    Thanks!

    Tuesday, August 6, 2013 1:21 PM
  • Also a little confused about the section you have pasted. [Computers]

    I've upgraded my install from 2010, so maybe I have different settings, but I don't have a [Computers] query. My Computer settings are controlled by CSettings, thusly:

    [CSettings]
    SQLServer=MyServer
    Instance=MyInstance
    Port=14331
    Database=MSMDT
    Netlib=DBMSSOCN
    Table=ComputerSettings
    Parameters=UUID, AssetTag, SerialNumber, MacAddress
    ParameterCondition=OR
    DBID=MDTUSER
    DBPWD=P@ssw0rd

    Tuesday, August 6, 2013 3:51 PM