Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Domain join server 2012 using script and input for domain name

$
0
0

Ok, so here is the scenario. I am sending out a sysprepped server 2012 VHD to our remote offices. I have a powershell script that copies the vhd to a directory structure on the remote office's hyperV server, creates a VM and uses the VHD that was copied over for the HDD. It then powers on the VM. At this point the VM is not domain joined. Our remote offices have varying domains and I don't want to create an answer file for every possible domain. What i would like to do is have the VM power on and then have the initial powershell script that I use to create the VM ask for the domain name, convert that to a variable in the script, ($domain= Read-host "what is the name of your domain?), and then somehow have a command run that joins that new VM to the domain.

I am doing this because we want to be very light touch deployment of these machines.

Any ideas?

Thanks!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>