Dynamic PowerShell Script to create new computer objects in Active directory

How would I go about creating a script to create new machine names in Active Directory? Now I have been reading online where scripts written would pull a list of computer names from a .CSV file but I actually want to try a different approach. We are setting up a new Citrix environment that will have identical Citrix Sites in two different data centers - Site A and Site B. I am trying to figure out how to construct a script that requires parameters to be entered and is a single script that will be used to create machines in Site A and/or Site B. Then, using the Citrix SDK, will have another script to create a new Machine catalog that will create new VDA MCS linked clones and target the machines created from the script in question in this post. (That’s the dream anyway.)

The computer names would have a naming convention of the following:


So it would be WIN<TST><SAS>VDA<01>.

The script would ask for the Environment Name, AppNAme, , how many instances, the Active Directory OU location and then which Site. Then it would just use the “New-ADComputer” cmdlt to create the new machine objects in Active Directory at the given Organizational Unit path.

I am trying to avoid requiring a text file to store the computer names so this script can be kept in Team Foundation Server.

You can create a script with all the above mentioned inputs as parameters. It will not be difficult for you to start. If you have not written a PowerShell script before, I highly recommend getting started with it. below videos will easily help you in doing this. If you already have something wrote, please share it here (keeping samples for all confidential stuffs) to give us a better picture on where you are.