Perform an Unattended Install of an AD LDS Instance
Applies To: Windows Server 2008
You can use this procedure to perform an unattended install of an Active Directory Lightweight Directory Services (AD LDS) instance without user intervention. An unattended AD LDS installation requires an answer file (Answer.txt) that contains a set of preconfigured installation options.
Membership in Administrators, or equivalent, is the minimum required to complete this procedure. Review details about using the appropriate accounts and group memberships at Local and Domain Default Groups (https://go.microsoft.com/fwlink/?LinkId=83477). By default, the security principal that you specify as the AD LDS administrator during AD LDS setup becomes a member of the Administrators group in the configuration partition.
To perform an unattended install of an AD LDS instance
Create a new text file by using any text editor.
As an alternative, you can copy and paste the following sample answer file into your answer file.
[ADAMInstall] ; The following line specifies to install a unique ADAM instance. InstallType=Unique ; The following line specifies the name to be assigned to the new instance. InstanceName=MyFirstInstance ; The following line specifies the communications port to use for LDAP. LocalLDAPPortToListenOn=389 ; The following line specifies an application partition to create NewApplicationPartitionToCreate="o=microsoft,c=us" ; The following line specifies the directory to use for ADAM data files. DataFilesPath=C:\Program Files\Microsoft ADAM\instance1\data ; The following line specifies the directory to use for ADAM log files. LogFilesPath=C:\Program Files\Microsoft ADAM\instance1\data ; The following line specifies the .ldf files to import into the ADAM schema. ImportLDIFFiles="ms-inetorgperson.ldf" "ms-user.ldf"
Specify the installation parameters that are described in the table that immediately follows this procedure, and then save your answer file.
At a command prompt (or in a batch or script file), change to the drive and directory that contains the AD LDS setup files.
To open a command prompt, click Start, click Run, and type
cmd
.At the command prompt, type the following command, and then press ENTER:
%systemroot%\ADAM\adaminstall.exe /answer:drive:\<pathname>\<filename>.txt"
Where
drive:\<pathname>\<filename>.txt
represents the drive, path, and file name of your answer file. (The command requires the quotation marks.)
The following table shows the parameters that you can use in an AD LDS answer file. These parameters are not case sensitive. In other words, you can specify either InstallType or installtype in your answer file. However, AD LDS preserves the case for the values that you specify for the instancename and servicepassword parameters.
Note
The default behavior occurs if the parameter is not present in the answer file.
Parameter | Description |
---|---|
InstallType Valid for all installations. Optional. |
Possible values
Default behavior
|
ShowOrHideProgressGUI Valid for all installations. Optional. |
Possible values
Default behavior
|
InstanceName Valid for all installations. Optional. |
Possible values An AD LDS instance name must meet the following requirements:
Default behavior
|
ApplicationPartitionsToReplicate Valid only for replica installations. Optional. |
Specifies the distinguished names of the application partitions to replicate from the source AD LDS instance. The following example specifies three application partitions to replicate:
To replicate all application partitions from the source AD LDS instance, specify a wildcard character (*) as the value. AD LDS ignores any value that you specify for ApplicationPartitionsToReplicate if you do not set the value of InstallType to Replica. Default behavior AD LDS does not replicate application partitions. |
ReplicationDataSourcePath Valid only for replica installations. When a value for this parameter is present, AD LDS setup attempts an installation from media. If the value for this parameter is not valid, AD LDS setup writes an error to the setup log. |
Specifies the directory path to a restored instance of AD LDS data. AD LDS ignores any value that you specify for ReplicationDataSourcePath if you do not set InstallType to Replica or if you do not also specify a value for ReplicationLogSourcePath. Default behavior AD LDS replicates application data over the network, rather than from a restored backup of an AD LDS instance. If you specify a value for this parameter, but not for ReplicationLogSourcePath, an error occurs. |
ReplicationLogSourcePath Valid only for replica installations. When a value for this parameter is present, AD LDS setup attempts an installation from media. If the value for this parameter is not valid, AD LDS setup writes an error to the setup log. |
Specifies the directory path to the log file for a restored instance of AD LDS. AD LDS ignores any value that you specify for ReplicationLogSourcePath if you do not set the value of InstallType to Replica or if you do not also specify a value for ReplicationDataSourcePath. Default behavior AD LDS replicates application data over the network, rather than from a restored backup of an AD LDS instance. If you specify a value for this parameter, but not for ReplicationDataSourcePath, an error occurs. |
LocalLDAPPortToListenOn Required for all installations. |
Possible values
|
LocalSSLPortToListenOn Required for all installations. SourceServer Required for replica installations. |
Default behavior
|
SourceServer Required for replica installations. |
Possible values
Default behavior
|
SourceLDAPPort Required for replica installations. |
Possible values
Default behavior
|
NewApplicationPartitionToCreate Valid for installations of new, unique AD LDS instances. Optional. |
Possible values
Default behavior
|
DataFilesPath Valid for all installations. Optional. |
Possible values
Default behavior
|
LogFilesPath Valid for all installations. Optional. |
Possible values
Default behavior
|
ServiceAccount Valid for all installations. Optional. |
Possible values
Default behavior
|
AddPermissionsToServiceAccount Valid for all installations. Optional. |
Possible values
Default behavior
|
ServicePassword Valid for all installations. Required, unless ServiceAccount is the Network Service account. |
Possible values
Default behavior
|
Administrator Valid for all installations. Optional. |
Possible values
Default behavior
|
ShowInAddRemovePrograms Valid for all installations. Optional. |
Possible values
Default behavior
|
ImportLDIFFiles |
Possible values
Default behavior
|
SourceUserName SourcePassword Valid for replica installations. Optional. |
Possible values
Default behavior
|
AD LDS uses the following registry key to return error codes and messages to the caller when you install or uninstall AD LDS: HKLM\Software\Microsoft\Windows\CurrentVersion\ADAM_Installer_Results
AD LDS setup creates this registry key and associated values only if errors or warnings occur. The following table shows values for this registry key.
Key | Contents |
---|---|
ADAMInstallErrorCode |
The numeric error code that caused the installer to fail |
ADAMInstallErrorMessage |
A message that is associated with the install error code |
ADAMInstallWarnings |
Messages that are associated with the install warnings |
ADAMUninstallErrorCode |
The numeric error code that caused the uninstall to fail |
ADAMUninstallErrorMessage |
A message that is associated with the uninstall error code |
ADAMUninstallWarnings |
Messages that are associated with the uninstall warnings |