Notes
The scripts returned support Microsoft SQL Server Express Edition, Microsoft SQL Server Standard Edition, and Microsoft SQL Server Enterprise Edition databases only, and are generated on the assumption that integrated authentication will be used.
If the ScriptType parameter is not included or set to 'FullDatabase', the full database script is returned, which will:
Create the database schema.
Create the user and the role (providing the schema does not already exist).
Create the logon (providing the schema does not already exist).
If the ScriptType parameter is set to 'Instance', the script will:
Create the user and the role (providing the schema does not already exist).
Create the logon (providing the schema does not already exist) and associate it with a user.
If the ScriptType parameter is set to 'Login', the script will:
Create the logon (providing the schema does not already exist) and associate it with a pre-existing user of the same name.
If the LocalDatabase parameter is included, the NetworkService account will be added to the list of accounts permitted to access the database. This is required only if the database is run on a controller.
If the command fails, the following errors can be returned.
Error Codes
-----------
GetSchemasFailed
The database schema could not be found.
ActiveDirectoryAccountResolutionFailed
The specified Active Directory account or Group could not be found.
DatabaseError
An error occurred in the service while attempting a database operation.
DatabaseNotConfigured
The operation could not be completed because the database for the service is not configured.
DataStoreException
An error occurred in the service while attempting a database operation - communication with the database failed for various reasons.
PermissionDenied
You do not have permission to execute this command.
AuthorizationError
There was a problem communicating with the Citrix Delegated Administration Service.
CommunicationError
There was a problem communicating with the remote service.
ExceptionThrown
An unexpected error occurred. For more details, see the Windows event logs on the controller or the XenDesktop logs.