Active Directory – Creating a New AD LDS Instance Without the Setup Wizard

active-directoryad-ldspowershellscriptingwindows-command-prompt

Is the installation of a new unique instance of AD LDS (using either cmd or PowerShell) possible? All resources I can find online just use the Active Directory Lightweight Directory Services Setup Wizard.

PowerShell has the Active Directory Module for working with existing LDS instances but I have not found a way that it can be used for creating a new instance of AD LDS.

Best Answer

Yes, the "secret sauce" is a command called AdamInstall.exe, which can be run to perform unattended instance setups. You can run AdamInstall.exe on Server Core. Begin by creating this answer text file.

[ADAMInstall]
InstallType=Unique
InstanceName=InstanceName
LocalLDAPPortToListenOn=PortNumiber
LocalSSLPortToListenOn=PortNumiber
NewApplicationPartitionToCreate=PartitionName
DataFilesPath=D:\ADAMInstances\InstanceName\Data
LogFilesPath=D:\ADAMInstances\InstanceName\Data
ServiceAccount=DomainorMachineName\AccountName
ServicePassword=Password
Administrator=Domain\GroupName
ImportLDIFFiles="LDIFFilename1" "LDIFFilename2" "LDIFFilename3" 
SourceUserName=DomainorMachineName\AccountName SourcePassword=Password“