Citrix Virtual Apps and Desktops 2411 SDK

New-XDSite

Configures the databases for use with a new Site and initializes all of the associated Site services.

Syntax

New-XDSite
   [-AllDefaultDatabases]
   -SiteName <String>
   [-DatabaseNamePrefix <String>]
   -DatabaseServer <String>
   [-DatabaseMirrorServer <String>]
   [-ServiceDatabaseCredentials <PSCredential>]
   [-DatabaseEdition <DatabaseServerEdition>]
   [-AuthenticationMode <DatabaseAuthenticationMode>]
   [-AdminAddress <String>]
   [<CommonParameters>]
<!--NeedCopy-->
New-XDSite
   -SiteName <String>
   -SiteDatabaseName <String>
   -SiteDatabaseServer <String>
   [-SiteDatabaseMirrorServer <String>]
   [-SiteServiceDatabaseCredentials <PSCredential>]
   -LoggingDatabaseName <String>
   -LoggingDatabaseServer <String>
   [-LoggingDatabaseMirrorServer <String>]
   [-LoggingServiceDatabaseCredentials <PSCredential>]
   -MonitorDatabaseName <String>
   -MonitorDatabaseServer <String>
   [-MonitorDatabaseMirrorServer <String>]
   [-MonitorServiceDatabaseCredentials <PSCredential>]
   [-DatabaseEdition <DatabaseServerEdition>]
   [-AuthenticationMode <DatabaseAuthenticationMode>]
   [-AdminAddress <String>]
   [<CommonParameters>]
<!--NeedCopy-->
New-XDSite
   -SiteName <String>
   -DatabaseServer <String>
   [-DatabaseMirrorServer <String>]
   [-ServiceDatabaseCredentials <PSCredential>]
   -SiteDatabaseName <String>
   -LoggingDatabaseName <String>
   -MonitorDatabaseName <String>
   [-DatabaseEdition <DatabaseServerEdition>]
   [-AuthenticationMode <DatabaseAuthenticationMode>]
   [-AdminAddress <String>]
   [<CommonParameters>]
<!--NeedCopy-->

Description

Configures the Site for first use. This must be run after the databases have been created. The databases may have been created manually using the scripts generated from Get-XDDatabaseSchema or automatically using New-XDDatabase.

The site will run in a grace period until Set-XDLicensing is used to configure licensing.

For database mirroring please refer to “about_XenDesktopModule_SiteConfiguration”.

Examples

EXAMPLE 1

Configures a site called ‘MySite’ for the Controller ‘MyController’. All previously created databases have default names and are hosted on the SQL Server ‘MySqlServer\Instance_1’.

New-XDSite -AdminAddress MyController -AllDefaultDatabases -DatabaseServer MySqlServer\Instance_1 -SiteName MySite
<!--NeedCopy-->

EXAMPLE 2

Configures a site called ‘MySite’ for the Controller ‘MyController’. All previously created databases have default names, are hosted on the SQL Server ‘MySqlServer’ and mirrored on the SQL Server ‘MySqlMirror’.

New-XDSite -AdminAddress MyController -AllDefaultDatabases -DatabaseServer MySqlServer -DatabaseMirrorServer MySqlMirror -SiteName MySite
<!--NeedCopy-->

EXAMPLE 3

Configures a site called ‘MySite’ for the Controller ‘MyController’. All previously created databases have default names with a prefix of ‘MyPrefix-‘ and are hosted on the SQL Server ‘MySqlServer’.

New-XDSite -AdminAddress MyController -AllDefaultDatabases -DatabaseServer MySqlServer -SiteName MySite -DatabaseNamePrefix MyPrefix-
<!--NeedCopy-->

EXAMPLE 4

Configures a site called ‘MySite’ for the Controller ‘MyController’. The previously created databases have non-default names of ‘LoggingDb’ for the Configuration Logging Database, ‘MonitorDb’ for Monitoring Database and ‘SiteDb’ for the Site Configuration Database. All databases are hosted on the SQL Server ‘MySqlServer’.

New-XDSite -AdminAddress MyController -DatabaseServer MySqlServer -LoggingDatabaseName LoggingDb -MonitorDatabaseName MonitorDb -SiteDatabaseName SiteDb -SiteName MySite
<!--NeedCopy-->

EXAMPLE 5

Configures a site called ‘MySite’ for the Controller ‘MyController’.

The previously created databases have non-default names and are hosted on individual SQL Servers. ‘LoggingDb’ and ‘LoggingSqlServer ‘for the Configuration Logging Database. ‘MonitorDb’ and ‘MonitorSqlServer’ for Monitoring Database. ‘SiteDb’ and ‘SiteSqlServer’ for the Site Configuration Database.

New-XDSite -AdminAddress MyController -LoggingDatabaseName LoggingDb -LoggingDatabaseServer LoggingSqlServer -MonitorDatabaseName MonitorDb -MonitorDatabaseServer MonitorSqlServer -SiteDatabaseName SiteDb -SiteDatabaseServer SiteSqlServer -SiteName MySite
<!--NeedCopy-->

Parameters

-AllDefaultDatabases

Indicates that all the databases that are to be used in this Site were created with their default names.

Type: SwitchParameter
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-SiteName

The name of the Site that is to be created.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-DatabaseServer

If all databases were created within a single SQL Server, this is the address of that server. This must include the SQL Instance name.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-SiteDatabaseName

If databases were not created using their default names, this is the name of the Site Configuration Database.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-LoggingDatabaseName

If databases were not created using their default names, this is the name of the Configuration Logging Database.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-MonitorDatabaseName

