none
Choose on deployment if computer should join domain or workgroup

    Question

  • Hi!

    I'm having issues with something I thought should be very smart. The possiblity to choose in the start of a specific deployment if the computer should join our domain or just stay in a workgroup.


    If I blank out every domain settings in [W10X64-1803] it will join the workgroup Ive specified, but if not, it will somewhere in postinstall join the domain with name as configured. I want it to stay in the workgroup.

    I would also love a tip on how to set specific tasks in the TS for if the computer is in the domain or in the workgroup.

    Anyone who has a solution for this?

    Under you can see my two CustomSettings.ini files.

    CustomSetting:
    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, Model, SetAlias, Default
    Properties=MyCustomProperty, ModelAlias, MakeAlias, MacAlias, SMBIOSBIOSVersion, ComputerLocationName, ComputerTypeName

    [DefaultGateway]
    10.247.10.1=NORWAY

    [NORWAY]
    ComputerLocationName=no

    [ByLaptopType]
    Subsection=Laptop-%IsLaptop%

    [Laptop-True]
    ComputerTypeName=lt

    [ByDesktopType]
    Subsection=Desktop-%IsDesktop%

    [Desktop-True]
    ComputerTypeName=ws

    [HP Elite x2 1012 G1 Tablet]
    ComputerTypeName=tablet

    [Surface Pro 4]
    ComputerTypeName=surface

    [SetAlias]
    UserExit=AliasUserExit.vbs
    MakeAlias=#SetMakeAlias()#
    ModelAlias=#SetModelAlias()#
    SMBIOSBIOSVersion=#SetSMBIOSBIOSVersion()#
    MacAlias=#SetMacAlias()#

    [MAKE]
    DriverSelectionProfile=Nothing
    DriverGroup001=%Model%

    [Default]
    OSDComputername=%ComputerLocationName%-%ComputerTypeName%-
    _SMSTSORGNAME=DOMAIN - %TaskSequenceID% on %OSDComputername%


    BitsPerPel=32
    VRefresh=60
    XResolution=1
    YResolution=1
    OSInstall=Y
    SkipBDDWelcome=YES
    KeyboardLocale=nb-NO
    UserLocale=nb-NO
    UILanguage=nb-NO
    AdminPassword=P@ssw0rd
    SkipAppsOnUpgrade=NO
    SkipAdminPassword=YES
    SkipProductKey=YES
    SkipComputerName=NO
    SkipUserData=YES
    SkipLocaleSelection=YES
    SkipTaskSequence=NO
    SkipTimeZone=YES
    SkipBitLocker=YES
    SkipSummary=YES
    SkipCapture=YES
    SkipApplications=YES
    DoCapture=NO
    ComputerBackupLocation=\\MDTSERVER\MDTProduction$\captures


    SkipFinalSummary=YES
    TimeZone=110
    TimeZoneName=W. Europe Standard Time
    WSUSServer=http://MDTSERVER.DOMAIN.com:8530

    Home_page=http://www.DOMAIN.no
    EventService=http://MDTSERVER:9800

    CustomSettingWG.ini:
    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, TaskSequenceID, Model, Default
    Properties=MyCustomProperty, ComputerLocationName, ComputerTypeName

    [Default]
    SkipDomainMembership=YES
    JoinDomain=DOMAIN.com
    DomainAdmin=%ComputerLocationName%-MDT_join 
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=DOMAIN.com
    MachineObjectOU=ou=MDT,ou=%ComputerLocationName%,ou=Corp,dc=DOMAIN,dc=com

    [W10X64-1803O]
    SkipDomainMembership=YES
    JoinDomain=DOMAIN.com
    DomainAdmin=%ComputerLocationName%-MDT_join 
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=DOMAIN.com
    MachineObjectOU=ou=MDT,ou=%ComputerLocationName%,ou=Corp,dc=DOMAIN,dc=com

    [W10X64-1803]
    SkipDomainMembership=NO
    JoinDomain=DOMAIN.com
    DomainAdmin=%ComputerLocationName%-MDT_join 
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=DOMAIN.com
    MachineObjectOU=ou=MDT,ou=%ComputerLocationName%,ou=Corp,dc=DOMAIN,dc=com
    JoinWorkGroup=WORKGROUPNAME

    Some screendumpts:


    Tuesday, August 28, 2018 12:22 PM

