• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

AD Join Issue Using Script and Answer File

Scheduled Pinned Locked Moved Solved
Windows Problems
2
2
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    Raj G
    last edited by Apr 21, 2017, 6:25 PM

    Server
    • FOG Version: 1.3.0-RC-8
    • OS: CentOS (don’t remember what version)
    Client
    • Service Version: v0.11.5
    • OS: Windows 10
    Description

    So I am using the following script post download for builds for one of my clients:

    #!/bin/bash
    hostadpwd="ADPASSHERE"; #only downside to this method- this is the plain ad password
    unattend="/ntfs/Windows/Panther/unattend.xml";
    [[ ! -f $unattend ]] && return
    dots "Preparing Sysprep File"
    rm -f /ntfs/Windows/System32/sysprep/unattend.xml >/dev/null 2>&1
    if [[ ! $? -eq 0 ]]; then
        echo "Failed"
        debugPause
        handleError "Failed to remove original unattend file"
    fi
    echo "Done"
    debugPause
    dots "Writing Computer Name"
    sed -i "/ComputerName/s/*/$hostname/g" $unattend >/dev/null 2>&1
    if [[ ! $? -eq 0 ]]; then
        echo "Failed"
        debugPause
        handleError "Failed to update originating unattend file"
    fi
    echo "Done"
    echo "ComputerName set to $hostname"
    debugPause
    [[ -z $addomain ]] && return
    dots "Set PC to join the domain"
    sed -i "/<JoinWorkgroup>/d" $unattend >/dev/null 2>&1
    if [[ ! $? -eq 0 ]]; then
        echo "Failed"
        debugPause
        handleError "Failed to remove the Workgroup setter"
    fi
    sed -i \
        -e "s|<Password></Password>|<Password>${hostadpwd}</Password>|g" \
        -e "s|<Username></Username>|<Username>${addomain}\\\\${aduser}</Username>|g" \
        -e "s|<MachineObjectOU></MachineObjectOU>|<MachineObjectOU>${adou}</MachineObjectOU>|g" \
        -e "s|<JoinDomain></JoinDomain>|<JoinDomain>${addomain}</JoinDomain>|g" $unattend >/dev/null 2>&1
    if [[ ! $? -eq 0 ]]; then
        echo "Failed"
        debugPause
        handleError "Failed to update user, pass, ou, and domain setter"
    fi
    echo "Done"
    debugPause
    

    So one question with this: where I have the AD password listed, would that have to be the domain Administrator account’s password or the password for any account that has admin rights (e.g. the main support account that I use).

    I also remember reading as follows from one of the tutorials that my Answer file (unattend.xml) needed to include the following:

    <JoinWorkgroup>Workgroup</JoinWorkgroup>
    <Credentials>
    <Password></Password>
    <Username></Username>
    </Credentials>
    <JoinDomain></JoinDomain>
    <MachineObjectOU></MachineObjectOU>
    

    Silly question, but under what section in the Answer File would I need to put that?

    Thanks!

    L 1 Reply Last reply Apr 21, 2017, 11:05 PM Reply Quote 0
    • L
      Lee Rowlett Developer @Raj G
      last edited by Lee Rowlett Apr 21, 2017, 5:05 PM Apr 21, 2017, 11:05 PM

      @Raj-G under <settings pass=“specialize”>

      <component name=“Microsoft-Windows-UnattendedJoin” processorArchitecture=“amd64” publicKeyToken=“31bf3856ad364e35” language=“neutral” versionScope=“nonSxS” xmlns:wcm=“http://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
      <Identification>
      <JoinWorkgroup>Workgroup</JoinWorkgroup>
      <Credentials>
      <Password></Password>
      <Username></Username>
      </Credentials>
      <JoinDomain></JoinDomain>
      <MachineObjectOU></MachineObjectOU>
      </Identification>
      </component>

      the above is for 64-bit… if you’re ever unsure use WAIK to generate your unattend file for you if you don’t feel comfortable doing it manually

      1 Reply Last reply Reply Quote 2
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post

      169

      Online

      12.0k

      Users

      17.3k

      Topics

      155.2k

      Posts
      Copyright © 2012-2024 FOG Project