Create a DesktopGroup for XD5.6

#—————————————————————————————————
#PowerShell sample script to create a new shared XenDesktop 5.x desktop group
#
#Note: One or more required values must be specified below before executing the script.
#
#
#
#Version 1.0
#———————————————————————————————–

#Provide the following values before executing:

#The FQDN for the DDC and XML port, if not the default of 80
#Eg: ‘ddc01.domain.com:80’
$ddcAddress = ”

#The name for the desktop group
$desktopGroupName = ”

#The name of the pooled random catalog from which machines will be assigned
$catalogName = ”

#The number of machines from the Catalog to add to the Desktop Group
$count = 1

#User to add to this desktop group
#This variable is a string array with the format of:
# @(‘DOMAIN\UserOrGroup1’, ‘DOMAIN\UserOrGroup2’, ‘DOMAIN\UserOrGroup3′)
$users = @(”)

#End of variables
#******************************************************************
asnp Citrix.*

#Create a desktop group and default settings
$desktopGroup = New-BrokerDesktopGroup -DesktopKind Shared `
-Name $desktopGroupName `
-AdminAddress $ddcAddress

#Add machines from a catalog to the desktop group
Add-BrokerMachinesToDesktopGroup -Catalog $catalogName `
-Count $count `
-DesktopGroup $desktopGroupName `
-AdminAddress $ddcAddress

#Loop through the users list and create a new broker user for each
ForEach ($user In $users) { New-BrokerUser -Name $user -AdminAddress $ddcAddress }

#Create an entitlement policy rule to grant users access to the desktop group
New-BrokerEntitlementPolicyRule -Name $desktopGroupName’_EPR’ `
-DesktopGroupUid $desktopGroup.Uid `
-Enabled $true `
-IncludedUsers $users `
-AdminAddress $ddcAddress

#Create an access policy rule for the desktop group
New-BrokerAccessPolicyRule -Name $desktopGroupName’_APR’ `
-Enabled $true `
-IncludedDesktopGroupFilterEnabled $true `
-IncludedDesktopGroups $desktopGroupName `
-AdminAddress $ddcAddress

#Create a power time scheme for the desktop group
New-BrokerPowerTimeScheme -Name $desktopGroupName’_PTS_Weekdays’ `
-DisplayName ‘Weekdays’ `
-DaysOfWeek ‘Weekdays’ `
-DesktopGroupUid $desktopGroup.Uid `
-AdminAddress $ddcAddress

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.