0

I was wondering if it’s possible to make an unattended Domain Join in Windows. Let’s say I have my computer object set up in my Active Directory. Each computer object has its own machine password. I was wondering ,even though it’s not possible to read out this password, if it’s possible to use an unattend.xml file or a script that allows my pc to join the domain because the pc name is set up in the AD, so it reads out the machine password and connects. Thanks for any answers

xmepl
  • 3

1 Answers1

0

It's possible to do that, similarly to what you describe.

This question has been asked in various posts. Here is an example unattend.xml fragment that you may modify as required, as it will at least show you one solution for doing this:

<FirstLogonCommands>
    <SynchronousCommand wcm:action="add">
        <CommandLine>ipconfig /registerdns</CommandLine>
        <Description>registerdns</Description>
        <Order>1</Order>
        <RequiresUserInput>true</RequiresUserInput>
    </SynchronousCommand>
    <SynchronousCommand wcm:action="add">
        <Description>Join Domain</Description>
        <Order>2</Order>
        <RequiresUserInput>true</RequiresUserInput>
        <CommandLine>CMD /C &quot;powershell add-computer -domainname domain.wan -cred (get-credential domain.wan\todomainuser) -newname (Read-Host \&quot;PC new name\&quot;) -passthru -verbose;sleep 8&quot;</CommandLine>
    </SynchronousCommand>
    <SynchronousCommand wcm:action="add">
        <CommandLine>CMD /C echo n | gpupdate /force</CommandLine>
        <Description>gpupdate /force</Description>
        <Order>3</Order>
        <RequiresUserInput>true</RequiresUserInput>
    </SynchronousCommand>
    <SynchronousCommand wcm:action="add">
        <CommandLine>wuauclt /resetauthorization /detectnow</CommandLine>
        <Description>Windows Update</Description>
        <Order>4</Order>
        <RequiresUserInput>false</RequiresUserInput>
    </SynchronousCommand>
</FirstLogonCommands>

You will need to change domain.wan\todomainuser to yours.

harrymc
  • 498,455