Citrix Virtual Apps and Desktops 2402 SDK

New-XDSite

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

Syntax

New-XDSite
   [-AllDefaultDatabases]
   [-DatabaseMirrorServer <String>]
   [-DatabaseNamePrefix <String>]
   -DatabaseServer <String>
   -SiteName <String>
   [-AdminAddress <String>]
   [<CommonParameters>]
<!--NeedCopy-->
New-XDSite
   [-DatabaseMirrorServer <String>]
   -DatabaseServer <String>
   -LoggingDatabaseName <String>
   -MonitorDatabaseName <String>
   -SiteDatabaseName <String>
   -SiteName <String>
   [-AdminAddress <String>]
   [<CommonParameters>]
<!--NeedCopy-->
New-XDSite
   [-LoggingDatabaseMirrorServer <String>]
   -LoggingDatabaseName <String>
   -LoggingDatabaseServer <String>
   [-MonitorDatabaseMirrorServer <String>]
   -MonitorDatabaseName <String>
   -MonitorDatabaseServer <String>
   [-SiteDatabaseMirrorServer <String>]
   -SiteDatabaseName <String>
   -SiteDatabaseServer <String>
   -SiteName <String>
   [-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

-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

-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

-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

-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

-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

-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

-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

-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

-LoggingDatabaseMirrorServer

If each database was created on a separate SQL Server and SQL Mirroring has been enabled for the 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

-MonitorDatabaseMirrorServer

If each database was created on a separate SQL Server and SQL Mirroring has been enabled for the 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

-SiteDatabaseMirrorServer

If each database was created on a separate SQL Server and SQL Mirroring has been enabled for the 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

-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