@@ -3568,30 +3568,35 @@ function New-HVPool {
|
|||||||
[string[]]
|
[string[]]
|
||||||
$ConnectionServerRestrictions,
|
$ConnectionServerRestrictions,
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.powerPloicy
|
#desktopSpec.desktopSettings.logoffSettings.powerPolicy
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[ValidateSet('TAKE_NO_POWER_ACTION', 'ALWAYS_POWERED_ON', 'SUSPEND', 'POWER_OFF')]
|
[ValidateSet('TAKE_NO_POWER_ACTION', 'ALWAYS_POWERED_ON', 'SUSPEND', 'POWER_OFF')]
|
||||||
[string]$PowerPolicy = 'TAKE_NO_POWER_ACTION',
|
[string]$PowerPolicy = 'TAKE_NO_POWER_ACTION',
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.powerPloicy
|
#desktopSpec.desktopSettings.logoffSettings.powerPolicy
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[ValidateSet('IMMEDIATELY', 'NEVER', 'AFTER')]
|
[ValidateSet('IMMEDIATELY', 'NEVER', 'AFTER')]
|
||||||
[string]$AutomaticLogoffPolicy = 'NEVER',
|
[string]$AutomaticLogoffPolicy = 'NEVER',
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.automaticLogoffMinutes
|
#desktopSpec.desktopSettings.logoffSettings.automaticLogoffMinutes
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[ValidateRange(1,[int]::MaxValue)]
|
[ValidateRange(1,[int]::MaxValue)]
|
||||||
[int]$AutomaticLogoffMinutes = 120,
|
[int]$AutomaticLogoffMinutes = 120,
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.allowUsersToResetMachines
|
#desktopSpec.desktopSettings.logoffSettings.allowUsersToResetMachines
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[boolean]$allowUsersToResetMachines = $false,
|
[boolean]$allowUsersToResetMachines = $false,
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.allowMultipleSessionsPerUser
|
#desktopSpec.desktopSettings.logoffSettings.allowMultipleSessionsPerUser
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[boolean]$allowMultipleSessionsPerUser = $false,
|
[boolean]$allowMultipleSessionsPerUser = $false,
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.deleteOrRefreshMachineAfterLogoff
|
#desktopSpec.desktopSettings.logoffSettings.deleteOrRefreshMachineAfterLogoff
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[ValidateSet('NEVER', 'DELETE', 'REFRESH')]
|
[ValidateSet('NEVER', 'DELETE', 'REFRESH')]
|
||||||
[string]$deleteOrRefreshMachineAfterLogoff = 'NEVER',
|
[string]$deleteOrRefreshMachineAfterLogoff = 'NEVER',
|
||||||
@@ -3612,25 +3617,30 @@ function New-HVPool {
|
|||||||
|
|
||||||
#DesktopDisplayProtocolSettings
|
#DesktopDisplayProtocolSettings
|
||||||
#desktopSpec.desktopSettings.logoffSettings.supportedDisplayProtocols
|
#desktopSpec.desktopSettings.logoffSettings.supportedDisplayProtocols
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[ValidateSet('RDP', 'PCOIP', 'BLAST')]
|
[ValidateSet('RDP', 'PCOIP', 'BLAST')]
|
||||||
[string[]]$supportedDisplayProtocols = @('RDP', 'PCOIP', 'BLAST'),
|
[string[]]$supportedDisplayProtocols = @('RDP', 'PCOIP', 'BLAST'),
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.defaultDisplayProtocol
|
#desktopSpec.desktopSettings.logoffSettings.defaultDisplayProtocol
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[ValidateSet('RDP', 'PCOIP', 'BLAST')]
|
[ValidateSet('RDP', 'PCOIP', 'BLAST')]
|
||||||
[string]$defaultDisplayProtocol = 'PCOIP',
|
[string]$defaultDisplayProtocol = 'PCOIP',
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.allowUsersToChooseProtocol
|
#desktopSpec.desktopSettings.logoffSettings.allowUsersToChooseProtocol
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[int]$allowUsersToChooseProtocol = $true,
|
[int]$allowUsersToChooseProtocol = $true,
|
||||||
|
|
||||||
#desktopSpec.desktopSettings.logoffSettings.enableHTMLAccess
|
#desktopSpec.desktopSettings.logoffSettings.enableHTMLAccess
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[boolean]$enableHTMLAccess = $false,
|
[boolean]$enableHTMLAccess = $false,
|
||||||
|
|
||||||
# DesktopPCoIPDisplaySettings
|
# DesktopPCoIPDisplaySettings
|
||||||
#desktopSpec.desktopSettings.logoffSettings.pcoipDisplaySettings.renderer3D
|
#desktopSpec.desktopSettings.logoffSettings.pcoipDisplaySettings.renderer3D
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
[Parameter(Mandatory = $false,ParameterSetName = "LINKED_CLONE")]
|
||||||
[ValidateSet('MANAGE_BY_VSPHERE_CLIENT', 'AUTOMATIC', 'SOFTWARE', 'HARDWARE', 'DISABLED')]
|
[ValidateSet('MANAGE_BY_VSPHERE_CLIENT', 'AUTOMATIC', 'SOFTWARE', 'HARDWARE', 'DISABLED')]
|
||||||
[string]$renderer3D = 'DISABLED',
|
[string]$renderer3D = 'DISABLED',
|
||||||
@@ -3980,7 +3990,8 @@ function New-HVPool {
|
|||||||
[string]
|
[string]
|
||||||
$CustType,
|
$CustType,
|
||||||
|
|
||||||
#desktopSpec.automatedDesktopSpec.customizationSettings.reusePreExistingAccounts if LINKED_CLONE
|
#desktopSpec.automatedDesktopSpec.customizationSettings.reusePreExistingAccounts if LINKED_CLONE, INSTANT_CLONE
|
||||||
|
[Parameter(Mandatory = $false,ParameterSetName = 'INSTANT_CLONE')]
|
||||||
[Parameter(Mandatory = $false,ParameterSetName = 'LINKED_CLONE')]
|
[Parameter(Mandatory = $false,ParameterSetName = 'LINKED_CLONE')]
|
||||||
[Boolean]
|
[Boolean]
|
||||||
$ReusePreExistingAccounts = $false,
|
$ReusePreExistingAccounts = $false,
|
||||||
@@ -5211,6 +5222,7 @@ function Get-HVPoolCustomizationSetting {
|
|||||||
throw "No Instant Clone Engine Domain Administrator found with netBiosName: [$netBiosName]"
|
throw "No Instant Clone Engine Domain Administrator found with netBiosName: [$netBiosName]"
|
||||||
}
|
}
|
||||||
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings = Get-CustomizationObject
|
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings = Get-CustomizationObject
|
||||||
|
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.ReusePreExistingAccounts = $reusePreExistingAccounts
|
||||||
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings.InstantCloneEngineDomainAdministrator = $instantCloneEngineDomainAdministrator
|
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings.InstantCloneEngineDomainAdministrator = $instantCloneEngineDomainAdministrator
|
||||||
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings.powerOffScriptName = $powerOffScriptName
|
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings.powerOffScriptName = $powerOffScriptName
|
||||||
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings.powerOffScriptParameters = $powerOffScriptParameters
|
$desktopSpecObj.AutomatedDesktopSpec.CustomizationSettings.CloneprepCustomizationSettings.powerOffScriptParameters = $powerOffScriptParameters
|
||||||
@@ -11352,4 +11364,118 @@ function Clear-HVEventDatabase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Export-ModuleMember Add-HVDesktop,Add-HVRDSServer,Connect-HVEvent,Disconnect-HVEvent,Get-HVPoolSpec,Get-HVInternalName, Get-HVEvent,Get-HVFarm,Get-HVFarmSummary,Get-HVPool,Get-HVPoolSummary,Get-HVMachine,Get-HVMachineSummary,Get-HVQueryResult,Get-HVQueryFilter,New-HVFarm,New-HVPool,Remove-HVFarm,Remove-HVPool,Set-HVFarm,Set-HVPool,Start-HVFarm,Start-HVPool,New-HVEntitlement,Get-HVEntitlement,Remove-HVEntitlement, Set-HVMachine, New-HVGlobalEntitlement, Remove-HVGlobalEntitlement, Get-HVGlobalEntitlement, Set-HVApplicationIcon, Remove-HVApplicationIcon, Get-HVGlobalSettings, Set-HVGlobalSettings, Set-HVGlobalEntitlement, Get-HVResourceStructure, Get-HVLocalSession, Get-HVGlobalSession, Reset-HVMachine, Remove-HVMachine, Get-HVHealth, New-HVPodfederation, Remove-HVPodFederation, Get-HVPodFederation, Register-HVPod, Unregister-HVPod, Set-HVPodFederation,Get-HVSite,New-HVSite,Set-HVSite,Remove-HVSite,New-HVHomeSite,Get-HVHomeSite,Set-HVEventDatabase,Get-HVEventDatabase,Clear-HVEventDatabase
|
function Set-HVlicense {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Sets or changes the license for Horizon View
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Sets or changes the license for Horizon View
|
||||||
|
|
||||||
|
.PARAMETER license
|
||||||
|
License key (string)
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
set-hvlicense -license "LICENSE-KEY"
|
||||||
|
Returns information about the sites within a Horizon View Pod Federation.
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.4,7.5
|
||||||
|
PowerCLI Version : PowerCLI 10
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]
|
||||||
|
$license,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$services.license.license_set($license)
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
write-error $_.exception message
|
||||||
|
break
|
||||||
|
}
|
||||||
|
$licenseresult=$services.license.license_get()
|
||||||
|
return $licenseresult
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Get-HVlicense {
|
||||||
|
<#
|
||||||
|
.Synopsis
|
||||||
|
Gets the license for Horizon View
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Gets the license for Horizon View
|
||||||
|
|
||||||
|
|
||||||
|
.PARAMETER HvServer
|
||||||
|
Reference to Horizon View Server to query the virtual machines from. If the value is not passed or null then
|
||||||
|
first element from global:DefaultHVServers would be considered in-place of hvServer
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
get-hvlicense
|
||||||
|
|
||||||
|
|
||||||
|
.NOTES
|
||||||
|
Author : Wouter Kursten
|
||||||
|
Author email : wouter@retouw.nl
|
||||||
|
Version : 1.0
|
||||||
|
|
||||||
|
===Tested Against Environment====
|
||||||
|
Horizon View Server Version : 7.4,7.5
|
||||||
|
PowerCLI Version : PowerCLI 10
|
||||||
|
PowerShell Version : 5.0
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $false,
|
||||||
|
ConfirmImpact = 'High'
|
||||||
|
)]
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
$HvServer = $null
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
$services = Get-ViewAPIService -hvServer $hvServer
|
||||||
|
if ($null -eq $services) {
|
||||||
|
Write-Error "Could not retrieve ViewApi services from connection object"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
$license=$services.license.license_get()
|
||||||
|
return $license
|
||||||
|
[System.gc]::collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
Export-ModuleMember Add-HVDesktop,Add-HVRDSServer,Connect-HVEvent,Disconnect-HVEvent,Get-HVPoolSpec,Get-HVInternalName, Get-HVEvent,Get-HVFarm,Get-HVFarmSummary,Get-HVPool,Get-HVPoolSummary,Get-HVMachine,Get-HVMachineSummary,Get-HVQueryResult,Get-HVQueryFilter,New-HVFarm,New-HVPool,Remove-HVFarm,Remove-HVPool,Set-HVFarm,Set-HVPool,Start-HVFarm,Start-HVPool,New-HVEntitlement,Get-HVEntitlement,Remove-HVEntitlement, Set-HVMachine, New-HVGlobalEntitlement, Remove-HVGlobalEntitlement, Get-HVGlobalEntitlement, Set-HVApplicationIcon, Remove-HVApplicationIcon, Get-HVGlobalSettings, Set-HVGlobalSettings, Set-HVGlobalEntitlement, Get-HVResourceStructure, Get-HVLocalSession, Get-HVGlobalSession, Reset-HVMachine, Remove-HVMachine, Get-HVHealth, New-HVPodfederation, Remove-HVPodFederation, Get-HVPodFederation, Register-HVPod, Unregister-HVPod, Set-HVPodFederation,Get-HVSite,New-HVSite,Set-HVSite,Remove-HVSite,New-HVHomeSite,Get-HVHomeSite,Set-HVEventDatabase,Get-HVEventDatabase,Clear-HVEventDatabase,Get-HVlicense,Set-HVlicense
|
||||||
|
|||||||
Reference in New Issue
Block a user