none
Set Regional Settings based on part of OSDComputerName

    Question

  • So in this thread: DomainJoin based on Location and ComputerType I have received great help from 'The One' Johan Arwidmark. And thanks to David DCtheGeek I finally managed to get things working.

    However my challenge has been extended by the desire to set the following settings:

    CountryOU=
    InputLocale=
    KeyBoardLocale=
    UserLocale=
    TimeZone=
    TimeZoneName=

    ..based on the first two characters of the Hostname, since the first to letters indicate the Computers location, for example: "NL" would be Netherlands, which would require to set the following task sequence values:

    CountryOU=NL
    InputLocale=0409:00020409
    KeyBoardLocale=nl-US
    UserLocale=nl-NL
    TimeZone=110
    TimeZoneName=W. Europe Standard Time

    So now my customsettings.ini looks like this:

    [Settings]
    Priority=OSDComputerName,DefaultGateway,ByModel,ByLaptopType,ByDesktopType,Locations,CSettings,LSettings,MACAddress,Default
    Properties=CountryOU
    
    [OSDComputerName]
    "FR%"=FR
    "DE%"=DE
    "NL%"=NL
    "ES%"=ES
    "GB%"=GB
    
    #[DefaultGateway]
    #10.141.1.1=FR
    #10.143.1.1=DE
    #10.145.1.1=NL
    #10.147.1.1=ES
    #10.149.1.1=GB
    
    [DE]
    CountryOU=DE
    InputLocale=0407:00000407
    KeyBoardLocale=de-DE
    UserLocale=de-DE
    TimeZone=110
    TimeZoneName=W. Europe Standard Time
    
    [ES]
    CountryOU=ES
    InputLocale=040a:0000040a
    KeyBoardLocale=es-ES
    UserLocale=es-ES
    TimeZone=105
    TimeZoneName=Romance Standard Time
    
    [FR]
    CountryOU=FR
    InputLocale=040c:0000040c
    KeyBoardLocale=fr-FR
    UserLocale=fr-FR
    TimeZone=105
    TimeZoneName=Romance Standard Time
    
    [GB]
    CountryOU=GB
    InputLocale=0809:00000809
    KeyBoardLocale=en-GB
    UserLocale=en-GB
    TimeZone=085
    TimeZoneName=GMT Standard Time
    
    [NL]
    CountryOU=NL
    InputLocale=0409:00020409
    KeyBoardLocale=nl-US
    UserLocale=nl-NL
    TimeZone=110
    TimeZoneName=W. Europe Standard Time
    
    [ByModel]
    Subsection=Model-%Model%
    
    [Model-VMware Virtual Platform]
    MachineObjectOU=OU=%CountryOU%,Virtual,OU=orgname,DC=contoso,DC=com
    
    [ByLaptopType]
    Subsection=Laptop-%IsLaptop%
    
    [ByDesktopType]
    Subsection=Desktop-%IsDesktop%
    
    [Desktop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Desktop,OU=orgname,DC=contoso,DC=com
    
    [Laptop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Laptop,OU=orgname,DC=contoso,DC=com


    The "DefaultGateway" property is uncomment, since this the solution of the previous thread.

    Now I have defined the OSDComputerName

    [OSDComputerName]
    "FR%"=FR
    "DE%"=DE
    "NL%"=NL
    "ES%"=ES
    "GB%"=GB

    ..and was hoping this would work. But unfortunately it doesn't.

    I have found this thread, which describes the same issue, more or less: MDT, CustomSetting.ini, Subsection Based on OSDComputerName but I would have no clue how to approach this.

    I have the MDT Database up and running, but resolving this issue with locations and gateways doesn't solve my problem either, since Computers can be reïnstalled on other locations. So my one constant value is the first two letters of the hostname. I hope someone can help me out here. That would be much appreciated :)

    Many thanks in advance :)


    If this post is helpful please click "Mark for answer", thanks! Kind regards



    Thursday, June 20, 2013 4:43 PM

Answers

All replies

  • May I suggest a different approach I use in production?

    When booting into PE you should not skip the BDDWelcome.
    Instead use this PE language to determine the country settings.
    I am using the DefaultGateway property to distinguish between sites in the same country, but this is just necessary in one case.

    However this depends a bit on your whole situation if this a valid solution.

    Thursday, June 20, 2013 10:08 PM
  • Rens, with the logic you are trying to do, I think what you really want is a UserExit script.  Then you can effectively script all the hard logic decisions in VBScript and just call the functions from the CustomSettings.ini.  Mikael has a good example post and code over on his blog: http://deploymentbunny.com/2013/03/06/back-to-basiccustomsettings-inisample-2/


    David Coulter | http://DCtheGeek.blogspot.com | @DCtheGeek

    Friday, June 21, 2013 3:59 AM
  • First, you don't uncomment with #, you use ;

    Second, you can keep the defaultgateway and use something like this:

    [Settings]
    Priority=DefaultGateway, Default

    [Default]
    OSInstall=Y

    [DefaultGateway]
    192.168.10.1=COUNTRYA
    10.5.3.1=COUNTRYB

    [COUNTRYA]
    OSDComputerName=A-%SerialNumber%

    [COUNTRYB]
    OSDComputerName=B-%SerialNumber%

    If you want to more complex logic, you can as David Coulter mentioned, use a user exit script, or have a database, or a web service that have the logic.

    Either way, make sure note to waste time, and use a test Environment so that you can simulate your deployments

    Save time (and avoid pain) - Create a MDT test environment
    http://www.deploymentresearch.com/Blog/tabid/62/EntryId/22/Save-time-and-avoid-pain-Create-a-MDT-test-environment.aspx

    / Johan



    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: http://www.deploymentresearch.com FB: www.facebook.com/deploymentresearch

    Friday, June 21, 2013 6:39 AM
  • I have created a user exit script which is providing the properties for me. I will provide a respons with the solution as soon as I have the time to do this. Thanks a million both of you!

    If this post is helpful please click "Mark for answer", thanks! Kind regards

    Monday, July 01, 2013 11:11 AM