In our demo environment, i wanted to create Active Directory as a service.
A lot of customers i talk to, often talk about having to create isolated demo environments, where they can test stuff. In a lot of these demo environments, they need AD, DNS etc. So why not create an application blueprint, where you can install a fresh AD, with all the custom properties you would like.
Prereq : Full working VRA environment with application services configured and agent installed in templates.
Here is how i did it.
- Create a software component.
Make sure Container is Machine.
- Create all the properties needed.
- Configure the install as CMD and edit the script.
- The following script, creates a ad.txt file in the %tmp% directory.
It then runs a dcpromo command, that point to the ad.txt file.Note that the script ends with a exit /b 0
The reason for this, is that dcpromo ends with a error (See more here)
The error is ok, and not important, but the VRA agent, thinks the job ends in error, if you do not set the last line.
If you want to know more, about all the settings you can use in the Unattend file, look at this article.
Below is the code to copy/paste.
echo [DCINSTALL] > %tmp%\ad.txt
echo InstallDNS=%InstallDNS% >> %tmp%\ad.txt
echo NewDomain=%NewDomain% >> %tmp%\ad.txt
echo NewDomainDNSName=%NewDomainDNSName% >> %tmp%\ad.txt
echo DomainNetBiosName=%DomainNetBiosName% >> %tmp%\ad.txt
echo SiteName=%SiteName% >> %tmp%\ad.txt
echo ReplicaOrNewDomain=%ReplicaOrNewDomain% >> %tmp%\ad.txt
echo ForestLevel=%ForestLevel% >> %tmp%\ad.txt
echo DomainLevel=%DomainLevel% >> %tmp%\ad.txt
echo DatabasePath=%DatabasePath% >> %tmp%\ad.txt
echo LogPath=%LogPath% >> %tmp%\ad.txt
echo RebootOnCompletion=%RebootOnCompletion% >> %tmp%\ad.txt
echo SYSVOLPath=%SYSVOLPath% >> %tmp%\ad.txt
echo SafeModeAdminPassword=%SafeModeAdminPassword% >> %tmp%\ad.txt
exit /b 0
- After this, you are ready to publish the Software Component, and use it in your blueprints.If you want to expose the properties, in the blueprint request, it might be a good idea to update the descriptions, so the values make more sense.
I hope you found this useful.