none
DomainJoin based on Location and ComputerType RRS feed

  • Question

  • Hi there,

    Currently I'm developing a new environment where the requirement is to Join objects to the domain based on Location and ComputerType.

    My MDT environment is connected to a database and I would like to approach this step as flexible and manageble as possible, so I'm overlooking my options here and possibly ask for advice from all of you MDT experts ;)

    So currently I have 5 locations defined:
    Country A
    Country B
    Country C
    Country D
    Country E

    ..which I can give each their own properties in the details:

    DomainAdmin
    DomainAdminDomain
    DomainPassword
    JoinDomain
    MachineObjectOU

    These properties will be set based on the matching Identity which is specified to be a specific gateway.

    Or I could specify these values to each separate computer by doing a mass-import in the SQL Database, this would be my last resort because that isn't really flexible and manageble either

    Or I can resolve this in my CustomSettings.ini
    For which I have now specified:

    SkipDomainMembership=YES
    NetworkLocation=Work
    JoinDomain=CONTOSO.COM
    DomainAdmin=
    DomainAdminDomain=CONTOSO
    DomainAdminPassword=

    [ByType]
    Subsection=Laptop-%IsLaptop%
    Subsection=Desktop-%IsDesktop%
    [Laptop-True]
    MachineObjectOU = "OU = CountryA,OU = Laptops,OU = CONTOSO,DC = CONTOSO,DC = COM"
    [Desktop-True]
    MachineObjectOU = "OU = CountryA,OU = Desktops,OU = CONTOSO,DC = CONTOSO,DC = COM"

    Or I could incorporate 10 steps, two steps per country which call a script with each different property's when it comes to Location and ComputerType and put conditions on these steps.

    So who's got a bright idea?



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


    Monday, June 3, 2013 7:58 PM

Answers

  • You can do that without the database, just identifying the subnets. This example works:

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, Default
    Properties=CountryOU

    [Default]
    OSInstall=Y
    JoinDomain=CONTOSO.COM
    DomainAdmin=CONTOSO\MDT_JD    
    DomainAdminPassword=P@ssw0rd

    [DefaultGateway]
    10.5.0.1=COUNTRYA
    10.5.3.1=COUNTRYB

    [COUNTRYA]
    CountryOU=COUNTRYA

    [COUNTRYB]
    CountryOU=COUNTRYB

    [ByLaptopType]
    Subsection=Laptop-%IsLaptop%

    [ByDesktopType]
    Subsection=Desktop-%IsDesktop%

    [Laptop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Laptops,OU=CONTOSO,DC=CONTOSO,DC=COM

    [Desktop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Desktops,OU=CONTOSO,DC=CONTOSO,DC=COM

    / Johan


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

    Tuesday, June 4, 2013 6:25 PM
    Moderator
  • I seem to recall something about custom properties working better when declared and I meant update the top of your CS.ini like this:

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, Locations, CSettings, LSettings, MACAddress, Default
    Properties=MyCustomProperty, CountryOU

    It's 6 AM and I haven't had coffee, so sorry if I wasn't clear. : )

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

    Tuesday, June 18, 2013 1:23 PM
    Answerer

All replies

  • If you have enough logic (and are trying to avoid the MDT Database), then maybe a UserExit script called from CustomSettings.ini?  This allows you to update it quickly and painlessly without needing to regenerate Boot Images or anything, but can apply the logic necessary via VBScript.  Mikael has an example in his blog post here: http://deploymentbunny.com/2013/03/06/back-to-basiccustomsettings-inisample-2/

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

    Monday, June 3, 2013 10:01 PM
    Answerer
  • Hi David,

    It's not that I want to avoid the database, I want to avoid mass-bulk actions, I just want to set rules and settings based on the options that I have given with keeping in mind that it needs to be as flexible possible.

    I will look into the link of deploymentbunny :)

    Thanks

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

    Tuesday, June 4, 2013 9:54 AM
  • You can do that without the database, just identifying the subnets. This example works:

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, Default
    Properties=CountryOU

    [Default]
    OSInstall=Y
    JoinDomain=CONTOSO.COM
    DomainAdmin=CONTOSO\MDT_JD    
    DomainAdminPassword=P@ssw0rd

    [DefaultGateway]
    10.5.0.1=COUNTRYA
    10.5.3.1=COUNTRYB

    [COUNTRYA]
    CountryOU=COUNTRYA

    [COUNTRYB]
    CountryOU=COUNTRYB

    [ByLaptopType]
    Subsection=Laptop-%IsLaptop%

    [ByDesktopType]
    Subsection=Desktop-%IsDesktop%

    [Laptop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Laptops,OU=CONTOSO,DC=CONTOSO,DC=COM

    [Desktop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Desktops,OU=CONTOSO,DC=CONTOSO,DC=COM

    / Johan


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

    Tuesday, June 4, 2013 6:25 PM
    Moderator
  • Hi Johan,

    Much appreciated, the database however is used for automatic resolving the hostname based on the mac-address. I will try what you have send me i.c.m. with my database and leave some feedback about how things are progressing.

    Once again many thanks :)

    Kind regards


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

    Tuesday, June 4, 2013 6:43 PM
  • So after some testing it still doesn't seem to work properly. Am I missing something here?

    My Customsettings.ini are like this:

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, Locations, CSettings, LSettings, MACAddress, Default
    Properties=MyCustomProperty
    
    [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
    
    [ES]
    CountryOU=ES
    
    [FR]
    CountryOU=FR
    
    [GB]
    CountryOU=GB
    
    [NL]
    CountryOU=NL
    
    [ByLaptopType]
    Subsection=Laptop-%IsLaptop%
    
    [ByDesktopType]
    Subsection=Desktop-%IsDesktop%
    
    [Desktop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Desktop,OU=CONTOSO,DC=CONTOSO,DC=COM
    
    [Laptop-True]
    MachineObjectOU=OU=%CountryOU%,OU=Laptop,OU=CONTOSO,DC=CONTOSO,DC=COM
    

    Any my logging shows the following:

    So what it seems to do, is process the rule in the NL section but does not apply the property defined at this section.

    Any thoughts?


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

    Tuesday, June 18, 2013 12:39 PM
  • What happens if you add CountryOU to the Properties list in the Settings segment?

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

    Tuesday, June 18, 2013 1:00 PM
    Answerer
  • Hi David,

    What do you mean, can you give me an example?


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

    Tuesday, June 18, 2013 1:11 PM
  • I seem to recall something about custom properties working better when declared and I meant update the top of your CS.ini like this:

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, Locations, CSettings, LSettings, MACAddress, Default
    Properties=MyCustomProperty, CountryOU

    It's 6 AM and I haven't had coffee, so sorry if I wasn't clear. : )

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

    Tuesday, June 18, 2013 1:23 PM
    Answerer
  • Ok thanks for your quick reply! Have a coffee on my expense, I'll report back in as soon as I have tested this property :)

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

    Tuesday, June 18, 2013 1:43 PM
  • This did the trick, together with the information Johan has provided.

    Thanks!


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

    Wednesday, June 19, 2013 12:54 PM