-
Understanding the Citrix Virtual Apps and Desktops Administration Model
-
-
-
-
-
Get-BrokerDBSchema
-
-
-
-
-
-
-
-
-
-
-
This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
Get-BrokerDBSchema
Gets SQL scripts to create or maintain the database schema for the Citrix Broker Service.
Syntax
Get-BrokerDBSchema
-DatabaseName <String>
[-ServiceGroupName <String>]
[-ScriptType <DatabaseScriptType>]
[-SID <String>]
[-LocalDatabase]
[-DatabaseRights <String>]
[-AzureDatabase]
[<CitrixCommonParameters>]
[<CommonParameters>]
<!--NeedCopy-->
Description
Gets SQL scripts that can be used to create a new Citrix Broker Service database schema, add a new Broker service to an existing site, remove a Broker service from a site, or create a database server logon for a Broker service.
If no Sid parameter is provided, the scripts obtained relate to the currently selected Broker service instance, otherwise the scripts relate to Broker service instance running on the machine identified by the Sid provided. When obtaining the Evict script, a Sid parameter must be supplied.
The current service instance is the one on the local machine, or the one most recently specified using the -AdminAddress parameter of a Broker SDK cmdlet.
The service instance used to obtain the scripts does not need to be a member of a site or to have had its database connection configured.
The database scripts support only Microsoft SQL Server, or SQL Server Express, and require Windows integrated authentication to be used. They can be run using SQL Server’s SQLCMD utility, or by copying the script into an SQL Server Management Studio (SSMS) query window and executing the query. If using SSMS, the query must be executed in ‘SQLCMD mode’.
The ScriptType parameter determines which script is obtained. If ScriptType is not specified, or is FullDatabase, the script contains:
- Creation of service schema
- Creation of database server logon
- Creation of database user
- Addition of database user to Broker service roles
If ScriptType is Instance, the returned script contains:
- Creation of database server logon
- Creation of database user
- Addition of database user to Broker service roles
If ScriptType is Evict, the returned script contains:
- Removal of Broker service instance from database
- Removal of database user
If ScriptType is Login, the returned script contains:
- Creation of database server logon only
ScriptType Database is deprecated, and FullDatabase should be used instead.
If the service uses two data stores they can exist in the same database.
You do not need to configure a database before using this command.
Examples
EXAMPLE 1
Gets a script to create the full database schema for the Citrix Broker Service and copies it to a file called “C:\BrokerSchema.sql”
This script can be used to create the service schema in a database with name “MySiteDB”, which must already exist, and must not already contain a Broker service schema.
Get-BrokerDBSchema -DatabaseName MySiteDB -ServiceGroupName MyServiceGroup > C:\BrokerSchema.sql
<!--NeedCopy-->
EXAMPLE 2
Gets a script to create the appropriate database server logon for the Broker service. This can be used when configuring a mirror server for use.
Get-BrokerDBSchema -DatabaseName MySiteDB -ScriptType Login > C:\BrokerLogins.sql
<!--NeedCopy-->
Parameters
-DatabaseName
Specifies the name of the database into which the new Broker service schema is to be placed, or in which it already exists. The database itself is not created by any of the script types; it must already exist before the scripts are run.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Length range: | 1 to 128 |
-ServiceGroupName
Specifies the name of the service group to be used when creating the database schema. The service group is a collection of all the Broker services that share the same database instance and are considered equivalent; that is, all the services within a service group can be used interchangeably.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Length range: | 1 to 64 |
-ScriptType
Specifies the type of database script returned. Available script types are:
-
FullDatabase
Creates a database schema for the Citrix Broker Service in a database instance that does not already contain one. This is used when creating a new site. DatabaseName and ServiceGroupName are required parameters for this script type.
-
Instance
Adds a Broker Service instance to a database and so to the associated site. Appropriate database server logons and users are created to allow the service instance access to the required service schemas.
-
Evict
Removes a Broker Service instance from the database and so from the site. All reference to the service instance is removed from the database. DatabaseName and Sid are required parameters for this script type.
-
Login
Adds a logon for the Broker Service instance to a database server. This is specifically for use when configuring SQL Server mirroring where the mirror server must have appropriate logons created for all service instances in the site.
-
Database
This is deprecated. FullDatabase should be used instead.
Type: | DatabaseScriptType |
Accepted values: | FullDatabase, Instance, Evict, Login, Database |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SID
Specifies the SID of the controller on which the Broker Service instance to remove from the database is running (only valid for a script type of Evict).
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LocalDatabase
Specifies whether the database script is to be used in a database instance run on the same controller as other services in the service group. Including this parameter ensures the script creates only the required permissions for local services to access the database schema for Broker services. If this parameter is specified inappropriately, the service instance will not be able to connect to the database.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseRights
Specifies the right the database script should expect to be run under. Available rights are:
-
Mixed
Creates a database schema which uses all rights.
-
SysAdmin
Creates a database schema which does the minimum with the SysAdmin (sa) rights.
-
DbOwner
Creates a database schema which only needs Database Owner (dbo) rights. This script expects to be used after the SysAdmin script has been run.
Type: | String |
Position: | Named |
Default value: | Mixed |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AzureDatabase
Specifies that the generated schema must be compatible with Azure SQL limits, including not generating code for logins.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Introduced in: | Citrix Virtual Apps and Desktop 7 2003 |
CitrixCommonParameters
This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None
You cannot pipe input into this cmdlet.
Outputs
String
A string containing the required SQL script for applying to a database.
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.
ScriptType value of ‘Database’ is deprecated; ‘FullDatabase’ should be used instead.
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:
-
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.
Related Links
Share
Share
In this article
This Preview product documentation is Citrix Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Citrix Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Citrix product purchase decisions.
If you do not agree, select I DO NOT AGREE to exit.