All replies

  • I would also love to add actions to the TS that will run based on JoinDomain or JoinWorkgroup.

    Tuesday, August 28, 2018 1:36 PM
  • In the without office TS section, you have SkipDomainMembership=NO.  That is only for the Wizard.  Since all those Domain Join settings are listed, it sees the appropriate information to join the domain.  You will need to remove the following Variables and their settings from the Without office TS Section.

    JoinDomain
    DomainAdmin
    DomainAdminPassword
    DomainAdminDomain
    MachineObjectOU

    I believe that you can leave SkipDomainMembership set to YES and also leave JoinWorkGroup=WorkgroupName.

    LawsonT

    Tuesday, August 28, 2018 2:06 PM
  • FYI using by TaskSequenceID doesn't work without modification because rules are processed before you choose your task sequence. You can however set those properties in the task sequence itself.

    In this pictured example I override the finish action and OU location in the Task Sequence itself. You can of course add any other property as well.

    

    The properties you set in the task sequence will override what is specified in customsettings.ini. Here's the list in which priority is given starting from the bottom up:

    1. Unattend.xml is given lowest priority
    2. CustomSettings.ini will override Unattend.xml
    3. Database will take precedence over both CustomSettings and Unattend
    4. Task Sequence Variables are king and will override all others

    So in your case you could make a task sequence for domain computers in which you set JoinDomain and MachineObjectOU variables. It's okay to specify JoinWorkgroup in default of customsettings since the task sequence variable will override that.


    Daniel Vega


    • Edited by Dan_Vega Tuesday, August 28, 2018 2:42 PM
    Tuesday, August 28, 2018 2:41 PM
  • The problem isn't getting the computer to join the Workgroup if i blank out/remove the domain config. I would like to be able to choose from the wizard if this computer should join the domain or go in to the Workgroup. Rather than having to identatical TS to maintain, just having one.
    Tuesday, August 28, 2018 2:53 PM
  • FYI using by TaskSequenceID does work. But not how I want it to work in the scenario. If I blank out/remove the domain configuration of W10X64-1803 it will automatically be in the Workgroup, but and the other TS W10X64-1803O will automatically join the domain. The problem is that I want to have an option in the wizard for 1 TS to either join a domain or be in a Workgroup. Rather than have to maintain 2 TS's.
    Tuesday, August 28, 2018 2:56 PM
  • If you want to choose whether to join to the domain or to the workgroup, as you stated, I thought by default you get that choice in your CS.INI. Here is a sample of mine. During the Wizard, I'm prompted to join the domain or workgroup. Maybe I'm not getting your scenario fully.

    [Settings]
    Priority=Default

    [Win7E 64]
    DriverGroup001=Windows 7\x64\%Model%
    DriverSelectionProfile=Nothing

    [Default]
    _SMSTSORGNAME=your info
    _SMSTSPackageName=%TaskSequenceName%
    OSInstall=Y
    SkipAppsOnUpgrade=NO
    SkipAdminPassword=YES
    SkipProductKey=YES
    SkipComputerName=NO
    SkipComputerBackup=YES
    SkipDomainMembership=NO
    SkipUserData=YES
    SkipLocaleSelection=YES
    SkipTaskSequence=NO
    SkipTimeZone=YES
    SkipApplications=NO
    SkipBitLocker=YES
    SkipSummary=YES
    SkipBDDWelcome=NO
    SkipCapture=YES
    SkipFinalSummary=NO
    TimeZone=020
    TimeZoneName=Central Standard Time


    JoinDomain=yours
    DomainAdmin=name of admin
    DomainAdminDomain=yours
    DomainAdminPassword= whatever that is
    MachineObjectOU=OU=your OU

    FinishAction=Reboot

    Not sure if this is what you're looking for. This allows me to either join to the domain or a WG.

    Tuesday, August 28, 2018 3:05 PM
  • It's not working if you have to blank out the value. If you want only one TS then do not specify those values using by TaskSequenceID

    Specify both the domain and workgroup info but do not skip that page in the wizard. Then when the wizard shows the domain/workgroup page you can use the radio button to either select domain or workgroup and the info will already be filled in.

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, Model, Default
    Properties=MyCustomProperty, ComputerLocationName, ComputerTypeName

    [Default]
    SkipDomainMembership=NO
    JoinDomain=domain.com
    DomainAdmin=MDT 
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=domain.com
    MachineObjectOU=ou=MDT,ou,ou=Corp,dc=domain,dc=com
    JoinWorkGroup=WorkGroupName


    Daniel Vega

    Tuesday, August 28, 2018 3:07 PM
  • If i choose Workgroup in the wizard because of "SkipDomainMembership=NO" it still joins the domain. That's my issue. And i can't figure out why. Since that's in the default part of Your's it's basically the same as when i choose Workgroup instead of domain here:

    [W10X64-1803] ; Without office
    SkipDomainMembership=NO
    JoinDomain=domain.com
    DomainAdmin=MDT
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=domain.com
    MachineObjectOU=ou=MDT,ou=Corp,dc=domain,dc=com
    JoinWorkGroup=WorkGroupName
    Tuesday, August 28, 2018 3:10 PM
  • Then you need to look at where the value is coming from. It's being applied from either a database or the task sequence itself.

    1. Unattend.xml is given lowest priority
    2. CustomSettings.ini will override Unattend.xml
    3. Database will take precedence over both CustomSettings and Unattend
    4. Task Sequence Variables are king and will override all others

    You can look at your logs to see when that value changes.


    Daniel Vega

    Tuesday, August 28, 2018 3:17 PM
  • Can you share a copy of the log file? Looking over it well help.

    Daniel Vega

    Tuesday, August 28, 2018 3:19 PM
  • Yes ofc. Which log do you want?
    Wednesday, August 29, 2018 7:28 AM
  • Bdd.log would be a good place to start. Upload it OneDrive or similar and share the link here. Do not copy and paste the contents of the log as a reply.

    Daniel Vega

    Wednesday, August 29, 2018 1:48 PM
  • I took everything for %windir%\temp\DeploymentLogs:

    https://www.dropbox.com/sh/87tlbacpbn429d8/AACLiMr66vJZfdgLEM8prGb_a?dl=0

    Btw: I've updated the first post.

    Wednesday, August 29, 2018 1:54 PM
  • So now that I see all the extra info you've added, it all makes sense for your setup.

    You can't do exactly what you are trying to do. That is, if you're going to have it process a different set of rules once the task sequence starts to run, you simply cannot specify both the domain and workgroup information.

    Doing so works only if it is specified in default because you would then choose if you wanted domain or workgroup during the wizard. You need to remove those properties from the TASKIDs in your CustomSettingWG.ini

    SkipDomainMembership=
    JoinDomain=
    DomainAdmin=
    DomainAdminPassword=
    DomainAdminDomain=
    MachineObjectOU=
    JoinWorkGroup=
    You are essentially replacing what was set in the wizard by processing a new set of rules once the task sequence runs.


    Daniel Vega

    Wednesday, August 29, 2018 2:01 PM
  • What if I do it like this? Would this do the trick?

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, TaskSequenceID, Model, Default
    Properties=MyCustomProperty, ComputerLocationName, ComputerTypeName

    [Default]
    SkipDomainMembership=YES
    JoinDomain=DOMAIN.com
    DomainAdmin=%ComputerLocationName%-MDT_join 
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=DOMAIN.com
    MachineObjectOU=ou=MDT,ou=%ComputerLocationName%,ou=Corp,dc=DOMAIN,dc=com
    JoinWorkGroup=WORKGROUPNAME

    [W10X64-1803O]
    SkipDomainMembership=YES


    [W10X64-1803]
    SkipDomainMembership=NO

    Wednesday, August 29, 2018 2:14 PM
  • What if I do it like this? Would this do the trick?

    [Settings]
    Priority=DefaultGateway, ByLaptopType, ByDesktopType, TaskSequenceID, Model, Default
    Properties=MyCustomProperty, ComputerLocationName, ComputerTypeName

    [Default]
    SkipDomainMembership=YES
    JoinDomain=DOMAIN.com
    DomainAdmin=%ComputerLocationName%-MDT_join 
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=DOMAIN.com
    MachineObjectOU=ou=MDT,ou=%ComputerLocationName%,ou=Corp,dc=DOMAIN,dc=com
    JoinWorkGroup=WORKGROUPNAME

    [W10X64-1803O]
    SkipDomainMembership=YES


    [W10X64-1803]
    SkipDomainMembership=NO

    Yes, that should work out for you.

    Daniel Vega

    Wednesday, August 29, 2018 2:33 PM
  • No it did'nt :( It joined the domain even if I checked for Workgroup.
    Wednesday, August 29, 2018 2:40 PM
  • Hmm, replace your uploaded log file with this new one. I'll take a look as soon as I have time. Right now I'm busy with my day job.

    Daniel Vega

    Wednesday, August 29, 2018 2:48 PM
  • In the custom settings you have here, where you have SkipDomainMembership=YES or NO, that only controls what you see on the Wizard.  It does not actually control functionality in the Task Sequence of whether a domain join occurs.  MDT Reference on SkipDomainMembership.

    In your OP, you now have 5 pictures.  Picture #3 has computer name and domain membership information.  SkipDomainMembership will toggle the visibility of all the boxes below Computer Name.  In your [Default] Section, you have SkipDomainMembership = YES and then you have defined all of the settings.  It will run those.

    To do what you are asking, you will need an additional Wizard page to allow the user to make a radio selection of Add to Domain XXXXX.com or Add to WorkGroup WorkyGroupy.  On the background scripting for that Wizard Page, you would need one TS var that you interact with.  Call it DomainOrWorkGroup  If they check Domain set the value to Domain, if they choose WorkGroup, set to WorkGroup.  In your single TS, you can have two groups at the beginning of the TS that has DomainOrWorkGroup as the condition.  One group is called DomainJoin (If DomainOrWorkgroup = Domain), one is called WorkGroup (If DomainorWorkgroup = WorkGroup).  In the DomainJoin group, set each TS var for what is needed to join domain (JoinDomain, DomainAdmin, DomainAdminPassword, DomainAdminDomain,MachineObjectOU)  In the WorkGroup group, set the TS var for what is needed for joining a workgroup (JoinWorkGroup). In the CustomSettings.ini, you will need to remove the join domain variables, but leave SkipDomainJoin = YES.  You will also need to add DomainOrWorkGroup to the Properties line to declare it as a new TS Variable.

    LawsonT

    Thursday, August 30, 2018 3:07 AM
  • I've uploaded the logs to the same folder in a subfolder called v.2. And moved the first logs in to v.1 to comparing.

    Thursday, August 30, 2018 7:44 AM
  • Hi Lawson,

    Thank you for your feedback. Do you have any instructing manual on how I make an additional Wizard page with those radiobuttons? I`m kind of new to this.

    Thursday, August 30, 2018 10:20 AM
  • Good catch Lawson, I missed the 

    [Default]
    SkipDomainMembership=YES

    It needs to be set to NO so that you get the option to choose in the wizard. Yesterday was a very busy day for me.


    Daniel Vega

    Thursday, August 30, 2018 1:17 PM
  • @Aksel Fjetland,

    No, I did quite a bit of guess work when I was making wizard pages in the past.  It is a bit of a self taught piece of the MDT puzzle.

    LawsonT

    Wednesday, September 5, 2018 2:29 AM
  • @Aksel Fjetland,

    Here is a link to One Drive where you can get three files.
    DeployWiz_CustomSelectJDorWG.vbs
    DeployWiz_CustomSelectJDorWG.xml
    DeployWiz_Definition_ENU.xml

    The DeployWiz_CustomSelectJDorWG.vbs script holds the initialization and validation functions for the Wizard page.
    The DeployWiz_CustomSelectJDorWG.xml holds the information about the actual wizard page.  it isnt overly complex.
    the DeployWiz_Definition_ENU.xml will replace your current one.  I recommend you take the current one and back it up / rename it to .old or whatever.  This .xml file holds the order of panes and what xml file to display the pane.

    In your CustomSettings.ini, in the Properties line, add DomainOrWorkGroup as a new variable.

    In your CustomSettings.ini, comment out the following properties/variables.
    JoinDomain=DOMAIN.com
    DomainAdmin=%ComputerLocationName%-MDT_join 
    DomainAdminPassword=P@ssw0rd
    DomainAdminDomain=DOMAIN.com
    MachineObjectOU=ou=MDT,ou=%ComputerLocationName%,ou=Corp,dc=DOMAIN,dc=com
    JoinWorkGroup=WORKGROUPNAME

    In your CustomSettings.ini, make sure that SkipDomainMembership is set to YES.

    In your Task Sequence, in PreInstall, create two new groups; one named Join Domain and one named Join WorkGroup.
    On the Join Domain group, select the Options tab and create a condition that is a Task Sequence variable DomainOrWorkGroup equals Domain
    In the Join Domain group, create 5 Set Task Sequence Variable Tasks
    JoinDomain
    DomainAdminDomain
    DomainAdminPassword
    DomainAdmin
    MachineObjectOU
    and set them to the appropriate values.

    On the Join WorkGroup group, select the Options tab and create a condition that is a Task Sequence variable DomainOrWorkGroup equals WorkGroup
    In the Join Domain group, create 1 Set Task Sequence Variable Task
    JoinWorkGroup
    and set the appropriate value.

    Deploy and see if it works.  If not, roll back these changes and pretend I didnt do this.  :)

    Wednesday, September 5, 2018 4:07 AM
  • Hi Lawson!

    Thank you so much.

    It worked. But i'm experiencing some issue, all tasks that were skipped can no longer be skipped:

    SkipAppsOnUpgrade=NO
    SkipAdminPassword=YES
    SkipProductKey=YES
    SkipComputerName=NO
    SkipUserData=YES
    SkipLocaleSelection=YES
    SkipTaskSequence=NO
    SkipTimeZone=YES
    SkipBitLocker=YES
    SkipSummary=YES
    SkipCapture=YES
    SkipApplications=YES
    DoCapture=NO

    But when I check your DeployWiz_Definition_ENU.xml against the original I find that between the <Pane> and </Pane> are stuff missing. So I should just add that propably?

    Also, it's not joining the workgroup i specified in the TS. It joins "Workgroup".

    BTW: For installation of settings and programs when not joining the domain I Guess I can use:

    Task Sequence variable DomainOrWorkGroup equals WorkGroup

    Thanks in advance!

    Thursday, September 6, 2018 9:50 AM
  • I've fixed the wizard pages, but it won't join the domain. And the Workgroup is still just "WORKGROUP" and not the name I've set it to.

    And how can I hide this wizard page for every TS but the one that should have this option?

    Any suggestions?


    Friday, September 7, 2018 8:14 AM
  • Hi!

    Do you have any suggestions on what can have happend here?

    Thursday, October 4, 2018 9:26 AM
  • If you look at your ready page screenshot you have JoinWorkgroup=WORKGROUP. So it will join a work group called that. If you still have "JoinWorkgroup=WORKGROUP" in your customsettings.ini file you need to comment that out or it will always join a workgroup.

    If it is going to join the domain then you should see the line for "JoinDomain=" in your ready page in the wizard and not "JoinWorkgroup=". You need to make sure those wizard pages are displayed so you can enter your information.

    Wednesday, October 10, 2018 4:40 PM