Search code examples
xmlwindowsheadlesspacker

How to add the search domain to a windows 8.1 autounattend.xml


I have a autunattend.xml file for a windows 8.1 installation with packer. This works actually ok, but it does not add to my search domain (I hope this is the right term).

So I have a VM at the end and when I try to connect to another machine in the network - lets call it foo - this is not working:

nslookp foo

which means, it cannot find the machine. Adding the domain to it does work though

nslookup foo.company.local

How can I add the domain company.local to the autounattend.xml so that the first call is working ?


Solution

  • you can try to add the following command in your autounattend.xml file

    <SynchronousCommand wcm:action="add">
         <Description>Set DNS Search Order</Description>
         <Order>99</Order>
         <CommandLine>cmd.exe /c wmic nicconfig call SetDNSSuffixSearchOrder (company.local,<add other if necessary separated by ,)</CommandLine>
    </SynchronousCommand>
    

    Just make sure the Order (here 99) does not conflict with an existing command from your script