If databases were not created using their default names, this is the name of the Monitoring Database.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-SiteDatabaseServer

If each database was created on a separate SQL Server, this is the name of the SQL Server hosting the Site Configuration Database. This must include any applicable SQL Instance name.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-LoggingDatabaseServer

If each database was created on a separate SQL Server, this is the name of the SQL Server hosting the Configuration Logging Database. This must include any applicable SQL Instance name.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-MonitorDatabaseServer

If each database was created on a separate SQL Server, this is the name of the SQL Server hosting the Monitoring Database. This must include any applicable SQL Instance name.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-DatabaseNamePrefix

If a name prefix was applied to the default database names during the original creation of the databases, this specifies that name prefix.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-DatabaseMirrorServer

If all databases were created within a single SQL Server and SQL Mirroring has been enabled for those databases, this is the address of the SQL Server that is acting as the Mirror. This must include the SQL Instance name.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-ServiceDatabaseCredentials

If all databases were created within a single SQL Server with the SQL Server Authentication mode, this is the credentials of those databases. The credentials are used by Controller Services.

Type: PSCredential
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-DatabaseEdition

The edition of the SQL server in which databases created for the site. Valid values are:

  • OnPrem

The On-premises Microsoft SQL Server.

  • Azure

The Microsoft Azure SQL Database.

Type: DatabaseServerEdition
Accepted values: Azure, OnPrem
Position: Named
Default value: OnPrem
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-AuthenticationMode

The authentication mode of the SQL server in which databases created for the site. Valid values are:

  • Windows

The Integrated Windows Authentication mode.

  • SQLServer

The SQL Server Authentication mode.

Type: DatabaseAuthenticationMode
Accepted values: Windows, SQLServer
Position: Named
Default value: Windows
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-SiteDatabaseMirrorServer

If each database was created on a separate SQL Server and SQL Mirroring has been enabled for the Site Configuration Database, this is the address of the SQL Server that is acting as the mirror. This must include any applicable SQL Instance name.

Type: String
Position: Named
Default value: If this parameter is not provided, the mirror server is determined by querying the SQL Server that is hosting the Site Configuration Database.
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SiteServiceDatabaseCredentials

If each database was created on a separate SQL Server with the SQL Server Authentication mode, this is the credentials of the Site Configuration Database. The credentials are used by Controller Services.

Type: PSCredential
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-LoggingDatabaseMirrorServer

If each database was created on a separate SQL Server and SQL Mirroring has been enabled for the Configuration Logging Database, this is the address of the SQL Server that is acting as the mirror. This must include any applicable SQL Instance name.

Type: String
Position: Named
Default value: If this parameter is not provided, the mirror server is determined by querying the SQL Server hosting the Configuration Logging Database.
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-LoggingServiceDatabaseCredentials

If each database was created on a separate SQL Server with the SQL Server Authentication mode, this is the credentials of the Configuration Logging Database. The credentials are used by Controller Services.

Type: PSCredential
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-MonitorDatabaseMirrorServer

If each database was created on a separate SQL Server and SQL Mirroring has been enabled for the Monitoring Database, this is the address of the SQL Server that is acting as the mirror. This must include any applicable SQL Instance name.

Type: String
Position: Named
Default value: If this parameter is not provided, the mirror server is determined by querying the SQL Server that is hosting the Monitoring Database.
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-MonitorServiceDatabaseCredentials

If each database was created on a separate SQL Server with the SQL Server Authentication mode, this is the credentials of the Monitoring Database. The credentials are used by Controller Services.

Type: PSCredential
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2411

-AdminAddress

Specifies the address of the Delivery Controller to which the PowerShell module will connect. This can be provided as a host name or an IP address.

Type: String
Position: Named
Default value: Localhost. Once a value is provided by any cmdlet, this value will become the default.
Required: False
Accept pipeline input: False
Accept wildcard characters: False

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

Citrix.XenDesktopPowerShellSdk.ServiceInterfaces.Configuration.Site

This includes the name of the Site, the Delivery Controllers in Site, the Databases supporting the Site, the metadata associated with the Site, the licensing configuration of the Site, and the default Icon for the Site.

Notes

The parameter set used with this cmdlet is dependent on the manner in which the databases were previously created.

If the databases were created with default names on a single SQL Server, use the following parameter set:

New-XDSite -AllDefaultDatabases -DatabaseServer <String> -SiteName <String> [-DatabaseMirrorServer <String>] [-DatabaseNamePrefix <String>] [-AdminAddress <String>]

If the databases were created with non-default names on a single SQL Server, use the following parameter set:

New-XDSite -DatabaseServer <String> -LoggingDatabaseName <String> -MonitorDatabaseName <String> -SiteDatabaseName <String> -SiteName <String> [-DatabaseMirrorServer <String>] [-AdminAddress <String>]

If the databases were created on seperate SQL Servers, use the following parameter set:

New-XDSite -LoggingDatabaseName <String> -LoggingDatabaseServer <String> -MonitorDatabaseName <String> -MonitorDatabaseServer <String> -SiteDatabaseName <String> -SiteDatabaseServer <String> -SiteName <String> [-LoggingDatabaseMirrorServer <String>] [-MonitorDatabaseMirrorServer <String>] [-SiteDatabaseMirrorServer <String>] [-AdminAddress <String>]

The command can fail for the following reasons:

  • The Site associated with the Controller at AdminAddress is already configured.
  • One or more of the specified databases could not be found.
  • One or more of the specified databases does not have the necessary permissions for the Controller at AdminAddress.
New-XDSite